Skip to content
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

Add support for SYCL 2020 accessor constructors along with new enums #33

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

facuMH
Copy link
Contributor

@facuMH facuMH commented May 31, 2021

Since Celerity supports many implementations of SYCL and they each have a different degree of support for the SYCL 2020 functionalities, in this first approach I intend to introduce to our users a new option for instantiating accessors, using the new Tags to specify Mode and Target.

A compatibility layer had to be implemented for ComputeCpp since they have not yet implemented some enums and types needed to provide this new functionalities to our users.

include/accessor.h Outdated Show resolved Hide resolved
include/buffer.h Outdated Show resolved Hide resolved
include/buffer.h Outdated
return detail::make_device_accessor<DataT, Dims, Mode>(live_cgh.get_eventual_sycl_cgh(), sr, access_info.buffer, access_info.offset);
}
template <cl::sycl::access_mode Mode, cl::sycl::target Target, typename Functor>
auto get_access(handler& cgh, Functor rmfn) const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

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 in new commit.


#if WORKAROUND_COMPUTECPP
template <cl::sycl::access_mode Mode, cl::sycl::access::target Trgt, typename Functor>
auto get_access(handler& cgh, Functor rmfn) const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here.

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 in new commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

We're keeping this deduced return type because we would otherwise implement some additional translation for cl::sycl::access::target, and this workaround is temporary anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

We're keeping this deduced return type because we would otherwise implement some additional translation for cl::sycl::access::target, and this workaround is temporary anyway.

@@ -0,0 +1,63 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a more expressive name for this header file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed to ccpp_2020_compatibility_layer.h

test/runtime_tests.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
include/access_modes.h Outdated Show resolved Hide resolved
include/accessor.h Outdated Show resolved Hide resolved
include/accessor.h Outdated Show resolved Hide resolved
include/accessor.h Outdated Show resolved Hide resolved
include/accessor.h Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
test/runtime_tests.cc Outdated Show resolved Hide resolved
@psalz
Copy link
Member

psalz commented May 31, 2021

I just noticed that the convolution and distr_io examples haven't been updated to the new API!

@psalz psalz force-pushed the feature/sycl2020/accessor-initialization branch from c1225f1 to 2b674f1 Compare June 1, 2021 07:59
@facuMH facuMH force-pushed the feature/sycl2020/accessor-initialization branch from 2b674f1 to a2d9a76 Compare June 1, 2021 09:26
along with new enums for modes/targets and deduction from new tags.

A file for compatibility with ComputeCpp 2.5.0 was added since they do
not provide support for some of the features of SYCL 2020 we are using.

matmul, wave_sim and syncing examples were updated to the new accessor
constructor syntax.
@facuMH facuMH force-pushed the feature/sycl2020/accessor-initialization branch from 88faba5 to 001697e Compare June 1, 2021 15:59
@psalz psalz merged commit c36f55e into master Jun 2, 2021
@psalz psalz deleted the feature/sycl2020/accessor-initialization branch June 2, 2021 09:26
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.

Add support for SYCL 2020 no_init accessor property Add support for SYCL 2020 CTAD accessors
3 participants