From 3a44adf0eda66fcb7dcba213672bcd8d7e0edf07 Mon Sep 17 00:00:00 2001 From: Julia Jiang Date: Mon, 28 Sep 2020 20:13:28 -0400 Subject: [PATCH] SWDEV-249487-remove two HCC related APIs Change-Id: Icf90ece0808643e0c5f0cc00b6644d5171b553d8 [ROCm/hip commit: c2a3d19acbf398a3df3c697b4d692f3135e866a8] --- projects/hip/include/hip/hcc_detail/hip_db.h | 21 ------- .../include/hip/hcc_detail/hip_runtime_api.h | 27 +------- projects/hip/include/hip/hip_ext.h | 36 ----------- projects/hip/rocclr/hip_device.cpp | 16 ----- projects/hip/rocclr/hip_hcc.def.in | 2 - projects/hip/rocclr/hip_hcc.map.in | 2 - projects/hip/src/hip_db.cpp | 5 -- projects/hip/src/hip_hcc.cpp | 35 ----------- projects/hip/tests/src/hipHcc.cpp | 62 ------------------- 9 files changed, 2 insertions(+), 204 deletions(-) delete mode 100644 projects/hip/include/hip/hcc_detail/hip_db.h delete mode 100644 projects/hip/src/hip_db.cpp delete mode 100644 projects/hip/tests/src/hipHcc.cpp diff --git a/projects/hip/include/hip/hcc_detail/hip_db.h b/projects/hip/include/hip/hcc_detail/hip_db.h deleted file mode 100644 index 91ff54d3a1..0000000000 --- a/projects/hip/include/hip/hcc_detail/hip_db.h +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @defgroup HipDb HCC-specific debug facilities - * @{ - */ - - -/** - * @brief * Print memory tracker information for this pointer. - * - * HIP maintains a table for all memory allocations performed by the application. - * If targetAddress is 0, the entire table is printed to stderr. - * If targetAddress is non-null, this routine will perform some forensic analysis - * to find the pointer - */ -void hipdbPrintMem(void* targetAddress); - - -// doxygen end HipDb -/** - * @} - */ diff --git a/projects/hip/include/hip/hcc_detail/hip_runtime_api.h b/projects/hip/include/hip/hcc_detail/hip_runtime_api.h index 74c0fb5f69..e09de31d68 100755 --- a/projects/hip/include/hip/hcc_detail/hip_runtime_api.h +++ b/projects/hip/include/hip/hcc_detail/hip_runtime_api.h @@ -1019,7 +1019,7 @@ hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback * #hipEventDisableTiming : Disable recording of timing information. On ROCM platform, timing information is always recorded and this flag has no performance benefit. - * @warning On HCC platform, hipEventInterprocess support is under development. Use of this flag + * @warning On AMD platform, hipEventInterprocess support is under development. Use of this flag will return an error. * * @returns #hipSuccess, #hipErrorNotInitialized, #hipErrorInvalidValue, @@ -1104,7 +1104,7 @@ hipError_t hipEventDestroy(hipEvent_t event); * * If hipEventRecord() has not been called on @p event, this function returns immediately. * - * TODO-hcc - This function needs to support hipEventBlockingSync parameter. + * TODO-hip- This function needs to support hipEventBlockingSync parameter. * * @param[in] event Event on which to wait. * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorNotInitialized, @@ -4256,29 +4256,6 @@ static inline hipError_t hipUnbindTexture( #pragma GCC visibility pop #endif -/** - *------------------------------------------------------------------------------------------------- - *------------------------------------------------------------------------------------------------- - * @defgroup HCC_Specific HCC-Specific Accessors - * @{ - * - * The following calls are only supported when compiler HIP with HCC. - * To produce portable code, use of these calls must be guarded #ifdef checks: - * @code - * #ifdef __HCC__ - * hc::accelerator acc; - hipError_t err = hipHccGetAccelerator(deviceId, &acc) - * #endif - * @endcode - * - */ - -// end-group HCC_Specific -/** - * @} - */ - - // doxygen end HIP API /** * @} diff --git a/projects/hip/include/hip/hip_ext.h b/projects/hip/include/hip/hip_ext.h index c16e841719..8971a09243 100644 --- a/projects/hip/include/hip/hip_ext.h +++ b/projects/hip/include/hip/hip_ext.h @@ -27,42 +27,6 @@ THE SOFTWARE. #include #include #endif -#ifdef __HCC__ - -// Forward declarations: -namespace hc { -class accelerator; -class accelerator_view; -}; // namespace hc - - -/** - *------------------------------------------------------------------------------------------------- - *------------------------------------------------------------------------------------------------- - * @defgroup HCC-specific features - * @warning These APIs provide access to special features of HCC compiler and are not available - *through the CUDA path. - * @{ - */ - - -/** - * @brief Return hc::accelerator associated with the specified deviceId - * @return #hipSuccess, #hipErrorInvalidDevice - */ -HIP_PUBLIC_API -hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator* acc); - -/** - * @brief Return hc::accelerator_view associated with the specified stream - * - * If stream is 0, the accelerator_view for the default stream is returned. - * @return #hipSuccess - */ -HIP_PUBLIC_API -hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view** av); - -#endif // #ifdef __HCC__ /** * @brief launches kernel f with launch parameters and shared memory on stream with arguments passed diff --git a/projects/hip/rocclr/hip_device.cpp b/projects/hip/rocclr/hip_device.cpp index c0dbc89970..2c8c7f5c66 100644 --- a/projects/hip/rocclr/hip_device.cpp +++ b/projects/hip/rocclr/hip_device.cpp @@ -229,19 +229,3 @@ hipError_t hipGetDeviceProperties ( hipDeviceProp_t* props, hipDevice_t device ) *props = deviceProps; HIP_RETURN(hipSuccess); } - -hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator* acc) { - HIP_INIT_API(hipHccGetAccelerator, deviceId, acc); - - assert(0 && "Unimplemented"); - - HIP_RETURN(hipErrorNotSupported); -} - -hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view** av) { - HIP_INIT_API(hipHccGetAcceleratorView, stream, av); - - assert(0 && "Unimplemented"); - - HIP_RETURN(hipErrorNotSupported); -} diff --git a/projects/hip/rocclr/hip_hcc.def.in b/projects/hip/rocclr/hip_hcc.def.in index a38cbb0fff..cc8cd86e0a 100755 --- a/projects/hip/rocclr/hip_hcc.def.in +++ b/projects/hip/rocclr/hip_hcc.def.in @@ -229,8 +229,6 @@ hipTexRefSetMipmapLevelClamp hipTexRefSetMipmappedArray hipProfilerStart hipProfilerStop -hipHccGetAccelerator -hipHccGetAcceleratorView hipCreateSurfaceObject hipDestroySurfaceObject hipInitActivityCallback diff --git a/projects/hip/rocclr/hip_hcc.map.in b/projects/hip/rocclr/hip_hcc.map.in index c561df11bd..5b5dcf692a 100755 --- a/projects/hip/rocclr/hip_hcc.map.in +++ b/projects/hip/rocclr/hip_hcc.map.in @@ -260,8 +260,6 @@ global: extern "C++" { hip_impl::hipLaunchKernelGGLImpl*; hip_impl::demangle*; - hipHccGetAccelerator*; - hipHccGetAcceleratorView*; hipCreateSurfaceObject*; hipDestroySurfaceObject*; hipHccModuleLaunchKernel*; diff --git a/projects/hip/src/hip_db.cpp b/projects/hip/src/hip_db.cpp deleted file mode 100644 index 798437ba44..0000000000 --- a/projects/hip/src/hip_db.cpp +++ /dev/null @@ -1,5 +0,0 @@ - -#include - - -void hipdbPrintMem(void* targetAddress) { hc::am_memtracker_print(targetAddress); }; diff --git a/projects/hip/src/hip_hcc.cpp b/projects/hip/src/hip_hcc.cpp index ced16739d9..4b8b2ae9fd 100644 --- a/projects/hip/src/hip_hcc.cpp +++ b/projects/hip/src/hip_hcc.cpp @@ -2504,41 +2504,6 @@ hipError_t hipProfilerStop() { return ihipLogStatus(hipSuccess); }; -//------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------- -// HCC-specific accessor functions: - -//--- -hipError_t hipHccGetAccelerator(int deviceId, hc::accelerator* acc) { - HIP_INIT_API(hipHccGetAccelerator, deviceId, acc); - - const ihipDevice_t* device = ihipGetDevice(deviceId); - hipError_t err; - if (device == NULL) { - err = hipErrorInvalidDevice; - } else { - *acc = device->_acc; - err = hipSuccess; - } - return ihipLogStatus(err); -} - - -//--- -hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view** av) { - HIP_INIT_API(hipHccGetAcceleratorView, stream, av); - - if (stream == hipStreamNull) { - ihipCtx_t* device = ihipGetTlsDefaultCtx(); - stream = device->_defaultStream; - } - - *av = stream->locked_getAv(); // TODO - review. - - hipError_t err = hipSuccess; - return ihipLogStatus(err); -} - //// TODO - add identifier numbers for streams and devices to help with debugging. // TODO - add a contect sequence number for debug. Print operator<< ctx:0.1 (device.ctx) diff --git a/projects/hip/tests/src/hipHcc.cpp b/projects/hip/tests/src/hipHcc.cpp deleted file mode 100644 index 9bcc999b34..0000000000 --- a/projects/hip/tests/src/hipHcc.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -// Test the HCC-specific API extensions for HIP: - -/* HIT_START - * BUILD: %t %s EXCLUDE_HIP_PLATFORM nvcc - * TEST: %t EXCLUDE_HIP_PLATFORM all - * HIT_END - */ - -#include -#include -#include "hip/hip_runtime.h" -#include "hip/hip_ext.h" -#include "test_common.h" - -#define CHECK(error) \ - if (error != hipSuccess) { \ - fprintf(stderr, "error: '%s'(%d) at %s:%d\n", hipGetErrorString(error), error, __FILE__, \ - __LINE__); \ - exit(EXIT_FAILURE); \ - } - - -int main(int argc, char* argv[]) { - int deviceId; - CHECK(hipGetDevice(&deviceId)); - hipDeviceProp_t props; - CHECK(hipGetDeviceProperties(&props, deviceId)); - printf("info: running on device #%d %s\n", deviceId, props.name); - -#ifdef __HCC__ - hc::accelerator acc; - CHECK(hipHccGetAccelerator(deviceId, &acc)); - std::wcout << "device_path=" << acc.get_device_path() << "\n"; - - hc::accelerator_view* av; - CHECK(hipHccGetAcceleratorView(0 /*nullStream*/, &av)); -#endif - - - passed(); -};