-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Addition of get_range() method #1050
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
4a422b8
to
4fe72b3
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.
LGTM
sycl/include/CL/sycl/accessor.hpp
Outdated
@@ -1092,6 +1122,11 @@ class accessor<DataT, Dimensions, AccessMode, access::target::local, | |||
|
|||
size_t get_count() const { return getSize().size(); } | |||
|
|||
template <int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0)>> | |||
range<Dimensions> get_range() const { | |||
return getSize(); |
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.
@garimagu, please, make sure that this PR successfully passes latest version of CTS.
getSize()
return type is range<AdjustedDim>
.
Line 828 of http://ci.llvm.intel.com:8010/#/builders/29/builds/144/steps/18/logs/stdio.
[ 80%] Building CXX object tests/accessor/CMakeFiles/test_accessor_objects.dir/accessor_api_local_fp16.cpp.o
In file included from /localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/SYCL-CTS/tests/accessor/accessor_api_local.cpp:9:
In file included from /localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/SYCL-CTS/tests/accessor/../common/common.h:13:
In file included from /localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/SYCL-CTS/tests/accessor/../common/../../util/../tests/common/sycl.h:21:
In file included from /localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/llvm.obj/lib/clang/10.0.0/include/CL/sycl.hpp:11:
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/llvm.obj/lib/clang/10.0.0/include/CL/sycl/accessor.hpp:1127:12: error: no viable conversion from returned value of type 'const range<3>' to function return type 'range<1 aka 1>'
return getSize();
^~~~~~~~~
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/SYCL-CTS/tests/accessor/accessor_api_local_common.h:76:30: note: in instantiation of function template specialization 'cl::sycl::accessor<int, 1, cl::sycl::access::mode::read_write, cl::sycl::access::target::local, cl::sycl::access::placeholder::false_t>::get_range<1, void>' requested here
auto accessorRange = acc.get_range();
^
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/SYCL-CTS/tests/accessor/accessor_api_local_common.h:112:7: note: in instantiation of member function '(anonymous namespace)::check_local_accessor_api_methods<int, 1>::check_get_range' requested here
check_get_range(log, acc, range, is_zero_dim<dims>{});
^
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/SYCL-CTS/tests/accessor/accessor_api_local_common.h:209:3: note: in instantiation of member function '(anonymous namespace)::check_local_accessor_api_methods<int, 1>::operator()' requested here
check_local_accessor_api_methods<T, dims>{count, size}(log, queue, range);
^
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/SYCL-CTS/tests/accessor/accessor_api_local_common.h:234:5: note: in instantiation of function template specialization '(anonymous namespace)::check_local_accessor_api_dim<int, 1>' requested here
check_local_accessor_api_dim<T, 1>(log, count, size, queue, range1d);
^
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/SYCL-CTS/tests/accessor/accessor_api_local.cpp:43:43: note: in instantiation of member function '(anonymous namespace)::check_local_accessor_api_type<int>::operator()' requested here
check_local_accessor_api_type<int>()(log, queue);
^
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/llvm.obj/lib/clang/10.0.0/include/CL/sycl/range.hpp:27:3: note: candidate constructor [with N = 1] not viable: no known conversion from 'const sycl::range<3>' to 'typename std::enable_if<(1 == 1), size_t>::type' (aka 'unsigned long') for 1st argument
range(typename std::enable_if<(N == 1), size_t>::type dim0) : base(dim0) {}
^
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/llvm.obj/lib/clang/10.0.0/include/CL/sycl/range.hpp:58:3: note: candidate constructor not viable: no known conversion from 'const sycl::range<3>' to 'const range<1> &' for 1st argument
range(const range<dimensions> &rhs) = default;
^
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/llvm.obj/lib/clang/10.0.0/include/CL/sycl/range.hpp:59:3: note: candidate constructor not viable: no known conversion from 'const sycl::range<3>' to 'range<1> &&' for 1st argument
range(range<dimensions> &&rhs) = default;
^
/localdisk2/sycl_ci/buildbot/worker/Regression_CTS_CPU/llvm.obj/lib/clang/10.0.0/include/CL/sycl/detail/array.hpp:59:3: note: candidate function
operator cl::sycl::range<dimensions>() const {
^
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.
Fixed the error.
Sorry about missing to check the output. I somehow mentally thought that passing buildbot was good in my case. But it should have rather shown an error as we had discussed earlier.
@bader : From the traces at |
Indeed. I still see |
I can do that. It may take me a little more time since I haven't done changes to CTS yet. |
The change in the spec @ KhronosGroup/SYCL-Docs#31 has added the following functional changes to accessors: Image Accessors: Removed get_size() method and added get_range() method. Local Accessors: Added get_range() method. Signed-off-by: Garima Gupta <[email protected]>
Also optimized other changes done in previous patch to use the converttoArrayofN(Dims, Default_value) method. Signed-off-by: Garima Gupta <[email protected]>
6176d54
to
5417473
Compare
http://ci.llvm.intel.com:8010/#/builders/29/builds/286/steps/18/logs/stdio : Line # 1444 shows that accessor test is passing on opencl CPU. |
The change in the spec @
KhronosGroup/SYCL-Docs#31
has added the following functional changes to accessors:
Image Accessors: Removed get_size() method and added get_range() method.
Local Accessors: Added get_range() method.
Fixes #1023.
Signed-off-by: Garima Gupta [email protected]