Included code to calculate value of maxThreadsPerMultiprocessor property

Change-Id: Ie7cad7442f36a7163e715048de5a309febc28664


[ROCm/hip commit: 6e641df649]
This commit is contained in:
Rahul Garg
2016-06-23 22:22:58 +05:30
committato da Maneesh Gupta
parent 2429b1b35d
commit 552b44b196
3 ha cambiato i file con 8 aggiunte e 6 eliminazioni
+2 -2
Vedi File
@@ -114,8 +114,8 @@ if(HIP_PLATFORM STREQUAL "hcc")
set(CMAKE_C_COMPILER "${HCC_HOME}/bin/hcc")
# Set HIP_HCC so we know this is HIP compile, some files are shared with HCC (staging_buffer).
set(CMAKE_CXX_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -stdlib=libc++ -DHIP_HCC")
set(CMAKE_C_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -stdlib=libc++ -DHIP_HCC")
set(CMAKE_CXX_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -I/opt/rocm/libhsakmt/include/libhsakmt -stdlib=libc++ -DHIP_HCC")
set(CMAKE_C_FLAGS " -hc -I${HCC_HOME}/include -I${HSA_PATH}/include -I/opt/rocm/libhsakmt/include/libhsakmt -stdlib=libc++ -DHIP_HCC")
set(SOURCE_FILES src/device_util.cpp
src/hip_hcc.cpp
+1 -1
Vedi File
@@ -81,7 +81,7 @@ if ($HIP_PLATFORM eq "hcc") {
$HIPLDFLAGS .= " -Wl,--defsym=_binary_kernel_spir_end=0 -Wl,--defsym=_binary_kernel_spir_start=0 -Wl,--defsym=_binary_kernel_cl_start=0 -Wl,--defsym=_binary_kernel_cl_end=0";
# Satisfy HCC dependencies
$HIPLDFLAGS .= " -lc++abi";
$HIPLDFLAGS .= " -L$HSA_PATH/lib -L$ROCM_PATH/lib -lhsa-runtime64 -lhc_am";
$HIPLDFLAGS .= " -L$HSA_PATH/lib -L$ROCM_PATH/lib -lhsa-runtime64 -lhc_am -lhsakmt";
# Add trace marker library:
# TODO - once we cleanly separate the HIP API headers from HIP library headers this logic should move to CMakebuild option - apps do not need to see the marker library.
+5 -3
Vedi File
@@ -42,6 +42,7 @@ THE SOFTWARE.
#include "hip_runtime.h"
#include "hcc_detail/hip_hcc.h"
#include "hsa_ext_amd.h"
#include "hsakmt.h"
// TODO, re-org header order.
extern const char *ihipErrorString(hipError_t hip_error);
@@ -720,17 +721,18 @@ hipError_t ihipDevice_t::getProperties(hipDeviceProp_t* prop)
prop->computeMode = 0;
// Get Max Threads Per Multiprocessor
/*
HsaSystemProperties props;
hsaKmtReleaseSystemProperties();
if(HSAKMT_STATUS_SUCCESS == hsaKmtAcquireSystemProperties(&props)) {
HsaNodeProperties node_prop = {0};
if(HSAKMT_STATUS_SUCCESS == hsaKmtGetNodeProperties(node, &node_prop)) {
uint32_t waves_per_cu = node_prop.MaxWavesPerSIMD;
prop-> maxThreadsPerMultiProcessor = prop->warpsize*waves_per_cu;
uint32_t simd_per_cu = node_prop.NumSIMDPerCU;
prop-> maxThreadsPerMultiProcessor = prop->warpSize*waves_per_cu*simd_per_cu;
}
}
*/
// Get memory properties
err = hsa_agent_iterate_regions(_hsa_agent, get_region_info, prop);