diff --git a/SYCL/Basic/buffer/buffer_allocator.cpp b/SYCL/Basic/buffer/buffer_allocator.cpp index ead5cac186..dae92ee181 100644 --- a/SYCL/Basic/buffer/buffer_allocator.cpp +++ b/SYCL/Basic/buffer/buffer_allocator.cpp @@ -1,7 +1,3 @@ -// RUN: %clangxx -fsycl -DSYCL2020_CONFORMANT_APIS -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: env SYCL_DEVICE_FILTER=opencl %CPU_RUN_PLACEHOLDER %t.out -// RUN: env SYCL_DEVICE_FILTER=opencl %GPU_RUN_PLACEHOLDER %t.out -// RUN: env SYCL_DEVICE_FILTER=opencl %ACC_RUN_PLACEHOLDER %t.out // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_FILTER=opencl %CPU_RUN_PLACEHOLDER %t.out // RUN: env SYCL_DEVICE_FILTER=opencl %GPU_RUN_PLACEHOLDER %t.out @@ -15,9 +11,9 @@ // //===----------------------------------------------------------------------===// -// Tests that the default (and explicit with SYCL 2020) buffer_allocator used by -// buffers are as defined by the spec and will allocate the right amount of -// memory on the device. +// Tests that the default and explicit buffer_allocator used by buffers are as +// defined by the spec and will allocate the right amount of memory on the +// device. #include #include @@ -45,40 +41,27 @@ bool checkResult(sycl::buffer &Buf, size_t N, std::string &TName, template bool runTest(sycl::queue &Q, std::string TName) { sycl::buffer DefaultBuf{NumElems}; -#ifdef SYCL2020_CONFORMANT_APIS static_assert(std::is_same_v>>); sycl::buffer> CharAllocBuf{NumElems}; sycl::buffer> LongAllocBuf{NumElems}; -#else - static_assert(std::is_same_v>); -#endif Q.submit([&](sycl::handler &CGH) { auto DefaultAcc = DefaultBuf.get_access(CGH); -#ifdef SYCL2020_CONFORMANT_APIS auto CharAllocAcc = CharAllocBuf.get_access(CGH); auto LongAllocAcc = LongAllocBuf.get_access(CGH); -#endif CGH.parallel_for>(NumElems, [=](sycl::item<1> It) { DefaultAcc[It] = static_cast(It[0]); -#ifdef SYCL2020_CONFORMANT_APIS CharAllocAcc[It] = static_cast(It[0]); LongAllocAcc[It] = static_cast(It[0]); -#endif }); }).wait(); -#ifdef SYCL2020_CONFORMANT_APIS return checkResult(DefaultBuf, NumElems, TName, "buffer_allocator<" + TName + ">") && checkResult(CharAllocBuf, NumElems, TName, "buffer_allocator") && checkResult(LongAllocBuf, NumElems, TName, "buffer_allocator"); -#else - return checkResult(DefaultBuf, NumElems, TName, "buffer_allocator"); -#endif } #define RUN_TEST(TYPE, Q) runTest(Q, #TYPE) diff --git a/SYCL/Basic/fpga_tests/fpga_queue.cpp b/SYCL/Basic/fpga_tests/fpga_queue.cpp index 9888478d13..2366ba4c81 100644 --- a/SYCL/Basic/fpga_tests/fpga_queue.cpp +++ b/SYCL/Basic/fpga_tests/fpga_queue.cpp @@ -23,8 +23,9 @@ const int maxNumQueues = 256; void GetCLQueue(event sycl_event, std::set &cl_queues) { try { cl_command_queue cl_queue; - cl_event cl_event = get_native(sycl_event); - cl_int error = clGetEventInfo(cl_event, CL_EVENT_COMMAND_QUEUE, + std::vector cl_events = get_native(sycl_event); + assert(cl_events.size() > 0 && "No native OpenCL events in SYCL event."); + cl_int error = clGetEventInfo(cl_events[0], CL_EVENT_COMMAND_QUEUE, sizeof(cl_queue), &cl_queue, nullptr); assert(CL_SUCCESS == error && "Failed to obtain queue from OpenCL event"); diff --git a/SYCL/HostInteropTask/interop-task.cpp b/SYCL/HostInteropTask/interop-task.cpp index c4c5ad9b2d..fc4b36803f 100644 --- a/SYCL/HostInteropTask/interop-task.cpp +++ b/SYCL/HostInteropTask/interop-task.cpp @@ -1,7 +1,3 @@ -// RUN: %clangxx -fsycl -DSYCL2020_CONFORMANT_APIS -fsycl-targets=%sycl_triple %s -o %t.out %threads_lib %opencl_lib -// RUN: %CPU_RUN_PLACEHOLDER %t.out -// RUN: %GPU_RUN_PLACEHOLDER %t.out -// RUN: %ACC_RUN_PLACEHOLDER %t.out // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out %threads_lib %opencl_lib // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %GPU_RUN_PLACEHOLDER %t.out @@ -47,16 +43,9 @@ void copy(buffer &Src, buffer &Dst, queue &Q) { auto DstMem = IH.get_native_mem(DstA); cl_event Event; -#ifdef SYCL2020_CONFORMANT_APIS int RC = clEnqueueCopyBuffer(NativeQ, SrcMem[0], DstMem[0], 0, 0, sizeof(DataT) * SrcA.get_count(), 0, nullptr, &Event); -#else - int RC = clEnqueueCopyBuffer(NativeQ, SrcMem, DstMem, 0, 0, - sizeof(DataT) * SrcA.get_count(), 0, nullptr, - &Event); -#endif - if (RC != CL_SUCCESS) throw runtime_error("Can't enqueue buffer copy", RC); @@ -180,15 +169,9 @@ void test3(queue &Q) { Q.submit([&](handler &CGH) { auto Func = [=](interop_handle IH) { -#ifdef SYCL2020_CONFORMANT_APIS std::vector Ev = get_native(Event); int RC = clWaitForEvents(1, Ev.data()); -#else - cl_event Ev = get_native(Event); - - int RC = clWaitForEvents(1, &Ev); -#endif if (RC != CL_SUCCESS) throw runtime_error("Can't wait for events", RC); }; diff --git a/SYCL/Plugin/interop-opencl.cpp b/SYCL/Plugin/interop-opencl.cpp index 662c316070..3b48d225da 100644 --- a/SYCL/Plugin/interop-opencl.cpp +++ b/SYCL/Plugin/interop-opencl.cpp @@ -1,9 +1,5 @@ // REQUIRES: opencl -// RUN: %clangxx -fsycl -DSYCL2020_CONFORMANT_APIS -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: env SYCL_DEVICE_FILTER=opencl %CPU_RUN_PLACEHOLDER %t.out -// RUN: env SYCL_DEVICE_FILTER=opencl %GPU_RUN_PLACEHOLDER %t.out -// RUN: env SYCL_DEVICE_FILTER=opencl %ACC_RUN_PLACEHOLDER %t.out // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out // RUN: env SYCL_DEVICE_FILTER=opencl %CPU_RUN_PLACEHOLDER %t.out // RUN: env SYCL_DEVICE_FILTER=opencl %GPU_RUN_PLACEHOLDER %t.out @@ -37,9 +33,7 @@ int main() { cgh.host_task([=](const sycl::interop_handle &ih) { (void)Acc; auto BufNative = ih.get_native_mem(Acc); -#ifdef SYCL2020_CONFORMANT_APIS assert(BufNative.size() == 1); -#endif }); }); } @@ -50,22 +44,15 @@ int main() { auto ocl_context = get_native(Context); auto ocl_queue = get_native(Queue); auto ocl_buffers = get_native(Buffer); -#ifdef SYCL2020_CONFORMANT_APIS assert(ocl_buffers.size() == 1); -#endif // Re-create SYCL objects from native OpenCL handles auto PlatformInterop = opencl::make(ocl_platform); auto DeviceInterop = opencl::make(ocl_device); auto ContextInterop = opencl::make(ocl_context); auto QueueInterop = opencl::make(ContextInterop, ocl_queue); -#ifdef SYCL2020_CONFORMANT_APIS auto BufferInterop = sycl::make_buffer(ocl_buffers[0], ContextInterop); -#else - auto BufferInterop = - sycl::make_buffer(ocl_buffers, ContextInterop); -#endif // Check native handles assert(ocl_platform == get_native(PlatformInterop));