Index: tools/GPURuntime/GPUJIT.c =================================================================== --- tools/GPURuntime/GPUJIT.c +++ tools/GPURuntime/GPUJIT.c @@ -217,18 +217,25 @@ return 1; } +/* Get function pointer to OpenCL Runtime API. + * + * Note that compilers conforming to the ISO C standard are required to + * generate a warning if a conversion from a void * pointer to a function + * pointer is attempted as in the following statements. The warning + * of this kind of cast may not be emitted by clang and new versions of gcc + * as it is valid on POSIX 2008. For compilers required to generate a warning, + * we temporarily disable -Wpedantic, to avoid bloating the output with + * unnecessary warnings. + * + * Reference: + * http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlsym.html + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" static int initialDeviceAPIsCL() { if (initialDeviceAPILibrariesCL() == 0) return 0; - /* Get function pointer to OpenCL Runtime API. - * - * Note that compilers conforming to the ISO C standard are required to - * generate a warning if a conversion from a void * pointer to a function - * pointer is attempted as in the following statements. The warning - * of this kind of cast may not be emitted by clang and new versions of gcc - * as it is valid on POSIX 2008. - */ clGetPlatformIDsFcnPtr = (clGetPlatformIDsFcnTy *)getAPIHandleCL(HandleOpenCL, "clGetPlatformIDs"); @@ -293,6 +300,7 @@ return 1; } +#pragma GCC diagnostic pop /* Context and Device. */ static PollyGPUContext *GlobalContext = NULL; @@ -998,18 +1006,25 @@ return 1; } +/* Get function pointer to CUDA Driver APIs. + * + * Note that compilers conforming to the ISO C standard are required to + * generate a warning if a conversion from a void * pointer to a function + * pointer is attempted as in the following statements. The warning + * of this kind of cast may not be emitted by clang and new versions of gcc + * as it is valid on POSIX 2008. For compilers required to generate a warning, + * we temporarily disable -Wpedantic, to avoid bloating the output with + * unnecessary warnings. + * + * Reference: + * http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlsym.html + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" static int initialDeviceAPIsCUDA() { if (initialDeviceAPILibrariesCUDA() == 0) return 0; - /* Get function pointer to CUDA Driver APIs. - * - * Note that compilers conforming to the ISO C standard are required to - * generate a warning if a conversion from a void * pointer to a function - * pointer is attempted as in the following statements. The warning - * of this kind of cast may not be emitted by clang and new versions of gcc - * as it is valid on POSIX 2008. - */ CuLaunchKernelFcnPtr = (CuLaunchKernelFcnTy *)getAPIHandleCUDA(HandleCuda, "cuLaunchKernel"); @@ -1079,6 +1094,7 @@ return 1; } +#pragma GCC diagnostic pop static PollyGPUContext *initContextCUDA() { dump_function();