summaryrefslogtreecommitdiff
path: root/libcuda/cuda_runtime_api.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libcuda/cuda_runtime_api.cc')
-rw-r--r--libcuda/cuda_runtime_api.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index fd05f55..12d3aac 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -435,7 +435,7 @@ std::string get_app_binary() {
// above func gives abs path whereas this give just the name of application.
char *get_app_binary_name(std::string abs_path) {
- char *self_exe_path;
+ char *self_exe_path = NULL;
#ifdef __APPLE__
// TODO: get apple device and check the result.
printf("WARNING: not tested for Apple-mac devices \n");
@@ -463,7 +463,7 @@ static int get_app_cuda_version() {
"ldd " + get_app_binary() +
" | grep libcudart.so | sed 's/.*libcudart.so.\\(.*\\) =>.*/\\1/' > " +
fname;
- system(app_cuda_version_command.c_str());
+ int res = system(app_cuda_version_command.c_str());
FILE *cmd = fopen(fname, "r");
char buf[256];
while (fgets(buf, sizeof(buf), cmd) != 0) {
@@ -1410,7 +1410,7 @@ cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlagsInternal(
function_info *entry = context->get_kernel(hostFunc);
printf(
"Calculate Maxium Active Block with function ptr=%p, blockSize=%d, "
- "SMemSize=%d\n",
+ "SMemSize=%lu\n",
hostFunc, blockSize, dynamicSMemSize);
if (flags == cudaOccupancyDefault) {
// create kernel_info based on entry
@@ -3234,7 +3234,7 @@ char *readfile(const std::string filename) {
fseek(fp, 0, SEEK_SET);
// allocate and copy the entire ptx
char *ret = (char *)malloc((filesize + 1) * sizeof(char));
- fread(ret, 1, filesize, fp);
+ int num = fread(ret, 1, filesize, fp);
ret[filesize] = '\0';
fclose(fp);
return ret;
@@ -3478,7 +3478,7 @@ void gpgpu_context::cuobjdumpParseBinary(unsigned int handle) {
context->add_binary(symtab, handle);
return;
}
- symbol_table *symtab;
+ symbol_table *symtab = NULL;
#if (CUDART_VERSION >= 6000)
// loops through all ptx files from smallest sm version to largest