From 3a8f272e1f8163a49983bb9e3ada7631808f6fb9 Mon Sep 17 00:00:00 2001 From: "Ding, Wei (xN/A) TX" Date: Tue, 24 Mar 2015 13:55:22 -0500 Subject: [PATCH] ECR #333755 - Fixed struct data alignment compatability issue for Windows. [git-p4: depot-paths = "//depot/stg/hsa/drivers/hsa/runtime/": change = 1133890] [ROCm/ROCR-Runtime commit: 7a543f916cac5f1f32f0b6d48251683c6b335bd8] --- .../rocr-runtime/samples/common/utilities.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/projects/rocr-runtime/samples/common/utilities.h b/projects/rocr-runtime/samples/common/utilities.h index 3c781bb780..4238efd61e 100644 --- a/projects/rocr-runtime/samples/common/utilities.h +++ b/projects/rocr-runtime/samples/common/utilities.h @@ -11,8 +11,25 @@ #include using namespace std; + + #define HSA_ARGUMENT_ALIGN_BYTES 16 +#if defined(_MSC_VER) + #define ALIGNED_(x) __declspec(align(x)) + +#pragma warning(disable: 4800) +#pragma warning(disable: 4305) // truncation from 'double' to 'const float' +#pragma warning(disable: 4267) // conversion from 'size_t' to 'int', possible loss of data + +typedef unsigned int uint; + +#else + #if defined(__GNUC__) + #define ALIGNED_(x) __attribute__ ((aligned(x))) + #endif // __GNUC__ +#endif // _MSC_VER + #define SDK_FAILURE 1 #define SDK_SUCCESS 0