Merge branch 'privatestaging' of https://github.com/AMDComputeLibraries/HIP-privatestaging into privatestaging
This commit is contained in:
@@ -40,7 +40,6 @@ $CODEXL_PATH = $ENV{'CODEXL_PATH'};
|
|||||||
$CODEXL_PATH = "/opt/AMD/CodeXL" unless defined $CODEXL_PATH;
|
$CODEXL_PATH = "/opt/AMD/CodeXL" unless defined $CODEXL_PATH;
|
||||||
$marker_path = "$CODEXL_PATH/SDK/AMDTActivityLogger";
|
$marker_path = "$CODEXL_PATH/SDK/AMDTActivityLogger";
|
||||||
|
|
||||||
|
|
||||||
#---
|
#---
|
||||||
#HIP_PLATFORM controls whether to use NVCC or HCC for compilation:
|
#HIP_PLATFORM controls whether to use NVCC or HCC for compilation:
|
||||||
$HIP_PLATFORM=$ENV{'HIP_PLATFORM'};
|
$HIP_PLATFORM=$ENV{'HIP_PLATFORM'};
|
||||||
@@ -56,7 +55,7 @@ if ($verbose & 0x2) {
|
|||||||
print ("CUDA_PATH=$CUDA_PATH\n");
|
print ("CUDA_PATH=$CUDA_PATH\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$enablestdcpplib = 0;
|
||||||
|
|
||||||
if ($HIP_PLATFORM eq "hcc") {
|
if ($HIP_PLATFORM eq "hcc") {
|
||||||
$HSA_PATH=$ENV{'HSA_PATH'};
|
$HSA_PATH=$ENV{'HSA_PATH'};
|
||||||
@@ -67,7 +66,7 @@ if ($HIP_PLATFORM eq "hcc") {
|
|||||||
|
|
||||||
# HCC* may be used to compile src/hip_hcc.o (and also feed the HIPCXXFLAGS below)
|
# HCC* may be used to compile src/hip_hcc.o (and also feed the HIPCXXFLAGS below)
|
||||||
$HCC = "$HCC_HOME/bin/hcc";
|
$HCC = "$HCC_HOME/bin/hcc";
|
||||||
$HCCFLAGS = " -hc -I$HCC_HOME/include -stdlib=libc++";
|
$HCCFLAGS = " -hc -I$HCC_HOME/include ";
|
||||||
|
|
||||||
$HIPCC=$HCC;
|
$HIPCC=$HCC;
|
||||||
$HIPCXXFLAGS = $HCCFLAGS;
|
$HIPCXXFLAGS = $HCCFLAGS;
|
||||||
@@ -144,6 +143,11 @@ foreach $arg (@ARGV)
|
|||||||
$needLDFLAGS = 1;
|
$needLDFLAGS = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($arg eq '-stdlib=libstdc++' and $enablestdcpplib eq 0)
|
||||||
|
{
|
||||||
|
$HIPCXXFLAGS .= " -stdlib=libstdc++";
|
||||||
|
$enablestdcpplib = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if ($arg =~ m/^-/) {
|
if ($arg =~ m/^-/) {
|
||||||
# options start with -
|
# options start with -
|
||||||
@@ -183,6 +187,11 @@ if ($hasCU and $HIP_PLATFORM eq 'hcc') {
|
|||||||
$HIPCXXFLAGS .= " -x c++";
|
$HIPCXXFLAGS .= " -x c++";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($enablestdcpplib eq 0 and $HIP_PLATFORM eq 'hcc')
|
||||||
|
{
|
||||||
|
$HIPCXXFLAGS .= " -stdlib=libc++";
|
||||||
|
}
|
||||||
|
|
||||||
if ($needHipHcc) {
|
if ($needHipHcc) {
|
||||||
$HIP_USE_SHARED_LIBRARY = $ENV{'HIP_USE_SHARED_LIBRARY'};
|
$HIP_USE_SHARED_LIBRARY = $ENV{'HIP_USE_SHARED_LIBRARY'};
|
||||||
$HIP_USE_SHARED_LIBRARY = 0 unless defined $HIP_USE_SHARED_LIBRARY;
|
$HIP_USE_SHARED_LIBRARY = 0 unless defined $HIP_USE_SHARED_LIBRARY;
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef HCC_H
|
||||||
|
#define HCC_H
|
||||||
|
|
||||||
|
#if defined(__HIP_PLATFORM_HCC__) && !defined (__HIP_PLATFORM_NVCC__)
|
||||||
|
#include <hcc_detail/hcc_acc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef HCC_ACC_H
|
||||||
|
#define HCC_ACC_H
|
||||||
|
#include "hip_runtime_api.h"
|
||||||
|
|
||||||
|
#if __cplusplus
|
||||||
|
#ifdef __HCC__
|
||||||
|
#include <hc.hpp>
|
||||||
|
/**
|
||||||
|
* @brief Return hc::accelerator associated with the specified deviceId
|
||||||
|
*/
|
||||||
|
hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator *acc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return hc::accelerator_view associated with the specified stream
|
||||||
|
*/
|
||||||
|
hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view **av);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1041,20 +1041,6 @@ hipError_t hipDriverGetVersion(int *driverVersion) ;
|
|||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#if __cplusplus
|
|
||||||
#ifdef __HCC__
|
|
||||||
#include <hc.hpp>
|
|
||||||
/**
|
|
||||||
* @brief Return hc::accelerator associated with the specified deviceId
|
|
||||||
*/
|
|
||||||
hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator *acc);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Return hc::accelerator_view associated with the specified stream
|
|
||||||
*/
|
|
||||||
hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view **av);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// end-group HCC_Specific
|
// end-group HCC_Specific
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -899,7 +899,6 @@ void ihipInit()
|
|||||||
for (int i=0; i<accs.size(); i++) {
|
for (int i=0; i<accs.size(); i++) {
|
||||||
// check if the device id is included in the HIP_VISIBLE_DEVICES env variable
|
// check if the device id is included in the HIP_VISIBLE_DEVICES env variable
|
||||||
if (! accs[i].get_is_emulated()) {
|
if (! accs[i].get_is_emulated()) {
|
||||||
//if (std::find(g_hip_visible_devices.begin(), g_hip_visible_devices.end(), (i-1)) == g_hip_visible_devices.end() && g_visible_device)
|
|
||||||
if (std::find(g_hip_visible_devices.begin(), g_hip_visible_devices.end(), (i-1)) == g_hip_visible_devices.end() && g_visible_device)
|
if (std::find(g_hip_visible_devices.begin(), g_hip_visible_devices.end(), (i-1)) == g_hip_visible_devices.end() && g_visible_device)
|
||||||
{
|
{
|
||||||
//If device is not in visible devices list, ignore
|
//If device is not in visible devices list, ignore
|
||||||
@@ -933,13 +932,6 @@ bool ihipIsValidDevice(unsigned deviceIndex)
|
|||||||
return (deviceIndex < g_deviceCnt);
|
return (deviceIndex < g_deviceCnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*// check if the device ID is set as visible*/
|
|
||||||
//INLINE bool ihipIsVisibleDevice(unsigned deviceIndex)
|
|
||||||
//{
|
|
||||||
//return std::find(g_hip_visible_devices.begin(), g_hip_visible_devices.end(),
|
|
||||||
//(int)deviceIndex) != g_hip_visible_devices.end();
|
|
||||||
/*}*/
|
|
||||||
|
|
||||||
//---
|
//---
|
||||||
ihipDevice_t *ihipGetTlsDefaultDevice()
|
ihipDevice_t *ihipGetTlsDefaultDevice()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ THE SOFTWARE.
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <hip_runtime.h>
|
#include <hip_runtime.h>
|
||||||
|
#include <hcc.h>
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
|
|
||||||
#define CHECK(error) \
|
#define CHECK(error) \
|
||||||
|
|||||||
Reference in New Issue
Block a user