@@ -380,7 +380,10 @@ __device__ inline float __powf(float base, float exponent) {return hc::fast_math
|
||||
__device__ inline void __sincosf(float x, float *s, float *c) {return hc::fast_math::sincosf(x, s, c); };
|
||||
__device__ inline float __sinf(float x) {return hc::fast_math::sinf(x); };
|
||||
__device__ inline float __tanf(float x) {return hc::fast_math::tanf(x); };
|
||||
|
||||
__device__ inline float __dsqrt_rd(double x) {return hc::fast_math::sqrt(x); };
|
||||
__device__ inline float __dsqrt_rn(double x) {return hc::fast_math::sqrt(x); };
|
||||
__device__ inline float __dsqrt_ru(double x) {return hc::fast_math::sqrt(x); };
|
||||
__device__ inline float __dsqrt_rz(double x) {return hc::fast_math::sqrt(x); };
|
||||
|
||||
/**
|
||||
* Kernel launching
|
||||
|
||||
@@ -117,7 +117,7 @@ make_hip_executable (hipHcc hipHcc.cpp)
|
||||
make_hip_executable (hipSimpleAtomicsTest hipSimpleAtomicsTest.cpp)
|
||||
make_hip_executable (hipMathFunctionsHost hipMathFunctions.cpp hipSinglePrecisionMathHost.cpp hipDoublePrecisionMathHost.cpp)
|
||||
make_hip_executable (hipMathFunctionsDevice hipMathFunctions.cpp hipSinglePrecisionMathDevice.cpp hipDoublePrecisionMathDevice.cpp)
|
||||
make_hip_executable (hipIntrinsics hipMathFunctions.cpp hipSinglePrecisionIntrinsics.cpp)
|
||||
make_hip_executable (hipIntrinsics hipMathFunctions.cpp hipSinglePrecisionIntrinsics.cpp hipDoublePrecisionIntrinsics.cpp hipIntegerIntrinsics.cpp)
|
||||
target_link_libraries(hipMathFunctionsHost m)
|
||||
|
||||
make_test(hip_anyall " " )
|
||||
|
||||
@@ -27,34 +27,34 @@ THE SOFTWARE.
|
||||
|
||||
__device__ void double_precision_intrinsics()
|
||||
{
|
||||
__dadd_rd(0.0, 1.0);
|
||||
__dadd_rn(0.0, 1.0);
|
||||
__dadd_ru(0.0, 1.0);
|
||||
__dadd_rz(0.0, 1.0);
|
||||
__ddiv_rd(4.0, 2.0);
|
||||
__ddiv_rn(4.0, 2.0);
|
||||
__ddiv_ru(4.0, 2.0);
|
||||
__ddiv_rz(4.0, 2.0);
|
||||
__dmul_rd(1.0, 2.0);
|
||||
__dmul_rn(1.0, 2.0);
|
||||
__dmul_ru(1.0, 2.0);
|
||||
__dmul_rz(1.0, 2.0);
|
||||
__drcp_rd(2.0);
|
||||
__drcp_rn(2.0);
|
||||
__drcp_ru(2.0);
|
||||
__drcp_rz(2.0);
|
||||
//__dadd_rd(0.0, 1.0);
|
||||
//__dadd_rn(0.0, 1.0);
|
||||
//__dadd_ru(0.0, 1.0);
|
||||
//__dadd_rz(0.0, 1.0);
|
||||
//__ddiv_rd(0.0, 1.0);
|
||||
//__ddiv_rn(0.0, 1.0);
|
||||
//__ddiv_ru(0.0, 1.0);
|
||||
//__ddiv_rz(0.0, 1.0);
|
||||
//__dmul_rd(1.0, 2.0);
|
||||
//__dmul_rn(1.0, 2.0);
|
||||
//__dmul_ru(1.0, 2.0);
|
||||
//__dmul_rz(1.0, 2.0);
|
||||
//__drcp_rd(2.0);
|
||||
//__drcp_rn(2.0);
|
||||
//__drcp_ru(2.0);
|
||||
//__drcp_rz(2.0);
|
||||
__dsqrt_rd(4.0);
|
||||
__dsqrt_rn(4.0);
|
||||
__dsqrt_ru(4.0);
|
||||
__dsqrt_rz(4.0);
|
||||
__dsub_rd(2.0, 1.0);
|
||||
__dsub_rn(2.0, 1.0);
|
||||
__dsub_ru(2.0, 1.0);
|
||||
__dsub_rz(2.0, 1.0);
|
||||
__fma_rd(1.0, 2.0, 3.0);
|
||||
__fma_rn(1.0, 2.0, 3.0);
|
||||
__fma_ru(1.0, 2.0, 3.0);
|
||||
__fma_rz(1.0, 2.0, 3.0);
|
||||
//__dsub_rd(2.0, 1.0);
|
||||
//__dsub_rn(2.0, 1.0);
|
||||
//__dsub_ru(2.0, 1.0);
|
||||
//__dsub_rz(2.0, 1.0);
|
||||
//__fma_rd(1.0, 2.0, 3.0);
|
||||
//__fma_rn(1.0, 2.0, 3.0);
|
||||
//__fma_ru(1.0, 2.0, 3.0);
|
||||
//__fma_rz(1.0, 2.0, 3.0);
|
||||
}
|
||||
|
||||
__global__ void compileDoublePrecisionIntrinsics(hipLaunchParm lp, int ignored)
|
||||
|
||||
@@ -29,25 +29,25 @@ __device__ void integer_intrinsics()
|
||||
{
|
||||
__brev((unsigned int)10);
|
||||
__brevll((unsigned long long)10);
|
||||
__byte_perm((unsigned int)0, (unsigned int)0, 0);
|
||||
//__byte_perm((unsigned int)0, (unsigned int)0, 0);
|
||||
__clz((int)10);
|
||||
__clzll((long long)10);
|
||||
__ffs((int)10);
|
||||
__ffsll((long long)10);
|
||||
__hadd((int)1, (int)3);
|
||||
__mul24((int)1, (int)2);
|
||||
__mul64hi((long long)1, (long long)2);
|
||||
__mulhi((int)1, (int)2);
|
||||
//__hadd((int)1, (int)3);
|
||||
//__mul24((int)1, (int)2);
|
||||
//__mul64hi((long long)1, (long long)2);
|
||||
//__mulhi((int)1, (int)2);
|
||||
__popc((unsigned int)4);
|
||||
__popcll((unsigned long long)4);
|
||||
__rhadd((int)1, (int)2);
|
||||
__sad((int)1, (int)2, 0);
|
||||
__uhadd((unsigned int)1, (unsigned int)3);
|
||||
__umul24((unsigned int)1, (unsigned int)2);
|
||||
__umul64hi((unsigned long long)1, (unsigned long long)2);
|
||||
__umulhi((unsigned int)1, (unsigned int)2);
|
||||
__urhadd((unsigned int)1, (unsigned int)2);
|
||||
__usad((unsigned int)1, (unsigned int)2, 0);
|
||||
//__rhadd((int)1, (int)2);
|
||||
//__sad((int)1, (int)2, 0);
|
||||
//__uhadd((unsigned int)1, (unsigned int)3);
|
||||
//__umul24((unsigned int)1, (unsigned int)2);
|
||||
//__umul64hi((unsigned long long)1, (unsigned long long)2);
|
||||
//__umulhi((unsigned int)1, (unsigned int)2);
|
||||
//__urhadd((unsigned int)1, (unsigned int)2);
|
||||
//__usad((unsigned int)1, (unsigned int)2, 0);
|
||||
}
|
||||
|
||||
__global__ void compileIntegerIntrinsics(hipLaunchParm lp, int ignored)
|
||||
|
||||
Ссылка в новой задаче
Block a user