/* Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include"test_common.h" #include"hip_runtime.h" #include"hip_runtime_api.h" #define N 512 #define SIZE N*sizeof(double) __global__ void test_sincos(hipLaunchParm lp, double* a, double* b, double *c){ int tid = hipThreadIdx_x; sincos(a[tid], b+tid, c+tid); } __global__ void test_sincospi(hipLaunchParm lp, double* a, double* b, double *c){ int tid = hipThreadIdx_x; sincospi(a[tid], b+tid, c+tid); } __global__ void test_llrint(hipLaunchParm lp, double *a, long long int *b){ int tid = hipThreadIdx_x; b[tid] = llrint(a[tid]); } __global__ void test_lrint(hipLaunchParm lp, double *a, long int *b){ int tid = hipThreadIdx_x; b[tid] = lrint(a[tid]); } __global__ void test_rint(hipLaunchParm lp, double *a, double *b){ int tid = hipThreadIdx_x; b[tid] = rint(a[tid]); } __global__ void test_llround(hipLaunchParm lp, double *a, long long int *b){ int tid = hipThreadIdx_x; b[tid] = llround(a[tid]); } __global__ void test_lround(hipLaunchParm lp, double *a, long int *b){ int tid = hipThreadIdx_x; b[tid] = lround(a[tid]); } __global__ void test_rhypot(hipLaunchParm lp, double *a, double* b, double *c){ int tid = hipThreadIdx_x; c[tid] = rhypot(a[tid], b[tid]); } __global__ void test_norm3d(hipLaunchParm lp, double *a, double* b, double *c, double *d){ int tid = hipThreadIdx_x; d[tid] = norm3d(a[tid], b[tid], c[tid]); } __global__ void test_norm4d(hipLaunchParm lp, double *a, double* b, double *c, double *d, double *e){ int tid = hipThreadIdx_x; e[tid] = norm4d(a[tid], b[tid], c[tid], d[tid]); } __global__ void test_rnorm3d(hipLaunchParm lp, double *a, double* b, double *c, double *d){ int tid = hipThreadIdx_x; d[tid] = rnorm3d(a[tid], b[tid], c[tid]); } __global__ void test_rnorm4d(hipLaunchParm lp, double *a, double* b, double *c, double *d, double *e){ int tid = hipThreadIdx_x; e[tid] = rnorm4d(a[tid], b[tid], c[tid], d[tid]); } __global__ void test_rnorm(hipLaunchParm lp, double *a, double *b){ int tid = hipThreadIdx_x; b[tid] = rnorm(N, a); } __global__ void test_erfinv(hipLaunchParm lp, double *a, double *b){ int tid = hipThreadIdx_x; b[tid] = erf(erfinv(a[tid])); } bool run_sincos(){ double *A, *Ad, *B, *C, *Bd, *Cd; A = new double[N]; B = new double[N]; C = new double[N]; for(int i=0;i