SWDEV-334508 - Testing & fix for HIP samples on Linux and Windows. (#2711)
Change-Id: I6edc0d6dc7ce8f2223381baddacbc5063b6d4983
Este commit está contenido en:
cometido por
GitHub
padre
b790ecdf6c
commit
bfe584b134
@@ -7,8 +7,9 @@
|
||||
#include <typeinfo>
|
||||
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
#include <sys/time.h>
|
||||
#ifndef _WIN32
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include "ResultDatabase.h"
|
||||
#include "nullkernel.hip.cpp"
|
||||
@@ -134,9 +135,15 @@ int parseStandardArguments(int argc, char* argv[]) {
|
||||
|
||||
// Returns the current system time in microseconds
|
||||
inline long long get_time() {
|
||||
#ifdef _WIN32
|
||||
struct timespec ts;
|
||||
timespec_get(&ts, TIME_UTC);
|
||||
return (ts.tv_sec * 1000000) + (ts.tv_nsec/1000);
|
||||
#else
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, 0);
|
||||
return (tv.tv_sec * 1000000) + tv.tv_usec;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -815,8 +822,11 @@ int main(int argc, char* argv[]) {
|
||||
if (p_blockingSync) {
|
||||
#ifdef __HIP_PLATFORM_AMD__
|
||||
printf("setting BlockingSync for AMD\n");
|
||||
setenv("HIP_BLOCKING_SYNC", "1", 1);
|
||||
|
||||
#ifdef _WIN32
|
||||
_putenv_s("HIP_BLOCKING_SYNC", "1");
|
||||
#else
|
||||
setenv("HIP_BLOCKING_SYNC", "1", 1);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __HIP_PLATFORM_NVIDIA__
|
||||
printf("setting cudaDeviceBlockingSync\n");
|
||||
|
||||
Referencia en una nueva incidencia
Block a user