Provcide more flexiblity in using HIP_PATH to control installation.

Also improve docs for developers / contributing.
Αυτή η υποβολή περιλαμβάνεται σε:
Ben Sander
2016-03-24 13:33:07 -05:00
γονέας 5e3428acc1
υποβολή f3ad047194
5 αρχεία άλλαξαν με 44 προσθήκες και 26 διαγραφές
+7 -1
Προβολή Αρχείου
@@ -11,8 +11,14 @@ MESSAGE ("HCC_HOME=" ${HCC_HOME})
set(HSA_PATH "/opt/hsa")
set (HIP_INSTALL_PATH $ENV{HIP_PATH})
if (NOT DEFINED HIP_INSTALL_PATH)
set (HIP_INSTALLPATH /opt/hip)
endif()
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "/opt/hip" CACHE PATH "Default installation path of hip" FORCE)
set(CMAKE_INSTALL_PREFIX "${HIP_INSTALL_PATH}" CACHE PATH "Default installation path of hip" FORCE)
endif ()
include_directories(${PROJECT_SOURCE_DIR}/include)
+15 -2
Προβολή Αρχείου
@@ -52,8 +52,21 @@ The unix `date` command can print the HCC-format work-week for a specific date ,
HIP includes unit tests in the tests/src directory.
When adding a new HIP feature, add a new unit test as well.
The tests/src/hipMemtest.cpp file contains a simple unit test and is a good starting point for other tests.
Modify tests/src/CMakefiles.txt to add the test to the build environment.
See [tests/README.md](README.md) for more information.
## Development Flow
The Unit testing environment automatically rebuilds libhip_hcc.a and the tests when a change it made to the HIP source, and this
is a great place to develop new features alongside the associated test.
For applications and benchmarks outside the directed test environment, developments should use a two-step development flow:
- #1. Compile, link, and install HCC. See [Installation](README.md#Installation) notes.
- #2. Relink the target application to include changes in the libhip_hcc.a file.
## Environment Variables
- **HIP_PATH** : Location of HIP include, src, bin, lib directories.
- **HCC_HOME** : Path to HCC compiler. Default /opt/hcc.
- **HSA_PATH** : Path to HSA include, lib. Default /opt/hcc.
- **CUDA_PATH* : On nvcc system, this points to root of CUDA installation.
### Contribution guidelines ###
+3 -2
Προβολή Αρχείου
@@ -6,7 +6,7 @@ Key features include:
* HIP is very thin and has little or no performance impact over coding directly in CUDA or hcc "HC" mode.
* HIP allows coding in a single-source C++ programming language including features such as templates, C++11 lambdas, classes, namespaces, and more.
* HIP allows developers to use the "best" development environment and tools on each target platform.
* The "hipify" script automatically converts source from CUDA to HIP.
* The "hipify" tool automatically converts source from CUDA to HIP.
* Developers can specialize for the platform (CUDA or hcc) to tune for performance or handle tricky cases
New projects can be developed directly in the portable HIP C++ language and can run on either NVIDIA or AMD platforms. Additionally, HIP provides porting tools which make it easy to port existing CUDA codes to the HIP layer, with no loss of performance as compared to the original CUDA application. HIP is not intended to be a drop-in replacement for CUDA, and developers should expect to do some manual coding and performance tuning work to complete the port.
@@ -19,7 +19,7 @@ cmake ..
make
sudo make install
```
Make sure HIP_PATH is pointed to `/opt/hip` and PATH to `/opt/hip/bin`
Make sure HIP_PATH is pointed to `/opt/hip` and PATH includes `$HIP_PATH/bin`
## More Info:
- [HIP FAQ](docs/markdown/hip_faq.md)
@@ -27,6 +27,7 @@ Make sure HIP_PATH is pointed to `/opt/hip` and PATH to `/opt/hip/bin`
- [HIP Runtime API (Doxygen)](http://gpuopen-professionalcompute-tools.github.io/HIP)
- [HIP Porting Guide](docs/markdown/hip_porting_guide.md)
- [HIP Terminology](docs/markdown/hip_terms.md) (including Rosetta Stone of GPU computing terms across CUDA/HIP/HC/AMP/OpenL)
- [Developer/CONTRIBUTING Info](CONTRIBUTING.md)
- [Release Notes](RELEASE.md)
+3 -6
Προβολή Αρχείου
@@ -26,7 +26,7 @@ exit(-1);
$verbose = $ENV{'HIPCC_VERBOSE'};
$verbose = 0 unless defined $verbose;
# Verbose: 0x1=commands, 0x2=paths, 0x4=hippc args, 0x8=force remake hip_hcc.o, 16=remake hip_hcc in debug.
# Verbose: 0x1=commands, 0x2=paths, 0x4=hippc args
$HIP_PATH=$ENV{'HIP_PATH'};
$HIP_PATH=dirname (dirname $0) unless defined $HIP_PATH; # use parent directory of hipcc
@@ -176,12 +176,9 @@ if ($hasCU and $HIP_PLATFORM eq 'hcc') {
$HIPCXXFLAGS .= " -x c++";
}
if (($verbose & 0x18) and ($HIP_PLATFORM eq 'hcc')) {
$needHipHcc = 1;
}
if ($needHipHcc) {
$HIPLDFLAGS .= " -L/opt/hip/lib -lhip_hcc" ;
#$HIPLDFLAGS .= " -L/opt/hip/lib -lhip_hcc" ;
$HIPLDFLAGS .= " -L$HIP_PATH/lib -lhip_hcc" ;
}
# hipcc currrently requires separate compilation of source files, ie it is not possible to pass
+16 -15
Προβολή Αρχείου
@@ -1,6 +1,9 @@
Tests uses CMAKE as teh build infrastructure.
# HIP testing environment.
Use :
This document explains how to use the HIP CMAKE testing environment.
### Quickstart
Usage :
```
$ mkdir build
$ cd build
@@ -9,31 +12,29 @@ $ make
$ make test
```
#-----
### How to add a new test
edit src/CMakeFiles to add the test:
The tests/src/hipMemtest.cpp file contains a simple unit test and is a good starting point for other tests.
Copy this to a new test name and modify tests/src/CMakefiles.txt to add the test to the build environment.
### add the executable and list of required CPP files, ie:
#### Edit CMakefiles.txt:
// Example:
```
make_test (EXE CPP_FILES)
make_hip_executable (hipMemset hipMemset.cpp)
```
### Add to automated Test framework:
```
make_test (TESTNAME ARGS)
make_hip_executable (hipMemset hipMemset.cpp)
make_test(hipMemset " ")
```
### Running tests:
```
make test
ctest
```
# Run a specific test:
### Run subsets of all tests:
```
# Run one test on the commandline (obtain commandline parms from CMakefiles.tst)
./hipMemset
# Run all the memory tests:
ctest -R Memcpy
```