[dtests] Separated C macros from CPP header file (#1429)

* Separated C macros from CPP header file

* Updated review comment
This commit is contained in:
Sarbojit2019
2019-10-01 12:38:32 +05:30
committed by Maneesh Gupta
parent 0dd5ccc298
commit cde5119c9e
2 changed files with 27 additions and 26 deletions
+26 -14
View File
@@ -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