Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Configure usage of native atomic float add/sub functions #86

Merged
merged 1 commit into from
Jan 14, 2021
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
9 changes: 7 additions & 2 deletions SYCL/AtomicRef/add.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s \
// RUN: -o %t.out %gpu_atomics_config
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// TODO: Drop the separate "emulation" compilation once "native" OpenCL CPU
// support is provided.
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s \
// RUN: -o %t.out.emulated -D__SYCL_EMULATE_FLOAT_ATOMICS__=1
// RUN: %CPU_RUN_PLACEHOLDER %t.out.emulated

#include <CL/sycl.hpp>
#include <algorithm>
Expand Down
9 changes: 7 additions & 2 deletions SYCL/AtomicRef/sub.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s -o %t.out
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s \
// RUN: -o %t.out %gpu_atomics_config
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLDER %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out
// TODO: Drop the separate "emulation" compilation once "native" OpenCL CPU
// support is provided.
// RUN: %clangxx -fsycl -fsycl-unnamed-lambda -fsycl-targets=%sycl_triple %s \
// RUN: -o %t.out.emulated -D__SYCL_EMULATE_FLOAT_ATOMICS__=1
// RUN: %CPU_RUN_PLACEHOLDER %t.out.emulated

#include <CL/sycl.hpp>
#include <algorithm>
Expand Down
2 changes: 2 additions & 0 deletions SYCL/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@

if config.sycl_be == 'cuda':
config.substitutions.append( ('%sycl_triple', "nvptx64-nvidia-cuda-sycldevice" ) )
config.substitutions.append( ('%gpu_atomics_config', "-D__SYCL_EMULATE_FLOAT_ATOMICS__=1") )
else:
config.substitutions.append( ('%sycl_triple', "spir64-unknown-linux-sycldevice" ) )
config.substitutions.append( ('%gpu_atomics_config', "") )

if find_executable('sycl-ls'):
config.available_features.add('sycl-ls')
Expand Down