-
Notifications
You must be signed in to change notification settings - Fork 787
[libclc] Add new function implementations in math. #4849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
int##HALF_VEC_LEN ep_lo; \ | ||
int##HALF_VEC_LEN ep_hi; \ | ||
GENTYPE res = (GENTYPE)(__spirv_ocl_frexp(x.lo, &ep_lo), \ | ||
__spirv_ocl_frexp(x.hi, &ep_lo)); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__spirv_ocl_frexp(x.hi, &ep_lo)); \ | |
__spirv_ocl_frexp(x.hi, &ep_hi)); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
// #include <math/unary_builtin.inc> | ||
|
||
//#include <spirv/spirv.h> | ||
|
||
#include "tables.h" | ||
//#include <clcmacro.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more commented code.
// #include <spirv/spirv.h> | ||
|
||
// double __clc_remainder(double, double); | ||
// float __clc_remainderf(float, float); | ||
// #ifdef cl_khr_fp16 | ||
// #pragma OPENCL EXTENSION cl_khr_fp16 : enable | ||
// half __clc_remainderf(half, half); | ||
// #endif | ||
// #define __CLC_FUNCTION __spirv_ocl_remainder | ||
// #define __CLC_BUILTIN __clc_remainder | ||
// #define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, f) | ||
// #include <math/binary_builtin.inc> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More commented code.
//#include <spirv/spirv.h> | ||
//#include <clcmacro.h> | ||
|
||
// double __ocml_sincos_f64(double,double); | ||
// float __ocml_sincos_f32(float,float); | ||
|
||
// #define __CLC_FUNCTION __spirv_ocl_sincos | ||
// #define __CLC_BUILTIN __ocml_sincos | ||
// #define __CLC_BUILTIN_F __CLC_XCONCAT(__CLC_BUILTIN, _f32) | ||
// #define __CLC_BUILTIN_D __CLC_XCONCAT(__CLC_BUILTIN, _f64) | ||
// #include <math/binary_builtin.inc> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry,I delete my repository by mistake, and I forked again. But I don't know how to update this request now, should I close this one ,and create a new pull request?
math/logb.cl | ||
math/log2.cl | ||
math/log1p.cl | ||
math/rsqrt.cl | ||
workitem/get_global_size.cl | ||
workitem/get_local_size.cl | ||
workitem/get_num_groups.cl | ||
workitem/get_max_sub_group_size.cl | ||
workitem/get_num_sub_groups.cl | ||
workitem/get_sub_group_id.cl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why workitem/get_sub_group_local_id.cl
and misc/sub_group_shuffle.cl
are removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, the wrong file was selected when submitting, new submission has modified this.
@@ -0,0 +1,11 @@ | |||
#include <spirv/spirv.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add this comment to all new files:
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry,I delete my repository by mistake, and I forked again. But I don't know how to update this request now, should I close this one ,and create a new pull request?
#define __CLC_FUNC __spirv_ocl_remainder | ||
#define __CLC_SW_FUNC __clc_remainder | ||
#define __CLC_BODY <clc_sw_binary.inc> | ||
#include <clc/math/gentype.inc> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <clc/math/gentype.inc> | |
#include <clc/math/gentype.inc> | |
|
||
double __ocml_asin_f64(double); | ||
float __ocml_asin_f32(float); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please unify the white spaces so the files have the same layout?
//===----------------------------------------------------------------------===// | ||
#include <utils.h> | ||
|
||
_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __CLC_FUNC(__CLC_GENTYPE x, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if that's really needed, as only used once?
|
||
double __ocml_log2_f64(double); | ||
float __ocml_log2_f32(float); | ||
half __ocml_log2_f16(half); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be hidden behind an ifdef
?
Also: below clang format and further down commented out code.
#include <clcmacro.h> | ||
|
||
double __ocml_modf_f64(double, double *); | ||
float __ocml_modf_f32(float, float *); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line, to keep it in line with other files?
#include <spirv/spirv.h> | ||
#include <clcmacro.h> | ||
|
||
double __ocml_nextafter_f64(double,double); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-format here and the next line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry,I delete my repository by mistake, and I forked again. But I don't know how to update this request now, should I close this one ,and create a new pull request?
Sorry,I delete my repository by mistake, and I forked again. But I don't know how to update this request now, should I close this one ,and create a new pull request? |
Add some new function implementations in the math package, so that the operator can run normally