Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sycl/include/CL/sycl/access/access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
29 changes: 29 additions & 0 deletions sycl/test/basic_tests/accessor/target_device.cpp
Original file line number Diff line number Diff line change
@@ -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 <CL/sycl.hpp>

int main() {
sycl::queue testQueue;
sycl::range<1> ndRng(1);
int kernelResult;
{
sycl::buffer<int, 1> buffer(&kernelResult, ndRng);

testQueue.submit([&](sycl::handler &cgh) {
auto ptr = buffer.get_access<sycl::access_mode::read_write,
sycl::target::device>(cgh);
cgh.single_task<class kernel>([=]() { ptr[0] = 5; });
});
} // ~buffer

// std::cout << "kernelResult should be 5: " << kernelResult << std::endl;
assert(kernelResult == 5);

return 0;
}