-
Notifications
You must be signed in to change notification settings - Fork 23
add broadcasting for remainder func #714
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
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.
Waiting for green CI.
|
||
cl::sycl::range<1> gws(result_size); | ||
auto kernel_parallel_for_func = [=](cl::sycl::id<1> global_id) { | ||
const size_t i = global_id[0]; /* for (size_t i = 0; i < result_size; ++i) */ |
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.
const size_t i = global_id[0]; /* for (size_t i = 0; i < result_size; ++i) */ | |
const size_t i = global_id[0]; |
std::is_same<_DataType_input2, _DataType_input1>::value) | ||
{ | ||
event = oneapi::mkl::vm::fmod(DPNP_QUEUE, input1_size, input1_data, input2_data, result); | ||
event.wait(); |
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.
use dependent event. Do not wait for each.
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.
use dependent event. Do not wait for each.
const size_t i = global_id[0]; /* for (size_t i = 0; i < result_size; ++i) */ | ||
const _DataType_output input1_elem = (*input1_it)[i]; | ||
const _DataType_output input2_elem = (*input2_it)[i]; | ||
double fmod = cl::sycl::fmod((double)input1_elem, (double)input2_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, use another name for fmod
variable to avoid potential naming collision/ naming conflicts.
|
||
DPNPC_id<_DataType_input1>* input1_it; | ||
const size_t input1_it_size_in_bytes = sizeof(DPNPC_id<_DataType_input1>); | ||
input1_it = reinterpret_cast<DPNPC_id<_DataType_input1>*>(dpnp_memory_alloc_c(input1_it_size_in_bytes)); |
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.
You can call mem allocator at once here.
std::is_same<_DataType_input2, _DataType_input1>::value) | ||
{ | ||
event = oneapi::mkl::vm::fmod(DPNP_QUEUE, input1_size, input1_data, input2_data, result); | ||
event.wait(); |
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.
use dependent event. Do not wait for each.
input1_it->~DPNPC_id(); | ||
input2_it->~DPNPC_id(); |
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.
It seems that we need to redesign this class, if explicitly call of the destructor is required for its interface.
No description provided.