-
Notifications
You must be signed in to change notification settings - Fork 22
ELEMWISE 1arg_2types add MKL kernels #130
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
Codecov Report
@@ Coverage Diff @@
## master #130 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 19 19
Lines 1242 1242
Branches 330 330
======================================
Misses 1242 1242 Continue to review full report at Codecov.
|
MACRO_CUSTOM_1ARG_2TYPES_MKL_OP(tanh, cl::sycl::tanh, oneapi::mkl::vm::tanh) | ||
MACRO_CUSTOM_1ARG_2TYPES_MKL_OP(trunc, cl::sycl::trunc, oneapi::mkl::vm::trunc) | ||
|
||
#undef MACRO_CUSTOM_1ARG_2TYPES_MKL_OP |
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 keep all these things in the same file (do not rename file)
@@ -46,7 +46,7 @@ | |||
size_t i = global_id[0]; /*for (size_t i = 0; i < size; ++i)*/ \ | |||
{ \ | |||
_DataType_output input_elem = array1[i]; \ | |||
result[i] = __operation__; \ | |||
result[i] = __operation__(input_elem); \ |
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 keep input_elem
as before. I would propose to keep this flexibility for this moment.
@@ -67,6 +67,50 @@ | |||
|
|||
#include <custom_1arg_2type_tbl.hpp> | |||
|
|||
#define MACRO_CUSTOM_1ARG_2TYPES_MKL_OP(__name__, __operation__, __mkl_operation__) \ |
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 add documentation for this macro (if is not exists).
- please do not use "MKL" in names
dpnp/backend/backend_iface.hpp
Outdated
@@ -400,6 +400,10 @@ INP_DLLEXPORT void custom_var_c( | |||
template <typename _DataType_input, typename _DataType_output> \ | |||
INP_DLLEXPORT void custom_elemwise_##__name__##_c(void* array1, void* result1, size_t size); | |||
|
|||
#define MACRO_CUSTOM_1ARG_2TYPES_2OPS(__name__, __operation1__, __operation2__) \ |
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 we need extra macro? It is the same as existed MACRO_CUSTOM_1ARG_2TYPES_OP
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.
@shssf I didn't find a way how to combine 2 macros with 2 and 3 parameters to a single one with 3 input parameters. Please let me know If you know how to do that.
I tried to use nullptr
for the third parameter of the macro __operation2__
, but it didn't work.
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.
Done!
d7e08bb
to
cf91f09
Compare
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.
👍
I hope I resolved sources conflict correctly. |
Looks like yes. |
Not all the operations supported by MKL, so separated table of the operations on 2 ones (supported and unsupported by MKL).
cl::sycl::fabs
is equal tooneapi::mkl::vm::abs
cl::sycl::log
is equal tooneapi::mkl::vm::ln