summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly/WithDefs
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-14 15:16:32 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-14 15:20:50 (GMT)
commitc4a6135039a417087b478c031849337316022263 (patch)
tree6b0ce2db3ec8d50fe376edc1021fb52f8e6c8851 /Tests/CudaOnly/WithDefs
parent0b2f8ae3ba4ee6077051c97b503e1a165d4938f2 (diff)
downloadCMake-c4a6135039a417087b478c031849337316022263.zip
CMake-c4a6135039a417087b478c031849337316022263.tar.gz
CMake-c4a6135039a417087b478c031849337316022263.tar.bz2
Tests: Run clang-format on CUDA code
Diffstat (limited to 'Tests/CudaOnly/WithDefs')
-rw-r--r--Tests/CudaOnly/WithDefs/main.notcu28
1 files changed, 11 insertions, 17 deletions
diff --git a/Tests/CudaOnly/WithDefs/main.notcu b/Tests/CudaOnly/WithDefs/main.notcu
index 67bf10c..80ed3a5 100644
--- a/Tests/CudaOnly/WithDefs/main.notcu
+++ b/Tests/CudaOnly/WithDefs/main.notcu
@@ -6,14 +6,12 @@
#error "PACKED_DEFINE not defined!"
#endif
-static
-__global__
-void DetermineIfValidCudaDevice()
+static __global__ void DetermineIfValidCudaDevice()
{
}
#ifdef _MSC_VER
-#pragma pack(push,1)
+#pragma pack(push, 1)
#undef PACKED_DEFINE
#define PACKED_DEFINE
#endif
@@ -32,28 +30,24 @@ struct PACKED_DEFINE result_type
result_type can_launch_kernel()
{
result_type r;
- DetermineIfValidCudaDevice <<<1,1>>> ();
+ DetermineIfValidCudaDevice<<<1, 1>>>();
r.valid = (cudaSuccess == cudaGetLastError());
- if(r.valid)
- {
+ if (r.valid) {
r.value = 1;
- }
- else
- {
+ } else {
r.value = -1;
- }
+ }
return r;
}
-int main(int argc, char **argv)
+int main(int argc, char** argv)
{
cudaError_t err;
int nDevices = 0;
err = cudaGetDeviceCount(&nDevices);
- if(err != cudaSuccess)
- {
- std::cerr << cudaGetErrorString(err) << std::endl;
- return 1;
- }
+ if (err != cudaSuccess) {
+ std::cerr << cudaGetErrorString(err) << std::endl;
+ return 1;
+ }
return 0;
}