Merge branch 'master' of https://github.com/ROCm-Developer-Tools/HIP into feature_native_vector_types

[ROCm/clr commit: 76d5a85117]
This commit is contained in:
Alex Voicu
2018-07-08 22:03:09 +03:00
melakukan 4ab4610aa7
4 mengubah file dengan 52 tambahan dan 4 penghapusan
+26 -3
Melihat File
@@ -381,15 +381,35 @@ foreach $arg (@ARGV)
open my $out, ">", $new_file or die "$new_file: $!";
while (my $line = <$in>) {
chomp $line;
if ($line =~ m/\.a$/) {
if ($line =~ m/\.a$/ || $line =~ m/\.lo$/) {
my $libFile = $line;
my $path = abs_path($line);
my @objs = split ('\n', `cd $tmpdir; ar xv $path`);
## Check if all files in .a are object files.
my $allIsObj = 1;
my $realObjs = "";
foreach my $obj (@objs) {
chomp $obj;
$obj =~ s/^x - //;
$obj = "$tmpdir/$obj";
push (@inputs, $obj);
$new_arg = "$new_arg $obj";
my $fileType = `file $obj`;
my $isObj = ($fileType =~ m/ELF/ or $fileType =~ m/COFF/);
$allIsObj = ($allIsObj and $isObj);
if ($isObj) {
$realObjs = ($realObjs . " " . $obj);
} else {
push (@inputs, $obj);
$new_arg = "$new_arg $obj";
}
}
chomp $realObjs;
if ($allIsObj) {
print $out "$line\n";
} elsif ($realObjs) {
my($libBaseName, $libDir, $libExt) = fileparse($libFile);
$libBaseName = mktemp($libBaseName . "XXXX") . $libExt;
system("cd $tmpdir; ar c $libBaseName $realObjs");
print $out "$tmpdir/$libBaseName\n";
}
} else {
print $out "$line\n";
@@ -606,6 +626,9 @@ if ($needLDFLAGS and not $compileOnly) {
$CMD .= " $HIPLDFLAGS";
}
$CMD .= " $toolArgs";
if ($needLDFLAGS and not $compileOnly and $HIP_PLATFORM eq "clang") {
$CMD .= " -lgcc_s -lgcc";
}
if ($verbose & 0x1) {
print "hipcc-cmd: ", $CMD, "\n";
@@ -293,6 +293,12 @@ typedef enum hipDeviceAttribute_t {
hipDeviceAttributeIntegrated, ///< iGPU
} hipDeviceAttribute_t;
enum hipComputeMode {
hipComputeModeDefault = 0,
hipComputeModeExclusive = 1,
hipComputeModeProhibited = 2,
hipComputeModeExcusiveProcess = 3
};
/**
* @}
@@ -16,7 +16,7 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
set(_targetsDefined)
set(_targetsNotDefined)
set(_expectedTargets)
foreach(_expectedTarget hip::hip_hcc_static hip::hip_hcc hip::hip_device)
foreach(_expectedTarget hip::hip_hcc_static hip::hip_hcc hip::hip_device hip::host hip::device)
list(APPEND _expectedTargets ${_expectedTarget})
if(NOT TARGET ${_expectedTarget})
list(APPEND _targetsNotDefined ${_expectedTarget})
@@ -65,6 +65,24 @@ set_target_properties(hip::hip_device PROPERTIES
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/opt/rocm/hsa/include"
)
# Create imported target hip::host
add_library(hip::host INTERFACE IMPORTED)
set_target_properties(hip::host PROPERTIES
INTERFACE_LINK_LIBRARIES "hip::hip_hcc"
)
# Create imported target hip::device
add_library(hip::device INTERFACE IMPORTED)
set_target_properties(hip::device PROPERTIES
INTERFACE_LINK_LIBRARIES "hip::host;hip::hip_device;hcc::hccrt;hcc::hc_am"
)
if(CMAKE_VERSION VERSION_LESS 3.0.0)
message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.")
endif()
# Load information for each installed configuration.
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(GLOB CONFIG_FILES "${_DIR}/hip-targets-*.cmake")
@@ -26,6 +26,7 @@ THE SOFTWARE.
#include <hc.hpp>
#include <hsa/hsa.h>
#include <unordered_map>
#include <stack>
#include "hsa/hsa_ext_amd.h"
#include "hip/hip_runtime.h"