Commit Graph

117 Commits

Author SHA1 Message Date
Maneesh Gupta f06408fa54 [build] Add clangformat target to cmake
- Added a new target "clangformat" which formats the code using the
  clang-format tool found in HCC package.
- Renamed target "static_check" to "cppcheck".
- Use find_program() macro to make the build system more robust.

Change-Id: Ifefbf36f23ff7ef27a870120d5b9170d0cc8aa52


[ROCm/clr commit: 6ef0c494d1]
2018-02-12 10:21:27 +05:30
Maneesh Gupta b75f3d6449 [cmake] Added target static_check for static code analysis
- Added static code analysis using cppcheck
- Fixed couple of warnings reported by cppcheck

Change-Id: Ie3b9b06e95ada322e7dc2ce3d6b91831e870198d


[ROCm/clr commit: 379cbfedcf]
2017-12-14 12:16:44 +05:30
Alex Voicu b59b227151 Add omitted changes in CMakeLists.txt.
[ROCm/clr commit: bdd2d6d602]
2017-11-10 01:20:50 +00:00
Chris Kitching 8f59de9d2b Use cmake's builtin mechanism for handling library locations
See [the documentation](https://cmake.org/cmake/help/v3.0/command/find_package.html)
for exactly how the search procedure works. If you want to use an
LLVM from a specific location, use CMAKE_PREFIX_PATH as normal.

No longer do we have a nonstandard HIPIFY_CLANG_LLVM_DIR variable
for people to learn about.


[ROCm/clr commit: de8dcf0ed2]
2017-10-27 19:39:40 +01:00
Chris Kitching 39b280d948 Use add_dependencies to avoid duplication of pkg_hip_base
[ROCm/clr commit: 414a473d5c]
2017-10-27 19:39:40 +01:00
Chris Kitching e7ae31f2ac Make BUILD_HIPIFY_CLANG a cmake option
Instead of deciding whether to build hipify-clang based on
the presence of an LLVM path on the command line, have an
explicit option.

Do we want this default-on or default-off? I've defaulted it to
on for now, but maybe we want the opposite?


[ROCm/clr commit: 497a776f6c]
2017-10-27 19:39:39 +01:00
Ben Sander a5b3f825c2 Merge pull request #100 from weixingzhang/texture
HIP Texture Support

[ROCm/clr commit: 702651fc85]
2017-07-26 19:28:15 -05:00
Maneesh Gupta 013f6cd0cc [cmake] No longer rebuild cmake cache on each build
Cmake cache was being rebuilt on each build. This was being done
to update HIP_VERSION, HCC_VERSION, .hipInfo and .hipVersion.
However, rebuilding cache also re-runs HIT parser which is slow.
Removing the cache rebuild should speed up the build. But user
needs to explicitly rebuild the cache in case HIP_VERSION or
HCC_VERSION changes by calling "make rebuild_cache"

Change-Id: Ia5476eb7105aa614239c4dc7968c37f5e6cb0b29


[ROCm/clr commit: 1b5d19ff36]
2017-07-26 13:51:32 +05:30
Weixing Zhang d9abb032f7 HIP Texture Support
[ROCm/clr commit: ccbd3b13fc]
2017-07-17 15:16:12 -04:00
Ben Sander 57733404c1 Add hipdbPrintMem - wrapper for hcc memory tracker.
[ROCm/clr commit: 18660be8ce]
2017-07-03 15:05:30 -05:00
Maneesh Gupta 0d555fa3f4 [build] link libCXActivityLogger.so when COMPILE_HIP_ATP_MARKER=1
Change-Id: I0bfffd924cd858bec7436acf3ccb1e3375172f27


[ROCm/clr commit: bb928ee8ec]
2017-06-28 10:26:04 +05:30
Maneesh Gupta 2235d9014e Do not rebuild cmake cache by default
Change-Id: Ie21e99beaa3465b54b5a6a77439c455f34de98b3


[ROCm/clr commit: b3b1ba1e5d]
2017-04-13 12:38:38 +05:30
Maneesh Gupta 3e7f31f570 dtests should ignore HIP_PATH env var
Change-Id: I27b1cdab6e6b799987dad3ce97b56c764b1b8867


[ROCm/clr commit: 6db8c7c69e]
2017-04-13 12:12:04 +05:30
Sun, Peng f202567d83 Disable LLVM related config in CMakeLists.txt
Change-Id: I02e52264219d68c1ae8ea37c8df166a0edf9f7cd


[ROCm/clr commit: b91a37c78a]
2017-04-01 15:01:00 -05:00
Sun, Peng 5a4ac0929f GGL update, fix for thread-safe access to streams (accelerator_views).
Change-Id: I6dd329a85b3ba7de23d52823febee0c53857a981


[ROCm/clr commit: df4cee1a57]
2017-04-01 14:50:39 -05:00
Aditya Atluri c3f1a37c28 Re-enabled metadata parsing in HIP
Change-Id: If8caa844571cb8581450df9ffdb76e2445c75f13


[ROCm/clr commit: abf369049b]
2017-03-27 11:00:39 -05:00
Maneesh Gupta 28427bdbea Revert "Mark hcc_LIBRARIES as PRIVATE"
This reverts commit a47a674e37.


[ROCm/clr commit: 84cb55da9b]
2017-03-23 22:02:52 +05:30
Aditya Atluri 478eb4e350 removed llvm dependency and metadata functionality
Change-Id: Ib9783b75d326559ed29c5aa2218aed40d20ad0fb


[ROCm/clr commit: 5a0685c137]
2017-03-23 10:16:37 -05:00
Maneesh Gupta a47a674e37 Mark hcc_LIBRARIES as PRIVATE
Change-Id: Ia0f8f12148b69c9de78378d117e3561ce20cd827


[ROCm/clr commit: 89623f748d]
2017-03-23 16:25:53 +05:30
Aditya Atluri fa70da22ed fixed paths to find llvm
Change-Id: I0a4af8cea2f44fea011d09fc300e382984746d17


[ROCm/clr commit: a19bce16e4]
2017-03-21 14:22:49 -05:00
Aditya Atluri b4b87b8786 Added default module launch api functionality
1. As in hipModuleLaunchKernel(..., kernelParams, nullptr); works with this commit
    2. Added headers AMDGPUPTNote.h, AMDGPURuntimeMetadata.h to do code object meta data parsing
    3. Changed CMake to look at llvm link libraries
    4. HIP developer should set env variable LLVM_HOME to remove link errors
    5. HIP depends on installed LLVM (not source, not build)
    6. Added sample to test out the feature
    7. Right now HCC does not support embedding metadata in code object. Use clang opencl
    8. Changed HIPCC to read LLVM_HOME env var
    9. New argument to CMake should be given -DLLVM_HOME=<where llvm 5.0 is installed>

Change-Id: Iba38194aa872d97cc2c90a8e5ff746c48055c868


[ROCm/clr commit: 9645b0e0dc]
2017-03-17 13:11:34 -05:00
Maneesh Gupta 5cf4c4e440 Add gfx900 support
Change-Id: I3be2fbdcb6d3fa776c4fe668586c67245a1323f2


[ROCm/clr commit: 1b92ae9917]
2017-03-14 13:51:38 +05:30
Rahul Garg d410e0f9ca Removed hsakmt headers
Change-Id: I4ffc95d5823489195ebc5638226b49ea2995f603


[ROCm/clr commit: 158cb58c36]
2017-03-06 22:37:05 +05:30
Siu Chi Chan 02abf38a75 fix hcc version string extraction
Change-Id: Ie209b6deae55c779a577aaccb1bc21f969f69e14


[ROCm/clr commit: bb5df5b6c9]
2017-03-06 15:33:43 +05:30
Maneesh Gupta 1f6639bacc CMakeLists: Create test targets only if HIP install location is writable
Change-Id: I79f28884b0f117f2824ca8877c25b586bce62e5b


[ROCm/clr commit: 5df7b775f6]
2017-03-06 15:32:21 +05:30
Maneesh Gupta 045c76a97d directed tests no longer run in an subdirectory
- target "make test" will no longer build and run tests. It will only run the tests.
- added new target "make check" which will build and run the tests.
- target "make check" will build tests serially. Use -j<N> to build tests in parallel.

Change-Id: I24c7932bf9798364a59f44631fbabcf9a5da5e17


[ROCm/clr commit: fe01dd74a2]
2017-02-27 13:14:08 +05:30
Maneesh Gupta affb657bca Fix export interfaces in hip-config.cmake
Change-Id: Ifad4661ab17d7e6edb6ab300f1e92552ed917950


[ROCm/clr commit: d193187601]
2017-02-23 11:18:06 +05:30
Siu Chi Chan 652f3e01bb Squashed commit of the following:
commit 931d3de6c1c903cfd47842bc5026a9294ac492b4
Author: Siu Chi Chan <siuchi.chan@amd.com>
Date:   Mon Feb 13 10:54:06 2017 -0500

    only force to libstdc++ if the g++ is older than version 5 since hcc already defaults to libstdc++ with newer g++

commit 1ef8d71aa788de7b9eead4906fe56186f06d7d3f
Author: scchan <siuchi.chan@amd.com>
Date:   Sun Feb 12 14:44:11 2017 -0500

    remove hardcoded -lc++ in tests

commit 5d99ef338eb3a66523cc9ddd139e86c6fd707b9c
Author: scchan <siuchi.chan@amd.com>
Date:   Sun Feb 12 14:35:46 2017 -0500

    force include libstdc++ headers and stdc++ only if g++ version < 5 since hcc uses libstdc++ by default if g++ > 5 is present

commit a2bc21b24d100feefe91cd3cb2271238bda0738a
Author: scchan <siuchi.chan@amd.com>
Date:   Fri Feb 10 04:36:27 2017 -0500

    use hcc-config to generate compiler and linker flags

Change-Id: I13a79629c0adfd75439a47d0488ff4fd619c55ba
(cherry picked from commit 866e744e40cf1378af8a679b54959bf5226c340f)


[ROCm/clr commit: ca8045e6e4]
2017-02-16 13:12:32 +05:30
Maneesh Gupta c7b52142ae Generate package config for cmake
Change-Id: I73a0b21361bbe29e095dc515bdc70588ec722d57


[ROCm/clr commit: 57f7f4660a]
2017-02-13 16:01:50 +05:30
Paul 7476e0bfb5 Set hip version correctly
[ROCm/clr commit: f1f01ceb63]
2017-02-13 15:57:10 +05:30
Maneesh Gupta ab2942538d Build libhip_hcc.so as a fat binary
Change-Id: Ie4f334d8f9576edf5df0f917f72083d7842eb193


[ROCm/clr commit: 3967ece8dd]
2017-02-10 10:32:04 +05:30
Aditya Atluri 14dcdff8f4 Fixed Hawaii link issues
1. Split hip_ir.ll to hip_hc.ll and hip_hc_gfx803.ll
 a. hip_hc.ll contains arch generic ir implementations
 b. hip_hc_gfx803.ll contains gfx803 (fiji, polaris) specific ir
2. HIPCC can now parse --amdgpu-target=*.
 a. Usage: hipcc --amdgpu-target=gfx803 --amdgpu-target=gfx701
 b. TODO: Convert to --amdgpu-target=gfx803,gfx701
3. With LLC in HCC able to generate native f16 isa, removed inline half asm math ops
4. Fixed threadfence and threadfence_block to use functions in rocdl

Change-Id: Ic9a9e3e04139b0d75d2c2a263c030ca77adc1019


[ROCm/clr commit: 60ec83c683]
2017-02-08 12:04:05 -06:00
Ben Sander a55362f753 Move core env var processing to env.cpp
[ROCm/clr commit: bc809460f5]
2017-01-23 22:34:41 -06:00
Aditya Atluri 42c627fbe8 Moved device code to mimic cuda header behavior
1. All fp32, fp64 math device/host functions should be in math_functions.h/.cpp
2. All fp32, fp64 fast math intrinsics for device/host functions should be in device_functions.h/.cpp
3. All the device code implementations should be in device_util.h/.cpp
4. Hence, made changes appropriately by moving code and creating new header files
5. Added math_functions.cpp/.h
6. Changed #ifndef signature to make sure no conflicts between headers with same names in hip/hip_runtime.h and hip/hcc_detail/hip_runtime.h
7. Changed tests to fit the code changes, making them to include appropriate headers
8. Added math_functions.cpp to CMakeLists.txt
9. Some of the tests are still broken, mostly host math functions will fix them in next commit
10. TODO: FIX compilation issues for host math functions

Change-Id: I7a17637d7e294a7d224ffba932c1a08668febd26


[ROCm/clr commit: d23b6b8694]
2017-01-17 14:57:51 -06:00
scchan e53542301a [cmake] add library dependencies to hip_hcc libraries
[ROCm/clr commit: d71ac5c91a]
2017-01-05 18:26:54 -05:00
Maneesh Gupta 861429a560 hip_hcc package changes
- updated hip_hcc package creation dependencies
- support build hip_hcc package for HCC-1.0

Change-Id: Idf23e415eff8cb352a8906191c79bd822c7618e7


[ROCm/clr commit: 1b50462ce0]
2016-12-22 15:30:38 +05:30
Aditya Atluri 9691299b0d added few type reinterpret cast device functions
1. __int_as_float
2. __hiloint2double

Change-Id: Id247c196887b24a12090f0521bf91e13afeec733


[ROCm/clr commit: 7a712aa76b]
2016-12-13 14:41:36 -06:00
Maneesh Gupta 5e38114363 Improve shared and static library support
hipcc accepts new parameter -use-staticlib and -use-sharedlib to
control linking behavior. Default is still static library.

Change-Id: I28fb9a939f8177c75abefd8b77d8118a6666d1f4


[ROCm/clr commit: fd8b1c7d41]
2016-12-01 15:33:12 +05:30
Maneesh Gupta b13556367d Refactor for building HIP as dynamic library
Change-Id: I65a3d9d589c4fdbbdcf1611e5427224253be8260


[ROCm/clr commit: 2195e3c37d]
2016-11-18 14:33:20 +05:30
scchan 782c7fca8b Add extra linker flags to the shared library build
Change-Id: I19e569d566fb5e25e343e364a3053a3f12659361


[ROCm/clr commit: 04049feaf4]
2016-11-18 14:18:29 +05:30
pensun dd1061b874 Add direct test case for threadfence_system workaround
Change-Id: I5b21b590e957c901044741ac94e816cd8b1426f9


[ROCm/clr commit: 992f94b3a1]
2016-11-11 15:09:43 -06:00
Maneesh Gupta df096e871e CMakeLists.txt: Cascade CMAKE_BUILD_TYPE to tests
Change-Id: I53a3ea951c1fd57e43a02381a457c1dedc1a34f7


[ROCm/clr commit: cdcf04d744]
2016-11-10 21:26:34 +05:30
pensun daf19a2dbb resolve conflicts for git pull
Change-Id: Ie353b831e2241bc28042069b6cc7405257e871e1


[ROCm/clr commit: bbb619c732]
2016-11-09 21:38:43 -06:00
Maneesh Gupta 04eb05f1a0 CMakeLists.txt: Update include paths needed for Fedora support
Change-Id: Ib84f9dba30d2c64f344d6f8e85ddbe15f30af1a0


[ROCm/clr commit: 1f08f2adaf]
2016-10-28 14:12:53 +05:30
Maneesh Gupta d69342946b Update packaging scripts to handle updated HCC package versioning
Change-Id: Id93267b7cf9fd05e60004cc6c45b5fc7d10b3130


[ROCm/clr commit: 5d710c8802]
2016-10-17 12:48:05 +05:30
Maneesh Gupta 561719b913 .buildInfo -> .hipInfo & .version -> .hipVersion
Change-Id: I8023f4349621fd81c58615737b7e897649e0f7ca


[ROCm/clr commit: 7e277ef6e5]
2016-10-11 11:13:41 +05:30
Aditya Atluri df5370763a added threadfence feature for hcc
1. Added feature for __threadfence and __threadfence_block
2. Added feature for using LLVM IR files directly while compilation
3. Added test for threadfence and threadfence_block

Change-Id: Ib7e5d89b4cca1a135952b317e5809cd05b56a3c9


[ROCm/clr commit: 09c9953649]
2016-10-10 15:29:50 -05:00
Maneesh Gupta d38a5a4404 Add packaging steps for hipify-clang
Change-Id: I0ed916d5fcb4fc4734f1d92e686fc053e4680052


[ROCm/clr commit: 656c1766ea]
2016-10-05 22:34:42 +05:30
Maneesh Gupta ca0322ab2c clang-hipify -> hipify-clang. Also attempt to build it by default
Change-Id: I694e6c772f5347c820d9bd6c9aa61d6d9696911e


[ROCm/clr commit: 11fd56ed5d]
2016-10-05 13:06:22 +05:30
Maneesh Gupta 46feb7dcf2 Move include/* to include/hip/*
Change-Id: I7a7b2839b4df59c7a4c503550f99fdc9e45c0f54


[ROCm/clr commit: bbfc08f419]
2016-10-04 22:17:18 +05:30