diff options
| author | Ahmad Alawneh <[email protected]> | 2023-07-06 01:18:20 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-06 01:18:20 -0400 |
| commit | a42b72214b92b6a97f16c180ad09631cbe50da33 (patch) | |
| tree | 61bba4462fde2ba21e00a166a952edd1087b9ca9 /libcuda/cuda_runtime_api.cc | |
| parent | 58beccb510bb892de56b466ac764f24297affebd (diff) | |
| parent | 1ce9febc61ab0e50c01ceea424cbf3e12a149366 (diff) | |
Merge pull request #59 from LAhmos/all_warn
Diffstat (limited to 'libcuda/cuda_runtime_api.cc')
| -rw-r--r-- | libcuda/cuda_runtime_api.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc index 12d3aac..5866b36 100644 --- a/libcuda/cuda_runtime_api.cc +++ b/libcuda/cuda_runtime_api.cc @@ -464,6 +464,10 @@ static int get_app_cuda_version() { " | grep libcudart.so | sed 's/.*libcudart.so.\\(.*\\) =>.*/\\1/' > " + fname; int res = system(app_cuda_version_command.c_str()); + if(res == -1){ + printf("Error - Cannot detect the app's CUDA version.\n"); + exit(1); + } FILE *cmd = fopen(fname, "r"); char buf[256]; while (fgets(buf, sizeof(buf), cmd) != 0) { @@ -3235,6 +3239,11 @@ char *readfile(const std::string filename) { // allocate and copy the entire ptx char *ret = (char *)malloc((filesize + 1) * sizeof(char)); int num = fread(ret, 1, filesize, fp); + if(num == 0){ + std::cout << "ERROR: Could not read data from file %s\n" + << filename << std::endl; + assert(0); + } ret[filesize] = '\0'; fclose(fp); return ret; @@ -3596,6 +3605,7 @@ unsigned CUDARTAPI __cudaPushCallConfiguration(dim3 gridDim, dim3 blockDim, announce_call(__my_func__); } cudaConfigureCallInternal(gridDim, blockDim, sharedMem, stream); + return 0; } cudaError_t CUDARTAPI __cudaPopCallConfiguration(dim3 *gridDim, dim3 *blockDim, |
