diff --git a/CMakeLists.txt b/CMakeLists.txt index bf8828b237..04ada948dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,11 @@ cmake_minimum_required(VERSION 3.16.8) ########## # Defaults ########## +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + add_compile_options("/wd4267" "/wd4244" "/wd4996") + string(REPLACE "/GR" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + string(REPLACE "/W3" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +endif() option(CLR_BUILD_HIP "Build HIP" OFF) option(CLR_BUILD_OCL "Build OCL" OFF) diff --git a/hipamd/src/hip_conversions.hpp b/hipamd/src/hip_conversions.hpp index ebebde0d2e..2296a73516 100644 --- a/hipamd/src/hip_conversions.hpp +++ b/hipamd/src/hip_conversions.hpp @@ -97,7 +97,7 @@ cl_mem_object_type getCLMemObjectType(const unsigned int hipWidth, const unsigned int hipHeight, const unsigned int hipDepth, const unsigned int flags) { - if (flags & hipArrayLayered == hipArrayLayered) { + if ((flags & hipArrayLayered) == hipArrayLayered) { if ((hipWidth != 0) && (hipHeight == 0) && (hipDepth != 0)) { return CL_MEM_OBJECT_IMAGE1D_ARRAY; } else if ((hipWidth != 0) && (hipHeight != 0) && (hipDepth != 0)) { diff --git a/hipamd/src/hiprtc/hiprtcInternal.cpp b/hipamd/src/hiprtc/hiprtcInternal.cpp index 4bdee31686..a218060db3 100644 --- a/hipamd/src/hiprtc/hiprtcInternal.cpp +++ b/hipamd/src/hiprtc/hiprtcInternal.cpp @@ -486,7 +486,7 @@ bool RTCLinkProgram::AddLinkerOptions(unsigned int num_options, hiprtcJIT_option link_args_.generate_debug_info_ = *(reinterpret_cast(options_vals_ptr[opt_idx])); break; case HIPRTC_JIT_LOG_VERBOSE: - link_args_.log_verbose_ = reinterpret_cast(options_vals_ptr[opt_idx]); + link_args_.log_verbose_ = *(reinterpret_cast(options_vals_ptr[opt_idx])); break; case HIPRTC_JIT_GENERATE_LINE_INFO: link_args_.generate_line_info_ = *(reinterpret_cast(options_vals_ptr[opt_idx])); diff --git a/rocclr/device/pal/palresource.cpp b/rocclr/device/pal/palresource.cpp index 5dbc4a895f..2380c48e80 100644 --- a/rocclr/device/pal/palresource.cpp +++ b/rocclr/device/pal/palresource.cpp @@ -1508,7 +1508,7 @@ bool Resource::partialMemCopyTo(VirtualGPU& gpu, const amd::Coord3D& srcOrigin, gpu.queue(gpu.engineID_).addCmdMemRef(memRef()); gpu.queue(gpu.engineID_).addCmdMemRef(dstResource.memRef()); if (desc().buffer_ && !dstResource.desc().buffer_) { - int arraySliceIdx = img2Darray ? dstOrigin[2] : 0; + uint32_t arraySliceIdx = img2Darray ? dstOrigin[2] : 0; Pal::SubresId ImgSubresId = {0, dstResource.desc().baseLevel_, arraySliceIdx}; Pal::MemoryImageCopyRegion copyRegion = {}; copyRegion.imageSubres = ImgSubresId; @@ -1534,7 +1534,7 @@ bool Resource::partialMemCopyTo(VirtualGPU& gpu, const amd::Coord3D& srcOrigin, gpu.iCmd()->CmdCopyMemoryToImage(*iMem(), *dstResource.image_, imgLayout, 1, ©Region); } else if (!desc().buffer_ && dstResource.desc().buffer_) { Pal::MemoryImageCopyRegion copyRegion = {}; - int arraySliceIdx = img2Darray ? dstOrigin[2] : 0; + uint32_t arraySliceIdx = img2Darray ? dstOrigin[2] : 0; Pal::SubresId ImgSubresId = {0, desc().baseLevel_, arraySliceIdx}; copyRegion.imageSubres = ImgSubresId; copyRegion.imageOffset.x = srcOrigin[0]; diff --git a/rocclr/platform/activity.cpp b/rocclr/platform/activity.cpp index 2e6d61962e..4868f77e87 100644 --- a/rocclr/platform/activity.cpp +++ b/rocclr/platform/activity.cpp @@ -53,7 +53,7 @@ bool IsEnabled(OpId operation_id) { void ReportActivity(const amd::Command& command) { assert(command.profilingInfo().enabled_ && "profiling must be enabled for this command"); - auto operation_id = OperationId(command.type()); + activity_op_t operation_id = OperationId(command.type()); if (operation_id >= OP_ID_NUMBER) // This command does not translate into a profiler activity (dispatch, memcopy, etc...), there // is nothing to report to the profiler. diff --git a/rocclr/platform/command.hpp b/rocclr/platform/command.hpp index 6d133b18c8..97c501c901 100644 --- a/rocclr/platform/command.hpp +++ b/rocclr/platform/command.hpp @@ -1209,11 +1209,11 @@ class ExternalSemaphoreCmd : public Command { private: const void* sem_ptr_; //!< Pointer to external semaphore - int fence_; //!< semaphore value to be set + uint64_t fence_; //!< semaphore value to be set ExternalSemaphoreCmdType cmd_type_; //!< Signal or Wait semaphore command public: - ExternalSemaphoreCmd(HostQueue& queue, const void* sem_ptr, int fence, + ExternalSemaphoreCmd(HostQueue& queue, const void* sem_ptr, uint64_t fence, ExternalSemaphoreCmdType cmd_type) : Command::Command(queue, CL_COMMAND_USER), sem_ptr_(sem_ptr), fence_(fence), cmd_type_(cmd_type) {} @@ -1221,7 +1221,7 @@ class ExternalSemaphoreCmd : public Command { device.submitExternalSemaphoreCmd(*this); } const void* sem_ptr() const { return sem_ptr_; } - const int fence() { return fence_; } + const uint64_t fence() { return fence_; } const ExternalSemaphoreCmdType semaphoreCmd() { return cmd_type_; } };