-
Notifications
You must be signed in to change notification settings - Fork 751
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
SYCL spec example throw an instance of 'sycl::_v1::invalid_parameter_error' #7568
Comments
The crash here is because in the verification loop you're using host_accessor rand {a,read_only};
std::cout << std::endl << "Result:" << std::endl;
for (size_t i = 0; i < N; i++) {
std::cout<<"random array rand["<<i<<"] = "<<rand[i]<<std::endl;
// std::cout<<"B B["<<i<<"] = "<<B[i]<<std::endl;
// std::cout<<"C C["<<i<<"] = "<<C[i]<<std::endl;
// Compare the result to the analytic value
if (rand[i] <= 0 || rand[i] >= 100) {
std::cout << "Wrong value " << rand[i] << " on element " << i << " " << std::endl;
exit(-1);
}
} |
There are other problem. 1、what the mean of myKernel.get_infoinfo::kernel::num_args() ? Is parallel_for funcion object operator () arguments ? |
Hi @wangzy0327,
Yes, that query returns a number of arguments your kernel has. When kernel is defined as a named function object, all it member variables are turned into kernel arguments, see 4.12.4. Rules for parameter passing to kernels:
Could you please clarify what do you mean by "queue submit kernel size" here? |
2、why the kernel size from bundle_kernel not equals queue submit kernel size ? for the example function_object.cc
In the example code, it just submit a kernel function by queue.But kernel_bundle get_kernel_ids() get 2 kernel function. In the print result, there are kernel_id :_ZTS12RandomFiller and kernel_id : _ZTSN4sycl3_V16detail18RoundedRangeKernelINS0_4itemILi1ELb1EEELi1E12RandomFillerEE |
The second kernel is implicitly create by our implementation. It is a part of "range rounding" feature (see #2703): when user passes a |
If I want to invoke kernel by online compilation way.,how do I invoke the kernel and set_args in the example? Can you help me?
|
You can find such example in the spec, see 4.11.15.1. Controlling the timing of online compilation Essentially, the only change you need is to call You do not need to pass a |
Describe the bug
terminate called after throwing an instance of 'sycl::_V1::invalid_parameter_error'
what(): Index out of range -30 (PI_ERROR_INVALID_VALUE)
ref
To Reproduce
Please describe the steps to reproduce the behavior:
These are my example code;
my example code
CMakeLists.txt
Environment (please complete the following information):
Additional context
There are other problem.
1、what the mean of myKernel.get_infoinfo::kernel::num_args() ? Is parallel_for funcion object operator () arguments ?
2、why the kernel size from bundle_kernel not equals queue submit kernel size ?
The text was updated successfully, but these errors were encountered: