Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 2 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
21 changes: 13 additions & 8 deletions SYCL/AtomicRef/atomic_memory_order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out
// L0, OpenCL backends don't currently support
// info::device::atomic_memory_order_capabilities
// UNSUPPORTED: level_zero || opencl

// NOTE: General tests for atomic memory order capabilities.
// This test checks whether the minimum required memory order capabilities are
// supported in both context and device queries. Specifically the "relaxed"
// memory order capability, which is used in other tests.

#include "atomic_memory_order.h"
#include <cassert>
Expand All @@ -16,12 +15,18 @@ using namespace sycl;
int main() {
queue q;

std::vector<memory_order> supported_memory_orders =
// Context
std::vector<memory_order> supported_context_memory_orders =
q.get_context()
.get_info<info::context::atomic_memory_order_capabilities>();

assert(is_supported(supported_context_memory_orders, memory_order::relaxed));

// Device
std::vector<memory_order> supported_device_memory_orders =
q.get_device().get_info<info::device::atomic_memory_order_capabilities>();

// Relaxed memory order must be supported. This ordering is used in other
// tests.
assert(is_supported(supported_memory_orders, memory_order::relaxed));
assert(is_supported(supported_device_memory_orders, memory_order::relaxed));

std::cout << "Test passed." << std::endl;
}
5 changes: 1 addition & 4 deletions SYCL/AtomicRef/atomic_memory_order_acq_rel.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -O3 -o %t.out -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -O3 -o %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out
// L0, OpenCL, and HIP backends don't currently support
// info::device::atomic_memory_order_capabilities
// UNSUPPORTED: level_zero, opencl

// NOTE: Tests fetch_add for acquire and release memory ordering.

Expand Down
5 changes: 1 addition & 4 deletions SYCL/AtomicRef/atomic_memory_order_seq_cst.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -O3 -o %t.out -Xsycl-target-backend=nvptx64-nvidia-cuda --cuda-gpu-arch=sm_70
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -O3 -o %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// RUN: %ACC_RUN_PLACEHOLDER %t.out
// L0, OpenCL, and HIP backends don't currently support
// info::device::atomic_memory_order_capabilities
// UNSUPPORTED: level_zero, opencl

#include "atomic_memory_order.h"
#include <iostream>
Expand Down