Index: libomptarget/deviceRTLs/nvptx/CMakeLists.txt =================================================================== --- libomptarget/deviceRTLs/nvptx/CMakeLists.txt +++ libomptarget/deviceRTLs/nvptx/CMakeLists.txt @@ -53,6 +53,7 @@ src/reduction.cu src/sync.cu src/task.cu + src/math.cu ) set(omp_data_objects src/omp_data.cu) Index: libomptarget/deviceRTLs/nvptx/src/interface.h =================================================================== --- libomptarget/deviceRTLs/nvptx/src/interface.h +++ libomptarget/deviceRTLs/nvptx/src/interface.h @@ -567,4 +567,7 @@ EXTERN void __kmpc_restore_team_static_memory(int16_t isSPMDExecutionMode, int16_t is_shared); +EXTERN double __kmpc_pow(double, double); +EXTERN double __kmpc_sin(double); + #endif Index: libomptarget/deviceRTLs/nvptx/src/math.cu =================================================================== --- /dev/null +++ libomptarget/deviceRTLs/nvptx/src/math.cu @@ -0,0 +1,18 @@ +//===------------ math.cu - NVPTX OpenMP math constructs --------- CUDA -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file contains the implementation of math function not already handled. +// Function in this file will end up as part of the .bc library of the +// device and will call libdevice functions. +// +//===----------------------------------------------------------------------===// + +#include "omptarget-nvptx.h" + +EXTERN double __kmpc_pow(double a, double b) { return pow(a, b); } +EXTERN double __kmpc_sin(double a) { return sin(a); }