diff --git a/sycl/include/CL/sycl/access/access.hpp b/sycl/include/CL/sycl/access/access.hpp index cba9308111cc0..7e9fbd6105b78 100644 --- a/sycl/include/CL/sycl/access/access.hpp +++ b/sycl/include/CL/sycl/access/access.hpp @@ -21,7 +21,8 @@ enum class target { image = 2017, host_buffer = 2018, host_image = 2019, - image_array = 2020 + image_array = 2020, + device = global_buffer, }; enum class mode { diff --git a/sycl/test/basic_tests/accessor/target_device.cpp b/sycl/test/basic_tests/accessor/target_device.cpp new file mode 100644 index 0000000000000..32c221c369c3f --- /dev/null +++ b/sycl/test/basic_tests/accessor/target_device.cpp @@ -0,0 +1,29 @@ +// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out + +// This short test simply confirms that target::device +// is supported correctly. +// TODO: delete this test and test the functionality +// over in llvm-test-suite along with the other changes +// needed to support the SYCL 2020 target updates. + +#include + +int main() { + sycl::queue testQueue; + sycl::range<1> ndRng(1); + int kernelResult; + { + sycl::buffer buffer(&kernelResult, ndRng); + + testQueue.submit([&](sycl::handler &cgh) { + auto ptr = buffer.get_access(cgh); + cgh.single_task([=]() { ptr[0] = 5; }); + }); + } // ~buffer + + // std::cout << "kernelResult should be 5: " << kernelResult << std::endl; + assert(kernelResult == 5); + + return 0; +} \ No newline at end of file