[dtests] Separated C macros from CPP header file (#1429)
* Separated C macros from CPP header file
* Updated review comment
[ROCm/hip commit: cde5119c9e]
Этот коммит содержится в:
коммит произвёл
Maneesh Gupta
родитель
ef49c4f789
Коммит
bfa8867a64
@@ -27,21 +27,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
#include "../test_common.h"
|
||||
#include <stdio.h>
|
||||
#include "LaunchKernel.h"
|
||||
|
||||
#define HIPCHECK(error) \
|
||||
{ \
|
||||
hipError_t localError = error; \
|
||||
if ((localError != hipSuccess) && (localError != hipErrorPeerAccessAlreadyEnabled)) { \
|
||||
printf("%serror: '%s'(%d) from %s at %s:%d%s\n", "\x1B[31m", hipGetErrorString(localError), \
|
||||
localError, #error, __FILE__, __LINE__, "\x1B[0m"); \
|
||||
return false; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
bool LaunchKernelArg()
|
||||
{
|
||||
dim3 blocks = {1,1,1};
|
||||
|
||||
@@ -17,13 +17,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#if __CUDACC__
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <chrono>
|
||||
/*
|
||||
* File is intended to C and CPP compliant hence any CPP specic changes
|
||||
* should be added into CPP section
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#if __CUDACC__
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <chrono>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ************************ GCC section **************************
|
||||
#include <stddef.h>
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
@@ -41,14 +51,6 @@ THE SOFTWARE.
|
||||
#define KCYN "\x1B[36m"
|
||||
#define KWHT "\x1B[37m"
|
||||
|
||||
|
||||
#ifdef __HIP_PLATFORM_HCC
|
||||
#define TYPENAME(T) typeid(T).name()
|
||||
#else
|
||||
#define TYPENAME(T) "?"
|
||||
#endif
|
||||
|
||||
|
||||
#define passed() \
|
||||
printf("%sPASSED!%s\n", KGRN, KNRM); \
|
||||
exit(0);
|
||||
@@ -114,6 +116,15 @@ extern int p_gpuDevice;
|
||||
extern unsigned p_verbose;
|
||||
extern int p_tests;
|
||||
|
||||
// ********************* CPP section *********************
|
||||
#ifdef __cplusplus
|
||||
|
||||
#ifdef __HIP_PLATFORM_HCC
|
||||
#define TYPENAME(T) typeid(T).name()
|
||||
#else
|
||||
#define TYPENAME(T) "?"
|
||||
#endif
|
||||
|
||||
namespace HipTest {
|
||||
|
||||
// Returns the current system time in microseconds
|
||||
@@ -470,3 +481,4 @@ struct MemTraits<MemcpyAsync> {
|
||||
};
|
||||
|
||||
}; // namespace HipTest
|
||||
#endif //__cplusplus
|
||||
|
||||
Ссылка в новой задаче
Block a user