removed FileCheck dependency & significantly improved test coverage

이 커밋은 다음에 포함됨:
dfukalov
2016-03-26 16:01:49 +03:00
부모 7b5a3413cb
커밋 28d29cac82
4개의 변경된 파일과 11개의 추가작업 그리고 14개의 파일을 삭제
+1 -1
파일 보기
@@ -16,7 +16,7 @@ configure_file(
add_lit_testsuite(check-hipify "Running HIPify regression tests"
${CMAKE_CURRENT_SOURCE_DIR}
PARAMS site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
DEPENDS hipify FileCheck lit
DEPENDS hipify lit
)
add_custom_target(check)
+8 -3
파일 보기
@@ -1,10 +1,9 @@
// RUN: hipify "%s" -o=%t --
// RUN: FileCheck %s -input-file=%t --match-full-lines
#include <iostream>
__global__ void axpy(float a, float* x, float* y) {
// CHECK: y[hipThreadIdx_x] = a * x[hipThreadIdx_x];
// RUN: sh -c "test `grep -c -F 'y[hipThreadIdx_x] = a * x[hipThreadIdx_x];' %t` -eq 2"
y[threadIdx.x] = a * x[threadIdx.x];
}
@@ -18,16 +17,21 @@ int main(int argc, char* argv[]) {
// Copy input data to device.
float* device_x;
float* device_y;
// RUN: sh -c "test `grep -c -F 'hipMalloc(&device_x, kDataLen * sizeof(float));' %t` -eq 2"
cudaMalloc(&device_x, kDataLen * sizeof(float));
// RUN: sh -c "test `grep -c -F 'hipMalloc(&device_y, kDataLen * sizeof(float));' %t` -eq 2"
cudaMalloc(&device_y, kDataLen * sizeof(float));
// RUN: sh -c "test `grep -c -F 'hipMemcpy(device_x, host_x, kDataLen * sizeof(float), hipMemcpyHostToDevice);' %t` -eq 2"
cudaMemcpy(device_x, host_x, kDataLen * sizeof(float), cudaMemcpyHostToDevice);
// Launch the kernel.
// CHECK: hipLaunchKernel(HIP_KERNEL_NAME(axpy), dim3(1), dim3(kDataLen), 0, 0, a, device_x, device_y);
// RUN: sh -c "test `grep -c -F 'hipLaunchKernel(HIP_KERNEL_NAME(axpy), dim3(1), dim3(kDataLen), 0, 0, a, device_x, device_y);' %t` -eq 2"
axpy<<<1, kDataLen>>>(a, device_x, device_y);
// Copy output data to host.
// RUN: sh -c "test `grep -c -F 'hipDeviceSynchronize();' %t` -eq 2"
cudaDeviceSynchronize();
// RUN: sh -c "test `grep -c -F 'hipMemcpy(host_y, device_y, kDataLen * sizeof(float), hipMemcpyDeviceToHost);' %t` -eq 2"
cudaMemcpy(host_y, device_y, kDataLen * sizeof(float), cudaMemcpyDeviceToHost);
// Print the results.
@@ -35,6 +39,7 @@ int main(int argc, char* argv[]) {
std::cout << "y[" << i << "] = " << host_y[i] << "\n";
}
// RUN: sh -c "test `grep -c -F 'hipDeviceReset();' %t` -eq 2"
cudaDeviceReset();
return 0;
}
-7
파일 보기
@@ -44,12 +44,5 @@ if obj_root is not None:
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
tool_name = "FileCheck"
tool_path = lit.util.which(tool_name, llvm_tools_dir)
if not tool_path:
# Warn, but still provide a substitution.
lit_config.note('Did not find ' + tool_name + ' in ' + llvm_tools_dir)
tool_path = llvm_tools_dir + '/' + tool_name
config.substitutions.append((tool_name, tool_path))
config.substitutions.append(("hipify", obj_root+"/hipify"))