File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,19 +37,19 @@ float ga_lib_version(void *h, void *sym) {
3737 if (!dladdr (sym , & dli ))
3838 return -1 ;
3939
40- real_path = realpath (dli .dli_fname ,NULL );
40+ real_path = realpath (dli .dli_fname , NULL );
4141 if (real_path == NULL )
4242 return -1 ;
4343
4444 dot1 = strrchr (real_path , '.' );
45- if (dot1 == real_path ) {
45+ if (dot1 == NULL ) {
4646 free (real_path );
4747 return -1 ;
4848 }
4949 dot1 [0 ] = '\0' ;
5050
5151 dot2 = strrchr (real_path , '.' );
52- if (dot2 == real_path ) {
52+ if (dot2 == NULL ) {
5353 free (real_path );
5454 return -1 ;
5555 }
Original file line number Diff line number Diff line change 1010static char libname [] = "nvcuda.dll" ;
1111#else /* Unix */
1212#ifdef __APPLE__
13- static char libname [] = "CUDA.framework/CUDA" ;
13+ static char libname [] = "/Library/Frameworks/ CUDA.framework/CUDA" ;
1414#else
1515static char libname [] = "libcuda.so" ;
1616#endif
@@ -42,7 +42,9 @@ static int loaded = 0;
4242
4343int load_libcuda (void ) {
4444 void * lib ;
45+ #ifndef __APPLE__
4546 float v ;
47+ #endif
4648
4749 if (loaded )
4850 return GA_NO_ERROR ;
@@ -53,6 +55,10 @@ int load_libcuda(void) {
5355
5456 #include "libcuda.fn"
5557
58+ /*
59+ * The blacklisted versions of cuda are not available on mac as far as I know.
60+ */
61+ #ifndef __APPLE__
5662 v = ga_lib_version (lib , cuInit );
5763 if (v == -1 )
5864 fprintf (stderr , "WARNING: could not determine cuda driver version. Some versions return bad results, make sure your version is fine\n" );
@@ -72,6 +78,7 @@ int load_libcuda(void) {
7278 return GA_LOAD_ERROR ;
7379 }
7480 }
81+ #endif
7582
7683 loaded = 1 ;
7784 return GA_NO_ERROR ;
Original file line number Diff line number Diff line change 88static char libname [] = "OpenCL.dll" ;
99#else /* Unix */
1010#ifdef __APPLE__
11- static char libname [] = "OpenCL.framework/OpenCL" ;
11+ static char libname [] = "/System/Library/Frameworks/ OpenCL.framework/OpenCL" ;
1212#else
1313static char libname [] = "libOpenCL.so" ;
1414#endif
You can’t perform that action at this time.
0 commit comments