Skip to content

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

Merged
merged 6 commits into from
Oct 14, 2020
Merged

ELEMWISE 1arg_2types add MKL kernels #130

merged 6 commits into from
Oct 14, 2020

Conversation

densmirn
Copy link
Contributor

@densmirn densmirn commented Oct 9, 2020

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 to oneapi::mkl::vm::abs
cl::sycl::log is equal to oneapi::mkl::vm::ln

@densmirn densmirn requested a review from shssf October 9, 2020 15:21
@codecov
Copy link

codecov bot commented Oct 9, 2020

Codecov Report

Merging #130 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a0081b...21cd418. Read the comment docs.

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
Copy link
Contributor

@shssf shssf Oct 10, 2020

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); \
Copy link
Contributor

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__) \
Copy link
Contributor

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

@shssf shssf added the in progress Please do not merge. Work is in progress. label Oct 10, 2020
@densmirn densmirn removed the in progress Please do not merge. Work is in progress. label Oct 12, 2020
@@ -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__) \
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@densmirn densmirn force-pushed the feature/1arg_2types branch from d7e08bb to cf91f09 Compare October 14, 2020 11:32
Copy link
Contributor

@shssf shssf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@shssf
Copy link
Contributor

shssf commented Oct 14, 2020

I hope I resolved sources conflict correctly.

@shssf shssf merged commit 07bee6d into master Oct 14, 2020
@shssf shssf deleted the feature/1arg_2types branch October 14, 2020 20:02
@densmirn
Copy link
Contributor Author

I hope I resolved sources conflict correctly.

Looks like yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants