From 5e42fbedfdfa8adcf96cf687772ded3d08bbdc6e Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Thu, 2 Jun 2022 17:00:05 +0530 Subject: [PATCH] SWDEV-334508 - Testing & fix for HIP samples on Linux and Windows. (#2711) Change-Id: I6edc0d6dc7ce8f2223381baddacbc5063b6d4983 --- samples/0_Intro/bit_extract/CMakeLists.txt | 4 ++-- samples/0_Intro/bit_extract/Makefile | 4 +++- samples/0_Intro/module_api/Makefile | 4 +++- samples/0_Intro/module_api_global/Makefile | 4 +++- samples/0_Intro/square/Makefile | 4 +++- samples/1_Utils/hipBusBandwidth/Makefile | 4 +++- .../hipBusBandwidth/hipBusBandwidth.cpp | 6 +++++- samples/1_Utils/hipCommander/Makefile | 4 +++- samples/1_Utils/hipCommander/hipCommander.cpp | 18 ++++++++++++++---- samples/1_Utils/hipDispatchLatency/Makefile | 4 +++- samples/1_Utils/hipInfo/Makefile | 4 +++- samples/2_Cookbook/0_MatrixTranspose/Makefile | 4 +++- samples/2_Cookbook/10_inline_asm/Makefile | 4 +++- samples/2_Cookbook/11_texture_driver/Makefile | 4 +++- .../12_cmake_hip_add_executable/CMakeLists.txt | 4 ++-- samples/2_Cookbook/13_occupancy/Makefile | 4 +++- samples/2_Cookbook/14_gpu_arch/Makefile | 4 +++- .../device_functions/Makefile | 3 +++ .../15_static_library/host_functions/Makefile | 3 +++ .../16_assembly_to_executable/Makefile | 4 +++- .../17_llvm_ir_to_executable/Makefile | 4 +++- samples/2_Cookbook/3_shared_memory/Makefile | 4 +++- samples/2_Cookbook/4_shfl/Makefile | 4 +++- samples/2_Cookbook/5_2dshfl/Makefile | 4 +++- samples/2_Cookbook/6_dynamic_shared/Makefile | 4 +++- samples/2_Cookbook/7_streams/Makefile | 4 +++- samples/2_Cookbook/8_peer2peer/Makefile | 4 +++- samples/2_Cookbook/9_unroll/Makefile | 4 +++- 28 files changed, 95 insertions(+), 31 deletions(-) diff --git a/samples/0_Intro/bit_extract/CMakeLists.txt b/samples/0_Intro/bit_extract/CMakeLists.txt index 166a8ccb79..d51e4d974a 100644 --- a/samples/0_Intro/bit_extract/CMakeLists.txt +++ b/samples/0_Intro/bit_extract/CMakeLists.txt @@ -22,7 +22,7 @@ project(bit_extract) cmake_minimum_required(VERSION 3.10) -if(NOT DEFINED __HIP_ENABLE_PCH) +if(NOT WIN32 AND NOT DEFINED __HIP_ENABLE_PCH) set(__HIP_ENABLE_PCH ON CACHE BOOL "enable/disable pre-compiled hip headers") endif() @@ -49,4 +49,4 @@ set(CMAKE_CXX_LINKER ${HIP_HIPCC_EXECUTABLE}) add_executable(bit_extract bit_extract.cpp) # Link with HIP -target_link_libraries(bit_extract hip::host) \ No newline at end of file +target_link_libraries(bit_extract hip::host) diff --git a/samples/0_Intro/bit_extract/Makefile b/samples/0_Intro/bit_extract/Makefile index 612c18ce3c..6f4d824ba8 100644 --- a/samples/0_Intro/bit_extract/Makefile +++ b/samples/0_Intro/bit_extract/Makefile @@ -19,7 +19,9 @@ # THE SOFTWARE. #Dependencies : [MYHIP]/bin must be in user's path. - +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)) diff --git a/samples/0_Intro/module_api/Makefile b/samples/0_Intro/module_api/Makefile index ad78c1fd56..118d16a7ef 100644 --- a/samples/0_Intro/module_api/Makefile +++ b/samples/0_Intro/module_api/Makefile @@ -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)) diff --git a/samples/0_Intro/module_api_global/Makefile b/samples/0_Intro/module_api_global/Makefile index 3d186d3fb0..fdbc77f65f 100644 --- a/samples/0_Intro/module_api_global/Makefile +++ b/samples/0_Intro/module_api_global/Makefile @@ -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)) diff --git a/samples/0_Intro/square/Makefile b/samples/0_Intro/square/Makefile index ec35c87e72..83a37326ad 100644 --- a/samples/0_Intro/square/Makefile +++ b/samples/0_Intro/square/Makefile @@ -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)) diff --git a/samples/1_Utils/hipBusBandwidth/Makefile b/samples/1_Utils/hipBusBandwidth/Makefile index 8fa0b829fc..5aad9411e3 100644 --- a/samples/1_Utils/hipBusBandwidth/Makefile +++ b/samples/1_Utils/hipBusBandwidth/Makefile @@ -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)) diff --git a/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp b/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp index 79d80ce317..5a7e45f6bf 100644 --- a/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp +++ b/samples/1_Utils/hipBusBandwidth/hipBusBandwidth.cpp @@ -137,7 +137,11 @@ void RunBenchmark_H2D(ResultDatabase& resultDB) { } } else if (p_malloc_mode == MallocUnpinned) { if (p_alignedhost) { - hostMem = (float*)aligned_alloc(p_alignedhost, numMaxFloats * sizeof(float)); + #ifdef _WIN32 + hostMem = (float*)_aligned_malloc(numMaxFloats * sizeof(float),p_alignedhost); + #else + hostMem = (float*)aligned_alloc(p_alignedhost, numMaxFloats * sizeof(float)); + #endif } else { hostMem = new float[numMaxFloats]; } diff --git a/samples/1_Utils/hipCommander/Makefile b/samples/1_Utils/hipCommander/Makefile index bb38a1f2b7..fef6bfc946 100644 --- a/samples/1_Utils/hipCommander/Makefile +++ b/samples/1_Utils/hipCommander/Makefile @@ -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)) diff --git a/samples/1_Utils/hipCommander/hipCommander.cpp b/samples/1_Utils/hipCommander/hipCommander.cpp index e95ecd82a1..0743641214 100644 --- a/samples/1_Utils/hipCommander/hipCommander.cpp +++ b/samples/1_Utils/hipCommander/hipCommander.cpp @@ -7,8 +7,9 @@ #include #include - -#include +#ifndef _WIN32 + #include +#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"); diff --git a/samples/1_Utils/hipDispatchLatency/Makefile b/samples/1_Utils/hipDispatchLatency/Makefile index b93a530056..fbe37d2932 100644 --- a/samples/1_Utils/hipDispatchLatency/Makefile +++ b/samples/1_Utils/hipDispatchLatency/Makefile @@ -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)) diff --git a/samples/1_Utils/hipInfo/Makefile b/samples/1_Utils/hipInfo/Makefile index 09f717c7c2..c6c343dbd1 100644 --- a/samples/1_Utils/hipInfo/Makefile +++ b/samples/1_Utils/hipInfo/Makefile @@ -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)) diff --git a/samples/2_Cookbook/0_MatrixTranspose/Makefile b/samples/2_Cookbook/0_MatrixTranspose/Makefile index 4e829bde28..6d5b787510 100644 --- a/samples/2_Cookbook/0_MatrixTranspose/Makefile +++ b/samples/2_Cookbook/0_MatrixTranspose/Makefile @@ -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)) diff --git a/samples/2_Cookbook/10_inline_asm/Makefile b/samples/2_Cookbook/10_inline_asm/Makefile index 516a120612..58f013a2ba 100644 --- a/samples/2_Cookbook/10_inline_asm/Makefile +++ b/samples/2_Cookbook/10_inline_asm/Makefile @@ -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)) diff --git a/samples/2_Cookbook/11_texture_driver/Makefile b/samples/2_Cookbook/11_texture_driver/Makefile index 68d4d7f28c..f149005aa5 100644 --- a/samples/2_Cookbook/11_texture_driver/Makefile +++ b/samples/2_Cookbook/11_texture_driver/Makefile @@ -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)) diff --git a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt index 32f190b58f..f1a8bf8a82 100644 --- a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt +++ b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt @@ -31,7 +31,7 @@ if(NOT DEFINED HIP_PATH) endif() endif() set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH}) - +set(CMAKE_HIP_ARCHITECTURES OFF) project(12_cmake) set(HIP_CLANG_NUM_PARALLEL_JOBS 2) @@ -58,4 +58,4 @@ find_package(hip QUIET) if(TARGET hip::host) message(STATUS "Found hip::host at ${hip_DIR}") target_link_libraries(${MY_TARGET_NAME} hip::host) -endif() \ No newline at end of file +endif() diff --git a/samples/2_Cookbook/13_occupancy/Makefile b/samples/2_Cookbook/13_occupancy/Makefile index bfd5a8bb30..73f0753afb 100644 --- a/samples/2_Cookbook/13_occupancy/Makefile +++ b/samples/2_Cookbook/13_occupancy/Makefile @@ -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)) diff --git a/samples/2_Cookbook/14_gpu_arch/Makefile b/samples/2_Cookbook/14_gpu_arch/Makefile index 2e898a9e02..c730c10a06 100644 --- a/samples/2_Cookbook/14_gpu_arch/Makefile +++ b/samples/2_Cookbook/14_gpu_arch/Makefile @@ -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)) diff --git a/samples/2_Cookbook/15_static_library/device_functions/Makefile b/samples/2_Cookbook/15_static_library/device_functions/Makefile index 74bade6359..aaf7abb3c6 100644 --- a/samples/2_Cookbook/15_static_library/device_functions/Makefile +++ b/samples/2_Cookbook/15_static_library/device_functions/Makefile @@ -1,3 +1,6 @@ +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)) diff --git a/samples/2_Cookbook/15_static_library/host_functions/Makefile b/samples/2_Cookbook/15_static_library/host_functions/Makefile index 645b26fbb1..e6daa41da6 100644 --- a/samples/2_Cookbook/15_static_library/host_functions/Makefile +++ b/samples/2_Cookbook/15_static_library/host_functions/Makefile @@ -1,3 +1,6 @@ +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)) diff --git a/samples/2_Cookbook/16_assembly_to_executable/Makefile b/samples/2_Cookbook/16_assembly_to_executable/Makefile index 5732f37d01..b82ec8fdbe 100644 --- a/samples/2_Cookbook/16_assembly_to_executable/Makefile +++ b/samples/2_Cookbook/16_assembly_to_executable/Makefile @@ -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)) diff --git a/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile b/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile index 6299094b20..835f4b2789 100644 --- a/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile +++ b/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile @@ -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)) diff --git a/samples/2_Cookbook/3_shared_memory/Makefile b/samples/2_Cookbook/3_shared_memory/Makefile index ef8727c5ea..bbd7daace3 100644 --- a/samples/2_Cookbook/3_shared_memory/Makefile +++ b/samples/2_Cookbook/3_shared_memory/Makefile @@ -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)) diff --git a/samples/2_Cookbook/4_shfl/Makefile b/samples/2_Cookbook/4_shfl/Makefile index 76559c1cd2..de94a3e546 100644 --- a/samples/2_Cookbook/4_shfl/Makefile +++ b/samples/2_Cookbook/4_shfl/Makefile @@ -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)) diff --git a/samples/2_Cookbook/5_2dshfl/Makefile b/samples/2_Cookbook/5_2dshfl/Makefile index 57240697ee..91afcfc53a 100644 --- a/samples/2_Cookbook/5_2dshfl/Makefile +++ b/samples/2_Cookbook/5_2dshfl/Makefile @@ -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)) diff --git a/samples/2_Cookbook/6_dynamic_shared/Makefile b/samples/2_Cookbook/6_dynamic_shared/Makefile index 71d4f135ab..d95ca76085 100644 --- a/samples/2_Cookbook/6_dynamic_shared/Makefile +++ b/samples/2_Cookbook/6_dynamic_shared/Makefile @@ -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)) diff --git a/samples/2_Cookbook/7_streams/Makefile b/samples/2_Cookbook/7_streams/Makefile index 814341b5c5..70dcd4c879 100644 --- a/samples/2_Cookbook/7_streams/Makefile +++ b/samples/2_Cookbook/7_streams/Makefile @@ -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)) diff --git a/samples/2_Cookbook/8_peer2peer/Makefile b/samples/2_Cookbook/8_peer2peer/Makefile index 555e92ec9f..4112c75696 100644 --- a/samples/2_Cookbook/8_peer2peer/Makefile +++ b/samples/2_Cookbook/8_peer2peer/Makefile @@ -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)) diff --git a/samples/2_Cookbook/9_unroll/Makefile b/samples/2_Cookbook/9_unroll/Makefile index d1e3321b4f..657f879ac5 100644 --- a/samples/2_Cookbook/9_unroll/Makefile +++ b/samples/2_Cookbook/9_unroll/Makefile @@ -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))