-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some changes to the device library to use runtime API
+ Add a simple CUDA compilation step during configure to determine the apporiate arhcitecture flags + Allow add_componenet_library to accept a library type different than the DRACO_LIBRARY_TYPE variable + Change the GPU_Device class to use the newer CUDA Runtime API + Remove the GPU_Module class (explicit module and contexts are not necessary in the Runtime API) + Remove "EXTERN C" decorations (these are also no longer necessary in the Runtime API since functions do not need to be loaded explicity) + Add a test that shows an example of calling code from both the host and device + Consolidate calls to simple GPU test kernels into a "basic_kernels" header and implementation file + Compile auxillary GPU test code into a static library callable by the individual gpu tests
- Loading branch information
1 parent
631e407
commit 507ab6d
Showing
21 changed files
with
612 additions
and
817 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//----------------------------------*-C++-*----------------------------------// | ||
/*! | ||
* \file config/query_gpu.cu | ||
* \author Alex Long | ||
* \brief Small CUDA code that prints the architecture version, used by CMake | ||
* \date Thu Mat 21 15:53:51 2019 | ||
* \note Copyright (C) 2019 Triad National Security, LLC. | ||
* All rights reserved. */ | ||
//---------------------------------------------------------------------------// | ||
|
||
// NOTE: This code is from | ||
// wagonhelm.github.io/articles/2018-03/detecting-cuda-capability-with-cmake | ||
|
||
#include <stdio.h> | ||
|
||
int main(int argc, char **argv) { | ||
cudaDeviceProp dP; | ||
float min_cc = 3.0; | ||
|
||
int rc = cudaGetDeviceProperties(&dP, 0); | ||
if (rc != cudaSuccess) { | ||
cudaError_t error = cudaGetLastError(); | ||
printf("CUDA error: %s", cudaGetErrorString(error)); | ||
return rc; /* Failure */ | ||
} | ||
if ((dP.major + (dP.minor / 10)) < min_cc) { | ||
printf("Min Compute Capability of %2.1f required: %d.%d found\n Not " | ||
"Building CUDA Code", | ||
min_cc, dP.major, dP.minor); | ||
return 1; /* Failure */ | ||
} else { | ||
printf("-arch=sm_%d%d", dP.major, dP.minor); | ||
return 0; /* Success */ | ||
} | ||
} | ||
//---------------------------------------------------------------------------// | ||
// end of query_gpu.cu | ||
//---------------------------------------------------------------------------// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.