-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from sx-aurora-dev/feature/merge-upstream-2021…
…0817-2 Feature/merge upstream 20210817 2
- Loading branch information
Showing
427 changed files
with
18,941 additions
and
16,130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: %clang_cc1 %s -triple=amdgcn-amd-amdhsa -fcuda-is-device \ | ||
// RUN: -target-cpu gfx90a -Rpass=atomic-expand -S -o - 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefix=GFX90A-CAS | ||
|
||
// REQUIRES: amdgpu-registered-target | ||
|
||
#include "Inputs/cuda.h" | ||
#include <stdatomic.h> | ||
|
||
// GFX90A-CAS: A compare and swap loop was generated for an atomic fadd operation at system memory scope | ||
// GFX90A-CAS-LABEL: _Z14atomic_add_casPf | ||
// GFX90A-CAS: flat_atomic_cmpswap v0, v[2:3], v[4:5] glc | ||
// GFX90A-CAS: s_cbranch_execnz | ||
__device__ float atomic_add_cas(float *p) { | ||
return __atomic_fetch_add(p, 1.0f, memory_order_relaxed); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// RUN: %clang_cc1 %s -cl-std=CL2.0 -O0 -triple=amdgcn-amd-amdhsa -target-cpu gfx90a \ | ||
// RUN: -Rpass=atomic-expand -S -o - 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefix=REMARK | ||
|
||
// RUN: %clang_cc1 %s -cl-std=CL2.0 -O0 -triple=amdgcn-amd-amdhsa -target-cpu gfx90a \ | ||
// RUN: -Rpass=atomic-expand -S -emit-llvm -o - 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefix=GFX90A-CAS | ||
|
||
// REQUIRES: amdgpu-registered-target | ||
|
||
typedef enum memory_order { | ||
memory_order_relaxed = __ATOMIC_RELAXED, | ||
memory_order_acquire = __ATOMIC_ACQUIRE, | ||
memory_order_release = __ATOMIC_RELEASE, | ||
memory_order_acq_rel = __ATOMIC_ACQ_REL, | ||
memory_order_seq_cst = __ATOMIC_SEQ_CST | ||
} memory_order; | ||
|
||
typedef enum memory_scope { | ||
memory_scope_work_item = __OPENCL_MEMORY_SCOPE_WORK_ITEM, | ||
memory_scope_work_group = __OPENCL_MEMORY_SCOPE_WORK_GROUP, | ||
memory_scope_device = __OPENCL_MEMORY_SCOPE_DEVICE, | ||
memory_scope_all_svm_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES, | ||
#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) | ||
memory_scope_sub_group = __OPENCL_MEMORY_SCOPE_SUB_GROUP | ||
#endif | ||
} memory_scope; | ||
|
||
// REMARK: remark: A compare and swap loop was generated for an atomic fadd operation at workgroup-one-as memory scope [-Rpass=atomic-expand] | ||
// REMARK: remark: A compare and swap loop was generated for an atomic fadd operation at agent-one-as memory scope [-Rpass=atomic-expand] | ||
// REMARK: remark: A compare and swap loop was generated for an atomic fadd operation at one-as memory scope [-Rpass=atomic-expand] | ||
// REMARK: remark: A compare and swap loop was generated for an atomic fadd operation at wavefront-one-as memory scope [-Rpass=atomic-expand] | ||
// GFX90A-CAS-LABEL: @atomic_cas | ||
// GFX90A-CAS: atomicrmw fadd float addrspace(1)* {{.*}} syncscope("workgroup-one-as") monotonic | ||
// GFX90A-CAS: atomicrmw fadd float addrspace(1)* {{.*}} syncscope("agent-one-as") monotonic | ||
// GFX90A-CAS: atomicrmw fadd float addrspace(1)* {{.*}} syncscope("one-as") monotonic | ||
// GFX90A-CAS: atomicrmw fadd float addrspace(1)* {{.*}} syncscope("wavefront-one-as") monotonic | ||
float atomic_cas(__global atomic_float *d, float a) { | ||
float ret1 = __opencl_atomic_fetch_add(d, a, memory_order_relaxed, memory_scope_work_group); | ||
float ret2 = __opencl_atomic_fetch_add(d, a, memory_order_relaxed, memory_scope_device); | ||
float ret3 = __opencl_atomic_fetch_add(d, a, memory_order_relaxed, memory_scope_all_svm_devices); | ||
float ret4 = __opencl_atomic_fetch_add(d, a, memory_order_relaxed, memory_scope_sub_group); | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- !ELF | ||
FileHeader: | ||
Class: ELFCLASS[[BITS]] | ||
Data: ELFDATA2[[ENCODING]] | ||
Type: ET_REL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.