diff --git a/libc/src/math/gpu/CMakeLists.txt b/libc/src/math/gpu/CMakeLists.txt --- a/libc/src/math/gpu/CMakeLists.txt +++ b/libc/src/math/gpu/CMakeLists.txt @@ -44,10 +44,7 @@ HDRS ../modf.h COMPILE_OPTIONS - # FIXME: We need a way to pass the flag to only the NVTPX / AMDGPU build. - # This shouldn't cause issues because we only link in needed symbols, but it - # will link in identity metadata from both libraries. -Wno-linker-warnings ${bitcode_link_flags} -O2 -) \ No newline at end of file +) diff --git a/libc/src/math/gpu/amdgpu/amdgpu.h b/libc/src/math/gpu/amdgpu/amdgpu.h --- a/libc/src/math/gpu/amdgpu/amdgpu.h +++ b/libc/src/math/gpu/amdgpu/amdgpu.h @@ -15,23 +15,15 @@ #include "src/__support/macros/attributes.h" namespace __llvm_libc { -namespace vendor { +namespace internal { LIBC_INLINE double modf(double x, double *iptr) { - double tmp; -#ifdef __OPENMP_AMDGCN__ -#pragma omp allocate(tmp) allocator(omp_thread_mem_alloc) -#endif - double r = - __ocml_modf_f64(x, (__attribute__((address_space(5))) double *)&tmp); - *iptr = tmp; - - return r; + return __ocml_modf_f64(x, iptr); } LIBC_INLINE double sin(double x) { return __ocml_sin_f64(x); } -} // namespace vendor +} // namespace internal } // namespace __llvm_libc #endif // LLVM_LIBC_SRC_MATH_GPU_AMDGPU_H