SWDEV-334508 - Testing & fix for HIP samples on Linux and Windows. (#2711)

Change-Id: I6edc0d6dc7ce8f2223381baddacbc5063b6d4983
Bu işleme şunda yer alıyor:
ROCm CI Service Account
2022-06-02 17:00:05 +05:30
işlemeyi yapan: GitHub
ebeveyn 3ee51fcf98
işleme 5e42fbedfd
28 değiştirilmiş dosya ile 95 ekleme ve 31 silme
+3 -1
Dosyayı Görüntüle
@@ -17,7 +17,9 @@
# 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.
ifeq ($(OS),Windows_NT)
$(error Makefile is not supported on windows platform. Please use cmake instead to build sample.)
endif
ROCM_PATH?= $(wildcard /opt/rocm/)
HIP_PATH?= $(wildcard $(ROCM_PATH)/hip)
ifeq (,$(HIP_PATH))
+14 -4
Dosyayı Görüntüle
@@ -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");