1 // REQUIRES: x86-registered-target
2 // REQUIRES: nvptx-registered-target
4 // RUN: %clang_cc1 -x cuda -triple nvptx64-nvidia-cuda- -fcuda-is-device \
5 // RUN: -O3 -S %s -o - | FileCheck -check-prefix=PTX %s
6 // RUN: %clang_cc1 -x cuda -triple nvptx64-nvidia-cuda- -fcuda-is-device \
7 // RUN: -Os -S %s -o - | FileCheck -check-prefix=PTX %s
8 #include "Inputs/cuda.h"
10 // PTX-LABEL: .func _Z12copy_genericPvPKv(
11 void __device__ copy_generic(void *dest, const void *src) {
12 __builtin_memcpy(dest, src, 32);
17 // PTX-LABEL: .entry _Z11copy_globalPvS_(
18 void __global__ copy_global(void *dest, void * src) {
19 __builtin_memcpy(dest, src, 32);
28 // PTX-LABEL: .entry _Z20copy_param_to_globalP1SS_(
29 void __global__ copy_param_to_global(S *global, S param) {
30 __builtin_memcpy(global, ¶m, sizeof(S));
35 // PTX-LABEL: .entry _Z19copy_param_to_localPU3AS51SS_(
36 void __global__ copy_param_to_local(__attribute__((address_space(5))) S *local,
38 __builtin_memcpy(local, ¶m, sizeof(S));
43 // PTX-LABEL: .func _Z21copy_local_to_genericP1SPU3AS5S_(
44 void __device__ copy_local_to_generic(S *generic,
45 __attribute__((address_space(5))) S *src) {
46 __builtin_memcpy(generic, src, sizeof(S));
53 // PTX-LABEL: .entry _Z20copy_param_to_shared1S(
54 void __global__ copy_param_to_shared( S param) {
55 __builtin_memcpy(&shared, ¶m, sizeof(S));
60 void __device__ copy_shared_to_generic(S *generic) {
61 __builtin_memcpy(generic, &shared, sizeof(S));