diff --git a/Makefile b/Makefile index 6542b03acd..33b43f53e9 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ $(HIP_OBJECTS): HIPCC_FLAGS += -I$(HSA_PATH)/include $(HIP_OBJECTS): %.o:: %.cpp - $(HIPCC) $(HIPCC_FLAGS) $< -c -o $@ + $(HIPCC) $(HIPCC_FLAGS) $< -c -O3 -o $@ clean: diff --git a/bin/hipconfig b/bin/hipconfig index 5d982111ed..2af9ad0937 100755 --- a/bin/hipconfig +++ b/bin/hipconfig @@ -14,6 +14,7 @@ GetOptions( ,"compiler|c" => \$p_compiler ,"platform|P" => \$p_platform ,"cpp_config|cxx_config|C" => \$p_cpp_config + ,"full|f" => \$p_full, ,"newline|n" => \$p_newline ); @@ -23,6 +24,7 @@ if ($p_help) { print " --cpp_config, -C : print C++ compiler options\n"; print " --compiler, -c : print compiler (hcc or nvcc)\n"; print " --platform, -P : print platform (hcc or nvcc)\n"; + print " --full, -f : print full config\n"; print " --newline, -n : print newline\n"; print " --help, -h : print help message\n"; exit(); @@ -47,8 +49,13 @@ $HIP_PATH=$ENV{'HIP_PATH'}; $HIP_PATH=Cwd::realpath (dirname (dirname $0)) unless defined $HIP_PATH; # use parent directory of this tool +if ($HIP_PLATFORM eq "hcc") { + $CPP_CONFIG= " -D__HIP_PLATFORM_HCC__= -I$HIP_PATH/include -I$HCC_HOME/include"; +} +if ($HIP_PLATFORM eq "nvcc") { + $CPP_CONFIG = " -D__HIP_PLATFORM_NVCC__= -I$HIP_PATH/include -I$CUDA_PATH/include"; +}; -$printed = 0; if ($p_path) { print "$HIP_PATH"; $printed = 1; @@ -56,15 +63,39 @@ if ($p_path) { if ($p_cpp_config) { - if ($HIP_PLATFORM eq "hcc") { - print " -D__HIP_PLATFORM_HCC__= -I$HIP_PATH/include -I$HCC_HOME/include"; - } - if ($HIP_PLATFORM eq "nvcc") { - print " -D__HIP_PLATFORM_NVCC__= -I$HIP_PATH/include -I$CUDA_PATH/include"; - }; + print $CPP_CONFIG; $printed = 1; } +if ($p_full) { + print "== hipconfig\n"; + print "HIP_PATH : ", $HIP_PATH, "\n"; + print "HIP_PLATFORM : ", $HIP_PLATFORM, "\n"; + print "CPP_CONFIG : ", $CPP_CONFIG, "\n"; + if ($HIP_PLATFORM eq "hcc") + { + print "\n" ; + print "== hcc\n"; + print ("HCC_HOME : $HCC_HOME\n"); + system("$HCC_HOME/bin/hcc --version"); + } + if ($HIP_PLATFORM eq "nvcc") { + print "\n" ; + print "== nvcc\n"; + #print "CUDA_PATH :", $CUDA_PATH"; + system("nvcc --version"); + + } + print "\n" ; + + print "=== Environment Variables\n"; + system("env | egrep '^HIP|^HSA|^HCC|^CUDA'"); + + print "\n" ; + print "== Linux Kernel\n"; + system ("uname -a"); + $printed = 1; +} if (!$printed or $p_compiler or $p_platform) { diff --git a/bin/hipconvertinplace.sh b/bin/hipconvertinplace.sh index 8381687853..a8c8d6d9e8 100755 --- a/bin/hipconvertinplace.sh +++ b/bin/hipconvertinplace.sh @@ -4,10 +4,10 @@ #hipify "inplace" all code files in specified directory. # This can be quite handy when dealing with an existing CUDA code base since the script -# preseeves the existing directory structure. +# preserves the existing directory structure. # For each code file, this script will: -# - If ".prehip file does not exist, copy the original code to a new file withextension ".prehip". Then Hipify the code file. +# - If ".prehip file does not exist, copy the original code to a new file with extension ".prehip". Then Hipify the code file. # - If ".prehip" file exists, this is used as input to hipify. # (this is useful for testing improvements to the hipify toolset). diff --git a/docs/markdown/hip_terms.md b/docs/markdown/hip_terms.md index d55d5da7f5..4ab04f459a 100644 --- a/docs/markdown/hip_terms.md +++ b/docs/markdown/hip_terms.md @@ -34,9 +34,9 @@ |Vector|`float4`|`float4`|`hc::`
`short_vector::float4`|`concurrency::`
`graphics::float_4`|`float4` ###Notes -1. For HC and C++AMP, assume captured _tiled_ext_ t_ext and captured _extent_ ext. These languages use captured variables to pass information to the kernel rather than special built-in functions so variable name may vary. -2. The indexig functions (starting with thread-index) show the terminology for a 1D grid. Some APIs use reverse order of xyz / 012 indexing for 3D grids. -3. HC allos tile dimensions to be specified at runtime while C++AMP requires that tile dimensions are specified at compile-time. Thus hc syntax for tile dims is `t_ext.tile_dim[0]` while C++AMP is t_ext.tile_dim0. +1. For HC and C++AMP, assume a captured _tiled_ext_ named "t_ext" and captured _extent_ named "ext". These languages use captured variables to pass information to the kernel rather than using special built-in functions so the exact variable name may vary. +2. The indexing functions (starting with `thread-index`) show the terminology for a 1D grid. Some APIs use reverse order of xyz / 012 indexing for 3D grids. +3. HC allows tile dimensions to be specified at runtime while C++AMP requires that tile dimensions be specified at compile-time. Thus hc syntax for tile dims is `t_ext.tile_dim[0]` while C++AMP is t_ext.tile_dim0.