24be21495d
+ Start to translate preprocessor's false conditional blocks too: based on clang's https://reviews.llvm.org/D66597; available only starting from LLVM 10.0 or trunk. + Option -skip-excluded-preprocessor-conditional-blocks for skipping excluded conditional blocks: the default behavior for hipify-clang built with LLVM < 10.0; false by default for hipify-clang built with LLVM 10 or trunk. + Add 4 preprocessor unit tests, 2 of which are LLVM 10.0 only + Update couple of existing tests by setting -skip-excluded-preprocessor-conditional-blocks option: update lit testing accordingly
30 wiersze
790 B
Plaintext
30 wiersze
790 B
Plaintext
// RUN: %run_test hipify "%s" "%t" %hipify_args "--skip-excluded-preprocessor-conditional-blocks" %clang_args
|
|
// CHECK: #include <hip/hip_runtime.h>
|
|
|
|
#include <cuda.h>
|
|
|
|
__global__ void axpy_kernel(float a, float* x, float* y) {
|
|
y[threadIdx.x] = a * x[threadIdx.x];
|
|
}
|
|
|
|
void axpy(float a, float* x, float* y) {
|
|
|
|
#ifdef SOME_MACRO
|
|
// CHECK: axpy_kernel <<<1, 1>>> (a, y, x);
|
|
axpy_kernel <<<1, 1>>> (a, y, x);
|
|
#endif
|
|
|
|
#ifndef SOME_MACRO
|
|
// CHECK: hipLaunchKernelGGL(axpy_kernel, dim3(1), dim3(2), 0, 0, a, y, x);
|
|
axpy_kernel <<<1, 2>>> (a, y, x);
|
|
#endif
|
|
|
|
#ifdef SOME_MACRO
|
|
// CHECK: axpy_kernel <<<1, 3>>> (a, y, x);
|
|
axpy_kernel <<<1, 3>>> (a, y, x);
|
|
#else
|
|
// CHECK: hipLaunchKernelGGL(axpy_kernel, dim3(1), dim3(4), 0, 0, a, x, y);
|
|
axpy_kernel <<<1, 4>>> (a, x, y);
|
|
#endif
|
|
|
|
} |