2018-04-25 09:10:37 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s --check-prefixes=CUDA,CHECK
|
|
|
|
// RUN: %clang_cc1 -x hip -emit-llvm %s -o - | FileCheck %s --check-prefixes=HIP,CHECK
|
|
|
|
|
2011-10-07 02:29:37 +08:00
|
|
|
|
2014-04-29 06:21:28 +08:00
|
|
|
#include "Inputs/cuda.h"
|
2011-10-07 02:29:37 +08:00
|
|
|
|
2018-04-25 11:16:07 +08:00
|
|
|
// CHECK-LABEL: define{{.*}} void @_Z2g1i
|
2018-04-25 09:10:37 +08:00
|
|
|
// HIP: call{{.*}}hipSetupArgument
|
|
|
|
// HIP: call{{.*}}hipLaunchByPtr
|
|
|
|
// CUDA: call{{.*}}cudaSetupArgument
|
|
|
|
// CUDA: call{{.*}}cudaLaunch
|
2011-10-07 02:29:37 +08:00
|
|
|
__global__ void g1(int x) {}
|
|
|
|
|
2018-04-25 11:16:07 +08:00
|
|
|
// CHECK-LABEL: define{{.*}} i32 @main
|
2011-10-07 02:29:37 +08:00
|
|
|
int main(void) {
|
2018-04-25 09:10:37 +08:00
|
|
|
// HIP: call{{.*}}hipConfigureCall
|
|
|
|
// CUDA: call{{.*}}cudaConfigureCall
|
2011-10-07 02:29:37 +08:00
|
|
|
// CHECK: icmp
|
|
|
|
// CHECK: br
|
|
|
|
// CHECK: call{{.*}}g1
|
|
|
|
g1<<<1, 1>>>(42);
|
|
|
|
}
|