diff --git a/VERSION b/VERSION index 0db853aa34..ff162666ec 100644 --- a/VERSION +++ b/VERSION @@ -3,4 +3,4 @@ #HIP_VERSION_MINOR 5 #HIP_VERSION_PATCH -0 +30202 diff --git a/bin/hipcc.pl b/bin/hipcc.pl index 431701fb50..2cd3752906 100644 --- a/bin/hipcc.pl +++ b/bin/hipcc.pl @@ -52,15 +52,21 @@ # retrieve --rocm-path hipcc option from command line. # We need to respect this over the env var ROCM_PATH for this compilation. -sub get_rocm_path_option { +sub get_path_options { my $rocm_path=""; + my $hip_path=""; my @CLArgs = @ARGV; foreach $arg (@CLArgs) { if (index($arg,"--rocm-path=") != -1) { ($rocm_path) = $arg=~ /=\s*(.*)\s*$/; + next; + } + if (index($arg,"--hip-path=") != -1) { + ($hip_path) = $arg=~ /=\s*(.*)\s*$/; + next; } } - return $rocm_path; + return ($rocm_path, $hip_path); } $verbose = $ENV{'HIPCC_VERBOSE'} // 0; @@ -99,13 +105,16 @@ sub delete_temp_dirs { } my $base_dir; -my $rocmPath; BEGIN { $base_dir = dirname(Cwd::realpath(__FILE__) ); - $rocmPath = get_rocm_path_option(); - if ($rocmPath ne '') { + my ($rocm_path, $hip_path) = get_path_options(); + if ($rocm_path ne '') { + # --rocm-path takes precedence over ENV{ROCM_PATH} + $ENV{ROCM_PATH}=$rocm_path; + } + if ($hip_path ne '') { # --rocm-path takes precedence over ENV{ROCM_PATH} - $ENV{ROCM_PATH}=$rocmPath; + $ENV{HIP_PATH}=$hip_path; } } use lib "$base_dir/"; @@ -199,10 +208,6 @@ BEGIN print ("HIP_CLANG_RT_LIB=$HIP_CLANG_RT_LIB\n"); } - $HIPLDFLAGS .= " -L\"$HIP_LIB_PATH\""; - if ($isWindows) { - $HIPLDFLAGS .= " -lamdhip64"; - } if ($HIP_CLANG_HCC_COMPAT_MODE) { ## Allow __fp16 as function parameter and return type. $HIPCXXFLAGS .= " -Xclang -fallow-half-arguments-and-returns -D__HIP_HCC_COMPAT_MODE__=1"; @@ -245,8 +250,6 @@ BEGIN my $printLDFlags = 0; # print HIPLDFLAGS my $runCmd = 1; my $buildDeps = 0; -my $linkType = 1; -my $setLinkType = 0; my $hsacoVersion = 0; my $funcSupp = 0; # enable function support my $rdc = 0; # whether -fgpu-rdc is on @@ -361,16 +364,11 @@ BEGIN $compileOnly = 1; $buildDeps = 1; } - if(($trimarg eq '-use-staticlib') and ($setLinkType eq 0)) - { - $linkType = 0; - $setLinkType = 1; - $swallowArg = 1; + if($trimarg eq '-use-staticlib') { + print "Warning: The -use-staticlib option has been deprecated and is no longer needed.\n" } - if(($trimarg eq '-use-sharedlib') and ($setLinkType eq 0)) - { - $linkType = 1; - $setLinkType = 1; + if($trimarg eq '-use-sharedlib') { + print "Warning: The -use-sharedlib option has been deprecated and is no longer needed.\n" } if($arg =~ m/^-O/) { @@ -558,12 +556,6 @@ BEGIN $HIPCXXFLAGS .= " --cuda-host-only"; } -# Add --hip-link only if it is compile only and -fgpu-rdc is on. -if ($rdc and !$compileOnly and $HIP_PLATFORM eq 'amd') { - $HIPLDFLAGS .= " --hip-link"; - $HIPLDFLAGS .= $HIPLDARCHFLAGS; -} - # hipcc currrently requires separate compilation of source files, ie it is not possible to pass # CPP files combined with .O files # Reason is that NVCC uses the file extension to determine whether to compile in CUDA mode or @@ -583,23 +575,28 @@ BEGIN } } + # If the HIP_PATH env var is defined, pass that path to Clang + if ($ENV{'HIP_PATH'}) { + my $hip_path_flag = " --hip-path=\"$HIP_PATH\""; + $HIPCXXFLAGS .= $hip_path_flag; + $HIPLDFLAGS .= $hip_path_flag; + } + if ($hasHIP) { if ($DEVICE_LIB_PATH ne "$ROCM_PATH/amdgcn/bitcode") { $HIPCXXFLAGS .= " --hip-device-lib-path=\"$DEVICE_LIB_PATH\""; } } - if (not $isWindows) { - $HIPLDFLAGS .= " -lgcc_s -lgcc -lpthread -lm -lrt"; - } - if (not $isWindows and not $compileOnly) { - if ($linkType eq 0) { - $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L$ROCM_PATH/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs}; - } else { - $toolArgs = ${toolArgs} . " -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 "; - } + if (!$compileOnly) { + $HIPLDFLAGS .= " --hip-link"; + if ($rdc) { + $HIPLDFLAGS .= $HIPLDARCHFLAGS; + } + if (not $isWindows) { + $HIPLDFLAGS .= " --rtlib=compiler-rt -unwindlib=libgcc"; - $toolArgs .= " -L$HIP_CLANG_RT_LIB -lclang_rt.builtins-x86_64 " + } } } diff --git a/bin/hipvars.pm b/bin/hipvars.pm index bea4ec71ce..94b3bfad96 100644 --- a/bin/hipvars.pm +++ b/bin/hipvars.pm @@ -27,7 +27,7 @@ use File::Basename; $HIP_BASE_VERSION_MAJOR = "5"; $HIP_BASE_VERSION_MINOR = "5"; -$HIP_BASE_VERSION_PATCH = "0"; +$HIP_BASE_VERSION_PATCH = "30202"; #--- # Function to parse config file diff --git a/docs/markdown/hip_build.md b/docs/markdown/hip_build.md index 54d85fa540..4bab7ee8e1 100755 --- a/docs/markdown/hip_build.md +++ b/docs/markdown/hip_build.md @@ -38,15 +38,15 @@ Install Nvidia driver and pre-build packages (see HIP Installation Guide at http ## Branch of repository -Before get HIP source code, set the expected branch of repository at the variable HIP_BRANCH. +Before get HIP source code, set the expected branch of repository at the variable ROCM_BRANCH. For example, for ROCm5.0 release branch, set ``` -export HIP_BRANCH=rocm-5.0.x +export ROCM_BRANCH=rocm-5.0.x ``` -ROCm5.1 release branch, set +ROCm5.4 release branch, set ``` -export HIP_BRANCH=rocm-5.1.x +export ROCM_BRANCH=rocm-5.4.x ``` Similiar format for future branches. @@ -59,9 +59,10 @@ ROCM_PATH is path where ROCM is installed. BY default ROCM_PATH is at /opt/rocm. ## Get HIP source code ``` -git clone -b $HIP_BRANCH https://github.com/ROCm-Developer-Tools/hipamd.git -git clone -b $HIP_BRANCH https://github.com/ROCm-Developer-Tools/hip.git -git clone -b $HIP_BRANCH https://github.com/ROCm-Developer-Tools/ROCclr.git +git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hipamd.git +git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hip.git +git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/ROCclr.git +git clone -b "$ROCM_BRANCH" https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime.git ``` ## Set the environment variables @@ -136,51 +137,54 @@ Please note, the integrated HIP directed tests, will be deprecated in future rel ### Build HIP catch tests -After build and install HIP commands, catch tests can be built via the following instructions, +HIP catch tests, with new architectured Catch2, are official seperated from HIP project, exist in HIP tests repository, can be built via the following instructions. + +#### Get HIP tests source code + +``` +git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hip-tests.git +``` +#### Build HIP tests from source ``` -cd "$HIP_DIR" +export HIP_TESTS_DIR="$(readlink -f hip-tests)" +cd "$HIP_TESTS_DIR" mkdir -p build; cd build -export HIP_PATH=$HIPAMD_DIR/build/install -cmake ../tests/catch/ -DHIP_PLATFORM=amd +export HIP_PATH=$HIPAMD_DIR/build/install (or any path where HIP is installed, for example, /opt/rocm) +cmake ../catch/ -DHIP_PLATFORM=amd make -j$(nproc) build_tests ctest # run tests ``` +HIP catch tests are built under the folder $HIP_TESTS_DIR/build. -HIP catch tests are built under the folder $HIP_DIR/build. - -To run a single catch test, the following is an example, +To run any single catch test, the following is an example, ``` -cd $HIP_DIR/build/unit/texture +cd $HIP_TESTS_DIR/build/catch_tests/unit/texture ./TextureTest ``` -### Build HIP Catch2 standalone test +#### Build HIP Catch2 standalone test HIP Catch2 supports build a standalone test, for example, ``` -export PATH=$HIP_DIR/bin:$PATH -export HIP_PATH=$HIPAMD_DIR/build/install - -hipcc $HIP_DIR/tests/catch/unit/memory/hipPointerGetAttributes.cc -I ./tests/catch/include ./tests/catch/hipTestMain/standalone_main.cc -I ./tests/catch/external/Catch2 -g -o hipPointerGetAttributes +cd "$HIP_TESTS_DIR" +hipcc $HIP_TESTS_DIR/catch/unit/memory/hipPointerGetAttributes.cc -I ./catch/include ./catch/hipTestMain/standalone_main.cc -I ./catch/external/Catch2 -o hipPointerGetAttributes ./hipPointerGetAttributes ... All tests passed ``` -HIP catch tests, especially new architectured Catch2, will be official HIP tests in the repository and can be built alone as with the instructions shown above. - # Build HIP on NVIDIA platform ## Get HIP source code ``` -git clone -b $HIP_BRANCH https://github.com/ROCm-Developer-Tools/hip.git -git clone -b $HIP_BRANCH https://github.com/ROCm-Developer-Tools/hipamd.git +git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hip.git +git clone -b "$ROCM_BRANCH" https://github.com/ROCm-Developer-Tools/hipamd.git ``` ## Set the environment variables diff --git a/docs/markdown/hip_kernel_language.md b/docs/markdown/hip_kernel_language.md index 2b4f7e9cc8..5f8e9f8f95 100644 --- a/docs/markdown/hip_kernel_language.md +++ b/docs/markdown/hip_kernel_language.md @@ -862,8 +862,9 @@ Output Constraints are specified by an `"="` prefix as shown above ("=v"). This ## C++ Support The following C++ features are not supported: - Run-time-type information (RTTI) -- Virtual functions - Try/catch +- Virtual functions +Virtual functions are not supported if objects containing virtual function tables are passed between GPU's of different offload arch's, e.g. between gfx906 and gfx1030. Otherwise virtual functions are supported. ## Kernel Compilation hipcc now supports compiling C++/HIP kernels to binary code objects. diff --git a/docs/markdown/hip_programming_guide.md b/docs/markdown/hip_programming_guide.md index 507a72c502..80b50b96e5 100644 --- a/docs/markdown/hip_programming_guide.md +++ b/docs/markdown/hip_programming_guide.md @@ -108,9 +108,9 @@ A stronger system-level fence can be specified when the event is created with hi - HIP/ROCm also supports the ability to cache host memory in the GPU using the "Non-Coherent" host memory allocations. This can provide performance benefit, but care must be taken to use the correct synchronization. ## Direct Dispatch -HIP runtime has Direct Dispatch enabled by default in ROCM 4.4. With this feature we move away from our conventional producer-consumer model where the runtime creates a worker thread(consumer) for each HIP Stream, where as the host thread(producer) enqueues commands to a command queue(per stream). +HIP runtime has Direct Dispatch enabled by default in ROCM 4.4. With this feature we move away from our conventional producer-consumer model where the runtime creates a worker thread(consumer) for each HIP Stream, and the host thread(producer) enqueues commands to a command queue(per stream). -For Direct Dispatch, the runtime would directly queue a packet to the AQL queue (user mode queue to GPU) in case of Dispatch and some of the synchronization. This has shown to the total latency of the HIP Dispatch API and latency to launch first wave on the GPU. +For Direct Dispatch, HIP runtime would directly enqueue a packet to the AQL queue (user mode queue on GPU) on the Dispatch API call from the application. That has shown to reduce the latency to launch the first wave on the idle GPU and total time of tiny dispatches synchronized with the host. In addition, eliminating the threads in runtime has reduced the variance in the dispatch numbers as the thread scheduling delays and atomics/locks synchronization latencies are reduced. diff --git a/hip-lang-config.cmake.in b/hip-lang-config.cmake.in index 46050ca1bd..cee1b0e76b 100644 --- a/hip-lang-config.cmake.in +++ b/hip-lang-config.cmake.in @@ -72,23 +72,6 @@ get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" REALPATH) get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../../" ABSOLUTE) -#If HIP isnot installed under ROCm, need this to find HSA assuming HSA is under ROCm -if( DEFINED ENV{ROCM_PATH} ) - set(ROCM_PATH "$ENV{ROCM_PATH}") -endif() - -#if HSA is not under ROCm then provide CMAKE_PREFIX_PATH= -find_path(HSA_HEADER hsa/hsa.h - PATHS - "${_IMPORT_PREFIX}/include" - "${ROCM_PATH}/include" -) - -if (NOT HSA_HEADER) - message (FATAL_ERROR "HSA header not found! ROCM_PATH environment not set") -endif() - - set_target_properties(hip-lang::device PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "$<$:${_IMPORT_PREFIX}/include>" INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<$:${_IMPORT_PREFIX}/include>" @@ -96,8 +79,8 @@ set_target_properties(hip-lang::device PROPERTIES set_target_properties(hip-lang::amdhip64 PROPERTIES INTERFACE_COMPILE_DEFINITIONS "$<$:__HIP_ROCclr__=1>" - INTERFACE_INCLUDE_DIRECTORIES "$<$:${_IMPORT_PREFIX}/include;${HSA_HEADER}>" - INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<$:${_IMPORT_PREFIX}/include;${HSA_HEADER}>" + INTERFACE_INCLUDE_DIRECTORIES "$<$:${_IMPORT_PREFIX}/include>" + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "$<$:${_IMPORT_PREFIX}/include>" ) set_target_properties(hip-lang::device PROPERTIES INTERFACE_COMPILE_DEFINITIONS "$<$:__HIP_ROCclr__=1>" diff --git a/include/hip/hip_gl_interop.h b/include/hip/hip_gl_interop.h new file mode 100644 index 0000000000..207beea3df --- /dev/null +++ b/include/hip/hip_gl_interop.h @@ -0,0 +1,30 @@ +/* +Copyright (c) 2023 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. +*/ +#ifndef HIP_GL_INTEROP_H +#define HIP_GL_INTEROP_H + +#include + +#if !(defined(__HIP_PLATFORM_HCC__) || defined(__HIP_PLATFORM_AMD__)) && (defined(__HIP_PLATFORM_NVCC__) || defined(__HIP_PLATFORM_NVIDIA__)) +#include "hip/nvidia_detail/nvidia_hip_gl_interop.h" +#endif +#endif \ No newline at end of file diff --git a/include/hip/hip_runtime_api.h b/include/hip/hip_runtime_api.h index e8f82ed937..62366a1b91 100644 --- a/include/hip/hip_runtime_api.h +++ b/include/hip/hip_runtime_api.h @@ -1396,7 +1396,7 @@ hipError_t hipInit(unsigned int flags); /** * @brief Returns the approximate HIP driver version. * - * @param [out] driverVersion + * @param [out] driverVersion driver version * * @returns #hipSuccess, #hipErrorInvalidValue * @@ -1412,7 +1412,7 @@ hipError_t hipDriverGetVersion(int* driverVersion); /** * @brief Returns the approximate HIP Runtime version. * - * @param [out] runtimeVersion + * @param [out] runtimeVersion HIP runtime version * * @returns #hipSuccess, #hipErrorInvalidValue * @@ -1426,8 +1426,8 @@ hipError_t hipDriverGetVersion(int* driverVersion); hipError_t hipRuntimeGetVersion(int* runtimeVersion); /** * @brief Returns a handle to a compute device - * @param [out] device - * @param [in] ordinal + * @param [out] device Handle of device + * @param [in] ordinal Device ordinal * * @returns #hipSuccess, #hipErrorInvalidDevice */ @@ -1435,26 +1435,26 @@ hipError_t hipDeviceGet(hipDevice_t* device, int ordinal); /** * @brief Returns the compute capability of the device - * @param [out] major - * @param [out] minor - * @param [in] device + * @param [out] major Major compute capability version number + * @param [out] minor Minor compute capability version number + * @param [in] device Device ordinal * * @returns #hipSuccess, #hipErrorInvalidDevice */ hipError_t hipDeviceComputeCapability(int* major, int* minor, hipDevice_t device); /** * @brief Returns an identifer string for the device. - * @param [out] name - * @param [in] len - * @param [in] device + * @param [out] name String of the device name + * @param [in] len Maximum length of string to store in device name + * @param [in] device Device ordinal * * @returns #hipSuccess, #hipErrorInvalidDevice */ hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device); /** * @brief Returns an UUID for the device.[BETA] - * @param [out] uuid - * @param [in] device + * @param [out] uuid UUID for the device + * @param [in] device device ordinal * * @beta This API is marked as beta, meaning, while this is feature complete, * it is still open to changes and may have outstanding issues. @@ -1464,11 +1464,11 @@ hipError_t hipDeviceGetName(char* name, int len, hipDevice_t device); */ hipError_t hipDeviceGetUuid(hipUUID* uuid, hipDevice_t device); /** - * @brief Returns a value for attr of link between two devices - * @param [out] value - * @param [in] attr - * @param [in] srcDevice - * @param [in] dstDevice + * @brief Returns a value for attribute of link between two devices + * @param [out] value Pointer of the value for the attrubute + * @param [in] attr enum of hipDeviceP2PAttr to query + * @param [in] srcDevice The source device of the link + * @param [in] dstDevice The destination device of the link * * @returns #hipSuccess, #hipErrorInvalidDevice */ @@ -1476,25 +1476,25 @@ hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr, int srcDevice, int dstDevice); /** * @brief Returns a PCI Bus Id string for the device, overloaded to take int device ID. - * @param [out] pciBusId - * @param [in] len - * @param [in] device + * @param [out] pciBusId The string of PCI Bus Id format for the device + * @param [in] len Maximum length of string + * @param [in] device The device ordinal * * @returns #hipSuccess, #hipErrorInvalidDevice */ hipError_t hipDeviceGetPCIBusId(char* pciBusId, int len, int device); /** * @brief Returns a handle to a compute device. - * @param [out] device handle - * @param [in] PCI Bus ID + * @param [out] device The handle of the device + * @param [in] PCI The string of PCI Bus Id for the device * * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue */ hipError_t hipDeviceGetByPCIBusId(int* device, const char* pciBusId); /** * @brief Returns the total amount of memory on the device. - * @param [out] bytes - * @param [in] device + * @param [out] bytes The size of memory in bytes, on the device + * @param [in] device The ordinal of the device * * @returns #hipSuccess, #hipErrorInvalidDevice */ @@ -1674,7 +1674,7 @@ hipError_t hipGetDeviceProperties(hipDeviceProp_t* prop, int deviceId); /** * @brief Set L1/Shared cache partition. * - * @param [in] cacheConfig + * @param [in] cacheConfig Cache configuration * * @returns #hipSuccess, #hipErrorNotInitialized, #hipErrorNotSupported * @@ -1686,7 +1686,7 @@ hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig); /** * @brief Get Cache configuration for a specific Device * - * @param [out] cacheConfig + * @param [out] cacheConfig Pointer of cache configuration * * @returns #hipSuccess, #hipErrorNotInitialized * Note: AMD devices do not support reconfigurable cache. This hint is ignored @@ -1695,21 +1695,25 @@ hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig); */ hipError_t hipDeviceGetCacheConfig(hipFuncCache_t* cacheConfig); /** - * @brief Get Resource limits of current device + * @brief Gets resource limits of current device + * The funtion querys the size of limit value, as required input enum hipLimit_t, can be either + * hipLimitStackSize, or hipLimitMallocHeapSize. * - * @param [out] pValue - * @param [in] limit + * @param [out] pValue returns the size of the limit in bytes + * @param [in] limit the limit to query * * @returns #hipSuccess, #hipErrorUnsupportedLimit, #hipErrorInvalidValue - * Note: Currently, only hipLimitMallocHeapSize is available * */ hipError_t hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit); /** - * @brief Set Resource limits of current device - * - * @param [in] limit - * @param [in] value + * @brief Sets resource limits of current device + * As the input enum limit, hipLimitStackSize sets the limit value of the stack size on current + * GPU devie, hipLimitMallocHeapSize sets the limit value of the heap used by the malloc()/free() + * calls. + * + * @param [in] limit enum of hipLimit_t to set + * @param [in] value the size of limit value in bytes * * @returns #hipSuccess, #hipErrorUnsupportedLimit, #hipErrorInvalidValue * @@ -1718,7 +1722,7 @@ hipError_t hipDeviceSetLimit ( enum hipLimit_t limit, size_t value ); /** * @brief Returns bank width of shared memory for current device * - * @param [out] pConfig + * @param [out] pConfig The pointer of the bank width for shared memory * * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorNotInitialized * @@ -1730,7 +1734,7 @@ hipError_t hipDeviceGetSharedMemConfig(hipSharedMemConfig* pConfig); /** * @brief Gets the flags set for current device * - * @param [out] flags + * @param [out] flags Pointer of the flags * * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue */ @@ -1738,7 +1742,7 @@ hipError_t hipGetDeviceFlags(unsigned int* flags); /** * @brief The bank width of shared memory on current device is set * - * @param [in] config + * @param [in] config Configuration for the bank width of shared memory * * @returns #hipSuccess, #hipErrorInvalidValue, #hipErrorNotInitialized * @@ -1750,7 +1754,7 @@ hipError_t hipDeviceSetSharedMemConfig(hipSharedMemConfig config); /** * @brief The current device behavior is changed according the flags passed. * - * @param [in] flags + * @param [in] flags Flag to set on the current device * * The schedule flags impact how HIP waits for the completion of a command running on a device. * hipDeviceScheduleSpin : HIP runtime will actively spin in the thread which submitted the @@ -1775,8 +1779,8 @@ hipError_t hipSetDeviceFlags(unsigned flags); /** * @brief Device which matches hipDeviceProp_t is returned * - * @param [out] device ID - * @param [in] device properties pointer + * @param [out] device Pointer of the device + * @param [in] prop Pointer of the properties * * @returns #hipSuccess, #hipErrorInvalidValue */ @@ -1926,9 +1930,9 @@ hipError_t hipIpcOpenEventHandle(hipEvent_t* event, hipIpcEventHandle_t handle); /** * @brief Set attribute for a specific function * - * @param [in] func; - * @param [in] attr; - * @param [in] value; + * @param [in] func Pointer of the function + * @param [in] attr Attribute to set + * @param [in] value Value to set * * @returns #hipSuccess, #hipErrorInvalidDeviceFunction, #hipErrorInvalidValue * @@ -1940,7 +1944,7 @@ hipError_t hipFuncSetAttribute(const void* func, hipFuncAttribute attr, int valu /** * @brief Set Cache configuration for a specific function * - * @param [in] config; + * @param [in] config Configuration to set * * @returns #hipSuccess, #hipErrorNotInitialized * Note: AMD devices and some Nvidia GPUS do not support reconfigurable cache. This hint is ignored @@ -1951,8 +1955,8 @@ hipError_t hipFuncSetCacheConfig(const void* func, hipFuncCache_t config); /** * @brief Set shared memory configuation for a specific function * - * @param [in] func - * @param [in] config + * @param [in] func Pointer of the function + * @param [in] config Configuration * * @returns #hipSuccess, #hipErrorInvalidDeviceFunction, #hipErrorInvalidValue * @@ -2116,8 +2120,7 @@ hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPrio /** * @brief Destroys the specified stream. * - * @param[in, out] stream Valid pointer to hipStream_t. This function writes the memory with the - * newly created stream. + * @param[in] stream stream identifier. * @return #hipSuccess #hipErrorInvalidHandle * * Destroys the specified stream. @@ -2581,12 +2584,16 @@ hipError_t hipEventQuery(hipEvent_t event); hipError_t hipPointerSetAttribute(const void* value, hipPointer_attribute attribute, hipDeviceptr_t ptr); + /** * @brief Return attributes for the specified pointer * * @param [out] attributes attributes for the specified pointer * @param [in] ptr pointer to get attributes for * + * Note: To get pointer's memory type, the parameter attributes has 'type' as member variable. + * The 'type' indicates input pointer is allocated on device or host. + * * @return #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue * * @see hipPointerGetAttribute @@ -2773,10 +2780,11 @@ hipError_t hipMemAllocHost(void** ptr, size_t size); * @brief Allocate device accessible page locked host memory * * @param[out] ptr Pointer to the allocated host pinned memory - * @param[in] size Requested memory size + * @param[in] size Requested memory size in bytes * @param[in] flags Type of host memory allocation * * If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned. + * If no input for flags, it will be the default pinned memory allocation on the host. * * @return #hipSuccess, #hipErrorOutOfMemory * @@ -3291,7 +3299,7 @@ hipError_t hipMemPoolImportPointer( * @brief Allocate device accessible page locked host memory [Deprecated] * * @param[out] ptr Pointer to the allocated host pinned memory - * @param[in] size Requested memory size + * @param[in] size Requested memory size in bytes * @param[in] flags Type of host memory allocation * * If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned. @@ -3810,7 +3818,7 @@ hipError_t hipMemsetD32(hipDeviceptr_t dest, int value, size_t count); * @brief Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant * byte value value. * - * hipMemsetAsync() is asynchronous with respect to the host, so the call may return before the + * hipMemsetAsync() is asynchronous with respect to the host, so the call may return before the * memset is complete. The operation can optionally be associated to a stream by passing a non-zero * stream argument. If stream is non-zero, the operation may overlap with operations in other * streams. @@ -3883,14 +3891,22 @@ hipError_t hipMemset3D(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent hipError_t hipMemset3DAsync(hipPitchedPtr pitchedDevPtr, int value, hipExtent extent ,hipStream_t stream __dparm(0)); /** * @brief Query memory info. - * Return snapshot of free memory, and total allocatable memory on the device. * - * Returns in *free a snapshot of the current free memory. - * @returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue - * @warning On HCC, the free memory only accounts for memory allocated by this process and may be - *optimistic. + * On ROCM, this function gets the actual free memory left on the current device, so supports + * the cases while running multi-workload (such as multiple processes, multiple threads, and + * multiple GPUs). + * + * @warning On Windows, the free memory only accounts for memory allocated by this process and may + * be optimistic. + * + * @param[out] free returns free memory on the current device in bytes + * @param[out] total returns total allocatable memory on the current device in bytes + * + * @return #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue + * **/ hipError_t hipMemGetInfo(size_t* free, size_t* total); + hipError_t hipMemPtrGetInfo(void* ptr, size_t* size); /** * @brief Allocate an array on the device. diff --git a/samples/0_Intro/square/README.md b/samples/0_Intro/square/README.md index 807f08754e..e06fbceda1 100644 --- a/samples/0_Intro/square/README.md +++ b/samples/0_Intro/square/README.md @@ -21,7 +21,7 @@ $ cd ~/hip/samples/0_Intro/square $ make /opt/rocm/hip/bin/hipify-perl square.cu > square.cpp /opt/rocm/hip/bin/hipcc square.cpp -o square.out -/opt/rocm/hip/bin/hipcc -use-staticlib square.cpp -o square.out.static +/opt/rocm/hip/bin/hipcc square.cpp -o square.out ``` - Execute file ``` diff --git a/tests/catch/multiproc/CMakeLists.txt b/tests/catch/multiproc/CMakeLists.txt index 5485ee9ca5..58bec6f70f 100644 --- a/tests/catch/multiproc/CMakeLists.txt +++ b/tests/catch/multiproc/CMakeLists.txt @@ -19,6 +19,9 @@ set(LINUX_TEST_SRC ) add_custom_target(dummy_kernel.code COMMAND ${CMAKE_CXX_COMPILER} --genco ${CMAKE_CURRENT_SOURCE_DIR}/dummy_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../multiproc/dummy_kernel.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../../../include/ -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) +if (UNIX) + set(__LINKER_LIBS__ pthread) +endif() # the last argument linker libraries is required for this test but optional to the function if(HIP_PLATFORM MATCHES "nvidia") @@ -30,7 +33,6 @@ elseif(HIP_PLATFORM MATCHES "amd") hip_add_exe_to_target(NAME MultiProc TEST_SRC ${LINUX_TEST_SRC} TEST_TARGET_NAME build_tests - LINKER_LIBS ${CMAKE_DL_LIBS}) + LINKER_LIBS ${CMAKE_DL_LIBS} ${__LINKER_LIBS__}) endif() add_dependencies(build_tests dummy_kernel.code) - diff --git a/tests/catch/unit/device/CMakeLists.txt b/tests/catch/unit/device/CMakeLists.txt index 1e26944d0f..b9fe3726f2 100644 --- a/tests/catch/unit/device/CMakeLists.txt +++ b/tests/catch/unit/device/CMakeLists.txt @@ -43,10 +43,15 @@ set_source_files_properties(hipDeviceGetP2PAttribute.cc PROPERTIES COMPILE_FLAGS add_executable(getDeviceCount EXCLUDE_FROM_ALL getDeviceCount_exe.cc) add_executable(hipDeviceGetP2PAttribute EXCLUDE_FROM_ALL hipDeviceGetP2PAttribute_exe.cc) +if (UNIX) + set(__LINKER_LIBS__ pthread) +endif() + hip_add_exe_to_target(NAME DeviceTest TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests - COMPILE_OPTIONS -std=c++14) + COMPILE_OPTIONS -std=c++14 + LINKER_LIBS ${__LINKER_LIBS__}) add_dependencies(DeviceTest getDeviceCount) add_dependencies(DeviceTest hipDeviceGetP2PAttribute) diff --git a/tests/catch/unit/deviceLib/CMakeLists.txt b/tests/catch/unit/deviceLib/CMakeLists.txt index c54cd68c08..3d882a6644 100644 --- a/tests/catch/unit/deviceLib/CMakeLists.txt +++ b/tests/catch/unit/deviceLib/CMakeLists.txt @@ -18,6 +18,7 @@ set(TEST_SRC if(UNIX) set(TEST_SRC ${TEST_SRC} deviceAllocation.cc) + set(__LINKER_LIBS__ pthread) endif() # AMD only tests @@ -86,7 +87,7 @@ endif() hip_add_exe_to_target(NAME UnitDeviceTests TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests - LINKER_LIBS hiprtc) + LINKER_LIBS hiprtc ${__LINKER_LIBS__}) elseif(HIP_PLATFORM MATCHES "nvidia") hip_add_exe_to_target(NAME UnitDeviceTests TEST_SRC ${TEST_SRC} diff --git a/tests/catch/unit/errorHandling/CMakeLists.txt b/tests/catch/unit/errorHandling/CMakeLists.txt index 78933fd3f8..1b89eb066e 100644 --- a/tests/catch/unit/errorHandling/CMakeLists.txt +++ b/tests/catch/unit/errorHandling/CMakeLists.txt @@ -6,7 +6,12 @@ set(TEST_SRC hipPeekAtLastError.cc ) +if (UNIX) + set(__LINKER_LIBS__ pthread) +endif() + hip_add_exe_to_target(NAME ErrorHandlingTest TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests - COMPILE_OPTIONS -std=c++14) \ No newline at end of file + LINKER_LIBS ${__LINKER_LIBS__} + COMPILE_OPTIONS -std=c++14) diff --git a/tests/catch/unit/event/CMakeLists.txt b/tests/catch/unit/event/CMakeLists.txt index b4d5f2c3b6..42b8699ba3 100644 --- a/tests/catch/unit/event/CMakeLists.txt +++ b/tests/catch/unit/event/CMakeLists.txt @@ -20,6 +20,10 @@ if(HIP_PLATFORM MATCHES "amd") set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) endif() +if (UNIX) + set(__LINKER_LIBS__ pthread) +endif() + hip_add_exe_to_target(NAME EventTest TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests) diff --git a/tests/catch/unit/graph/CMakeLists.txt b/tests/catch/unit/graph/CMakeLists.txt index e2b66872da..a28810a7e8 100644 --- a/tests/catch/unit/graph/CMakeLists.txt +++ b/tests/catch/unit/graph/CMakeLists.txt @@ -83,6 +83,11 @@ set(TEST_SRC hipUserObjectCreate.cc ) +if (UNIX) + set(__LINKER_LIBS__ pthread) +endif() + hip_add_exe_to_target(NAME GraphsTest TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests) + TEST_TARGET_NAME build_tests + LINKER_LIBS ${__LINKER_LIBS__}) diff --git a/tests/catch/unit/memory/CMakeLists.txt b/tests/catch/unit/memory/CMakeLists.txt index 1b4cef3698..74165c5db0 100644 --- a/tests/catch/unit/memory/CMakeLists.txt +++ b/tests/catch/unit/memory/CMakeLists.txt @@ -182,8 +182,11 @@ if(UNIX) set(TEST_SRC ${TEST_SRC} hipHmmOvrSubscriptionTst.cc hipMemoryAllocateCoherent.cc) + + set(__LINKER_LIBS__ pthread) endif() hip_add_exe_to_target(NAME MemoryTest TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests) + TEST_TARGET_NAME build_tests + LINKER_LIBS ${__LINKER_LIBS__}) diff --git a/tests/catch/unit/multiThread/CMakeLists.txt b/tests/catch/unit/multiThread/CMakeLists.txt index 32abf0f5f3..515832ef95 100644 --- a/tests/catch/unit/multiThread/CMakeLists.txt +++ b/tests/catch/unit/multiThread/CMakeLists.txt @@ -5,6 +5,11 @@ set(TEST_SRC hipMultiThreadStreams2.cc ) +if (UNIX) + set(__LINKER_LIBS__ pthread) +endif() + hip_add_exe_to_target(NAME MultiThreadTest TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests) + TEST_TARGET_NAME build_tests + LINKER_LIBS ${__LINKER_LIBS__}) diff --git a/tests/catch/unit/stream/CMakeLists.txt b/tests/catch/unit/stream/CMakeLists.txt index 548bb2e52c..0a8d0b1a3b 100644 --- a/tests/catch/unit/stream/CMakeLists.txt +++ b/tests/catch/unit/stream/CMakeLists.txt @@ -45,7 +45,12 @@ set(TEST_SRC # set_source_files_properties(hipStreamAttachMemAsync.cc PROPERTIES COMPILE_FLAGS -std=c++17) endif() +if (UNIX) + set(__LINKER_LIBS__ pthread) +endif() + hip_add_exe_to_target(NAME StreamTest TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests - COMPILE_OPTIONS -std=c++17) + COMPILE_OPTIONS -std=c++17 + LINKER_LIBS ${__LINKER_LIBS__}) diff --git a/tests/catch/unit/streamperthread/CMakeLists.txt b/tests/catch/unit/streamperthread/CMakeLists.txt index dd5b54dabc..51e2255fa3 100644 --- a/tests/catch/unit/streamperthread/CMakeLists.txt +++ b/tests/catch/unit/streamperthread/CMakeLists.txt @@ -7,6 +7,11 @@ set(TEST_SRC hipStreamPerThrdTsts.cc ) +if (UNIX) + set(__LINKER_LIBS__ pthread) +endif() + hip_add_exe_to_target(NAME StreamPerThreadTest TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests) + TEST_TARGET_NAME build_tests + LINKER_LIBS ${__LINKER_LIBS__}) diff --git a/tests/hit/HIT.cmake b/tests/hit/HIT.cmake index 68c3df3c4f..e1c8fcbc4b 100755 --- a/tests/hit/HIT.cmake +++ b/tests/hit/HIT.cmake @@ -354,7 +354,7 @@ macro(HIT_ADD_FILES _config _dir _label _parent) set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1) hip_reset_flags() hip_add_executable(${target} ${_sources} HIPCC_OPTIONS ${_hipcc_options} CLANG_OPTIONS ${_clang_options} NVCC_OPTIONS ${_nvcc_options} EXCLUDE_FROM_ALL) - target_link_libraries(${target} PRIVATE ${_link_options}) + target_link_options(${target} PRIVATE ${_link_options}) set_target_properties(${target} PROPERTIES OUTPUT_NAME ${_target} RUNTIME_OUTPUT_DIRECTORY ${_label} LINK_DEPENDS "${HIP_LIB_FILES}") add_dependencies(${_parent} ${target}) foreach(_dependency ${_depends}) diff --git a/tests/src/deviceLib/hip_threadfence_system.cpp b/tests/src/deviceLib/hip_threadfence_system.cpp index 097dae2273..11e84a3b87 100644 --- a/tests/src/deviceLib/hip_threadfence_system.cpp +++ b/tests/src/deviceLib/hip_threadfence_system.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/hipEnvVarDriver.cpp b/tests/src/hipEnvVarDriver.cpp index 2d303e08fe..bd5de426d6 100644 --- a/tests/src/hipEnvVarDriver.cpp +++ b/tests/src/hipEnvVarDriver.cpp @@ -16,7 +16,7 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s test_common.cpp LINK_OPTIONS -lpthread NVCC_OPTIONS -std=c++11 * TEST: %t * HIT_END */ diff --git a/tests/src/ipc/hipMultiProcIpcEvent.cpp b/tests/src/ipc/hipMultiProcIpcEvent.cpp index 418b68a5ed..b06c010a01 100644 --- a/tests/src/ipc/hipMultiProcIpcEvent.cpp +++ b/tests/src/ipc/hipMultiProcIpcEvent.cpp @@ -18,7 +18,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../test_common.cpp + * BUILD: %t %s ../test_common.cpp LINK_OPTIONS -lrt * TEST: %t * HIT_END */ diff --git a/tests/src/ipc/hipMultiProcIpcMem.cpp b/tests/src/ipc/hipMultiProcIpcMem.cpp index 3829853774..ec579dfd7b 100644 --- a/tests/src/ipc/hipMultiProcIpcMem.cpp +++ b/tests/src/ipc/hipMultiProcIpcMem.cpp @@ -18,7 +18,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../test_common.cpp + * BUILD: %t %s ../test_common.cpp LINK_OPTIONS -lrt * TEST: %t --N 4 * HIT_END */ diff --git a/tests/src/runtimeApi/event/hipEventMultiThreaded.cpp b/tests/src/runtimeApi/event/hipEventMultiThreaded.cpp index 65f2ff1851..2bf5a78969 100644 --- a/tests/src/runtimeApi/event/hipEventMultiThreaded.cpp +++ b/tests/src/runtimeApi/event/hipEventMultiThreaded.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp + * BUILD: %t %s ../../test_common.cpp LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipIpcMemAccessTest.cpp b/tests/src/runtimeApi/memory/hipIpcMemAccessTest.cpp index cd9809ded5..94142a76bd 100644 --- a/tests/src/runtimeApi/memory/hipIpcMemAccessTest.cpp +++ b/tests/src/runtimeApi/memory/hipIpcMemAccessTest.cpp @@ -18,7 +18,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp + * BUILD: %t %s ../../test_common.cpp LINK_OPTIONS -lrt -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipMallocConcurrency.cpp b/tests/src/runtimeApi/memory/hipMallocConcurrency.cpp index 4bfd65a7f9..44a4c5d086 100644 --- a/tests/src/runtimeApi/memory/hipMallocConcurrency.cpp +++ b/tests/src/runtimeApi/memory/hipMallocConcurrency.cpp @@ -58,7 +58,7 @@ Testcase Scenarios : */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 LINK_OPTIONS -lpthread * TEST_NAMED: %t hipMalloc_ArgValidation --tests 1 * TEST_NAMED: %t hipMalloc_LoopRegression_AllocFreeCycle --tests 2 * TEST_NAMED: %t hipMalloc_LoopRegression_AllocPool --tests 3 diff --git a/tests/src/runtimeApi/memory/hipMemcpy.cpp b/tests/src/runtimeApi/memory/hipMemcpy.cpp index c6bb98be0c..6735616b0b 100644 --- a/tests/src/runtimeApi/memory/hipMemcpy.cpp +++ b/tests/src/runtimeApi/memory/hipMemcpy.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST_NAMED: %t hipMemcpy-modes --tests 0x1 * TEST_NAMED: %t hipMemcpy-size --tests 0x6 * TEST_NAMED: %t hipMemcpy-dev-offsets --tests 0x10 diff --git a/tests/src/runtimeApi/memory/hipMemcpyNegativeMThrdMSize.cpp b/tests/src/runtimeApi/memory/hipMemcpyNegativeMThrdMSize.cpp index 3f103915ee..53dae66758 100644 --- a/tests/src/runtimeApi/memory/hipMemcpyNegativeMThrdMSize.cpp +++ b/tests/src/runtimeApi/memory/hipMemcpyNegativeMThrdMSize.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. // of 8 hipmemcpy apis /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 LINK_OPTIONS -lpthread * TEST_NAMED: %t hipMemcpyNegativeMThrdMSize_Negative_tests --tests 1 * TEST_NAMED: %t hipMemcpyNegativeMThrdMSize_MultiThread_tests --tests 2 * TEST_NAMED: %t hipMemcpyNegativeMThrdMSize_MultiSize_singleType --tests 3 --memcpyPeersOnly 0 --testAllTypes 0 diff --git a/tests/src/runtimeApi/memory/hipMemcpyWithStreamMultiThread.cpp b/tests/src/runtimeApi/memory/hipMemcpyWithStreamMultiThread.cpp index d5580a4f6d..ddd9c853ea 100644 --- a/tests/src/runtimeApi/memory/hipMemcpyWithStreamMultiThread.cpp +++ b/tests/src/runtimeApi/memory/hipMemcpyWithStreamMultiThread.cpp @@ -24,7 +24,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipMemset2DAsyncMultiThreadAndKernel.cpp b/tests/src/runtimeApi/memory/hipMemset2DAsyncMultiThreadAndKernel.cpp index aed1efbba8..09057677ac 100644 --- a/tests/src/runtimeApi/memory/hipMemset2DAsyncMultiThreadAndKernel.cpp +++ b/tests/src/runtimeApi/memory/hipMemset2DAsyncMultiThreadAndKernel.cpp @@ -24,7 +24,7 @@ // /* HIT_START - * BUILD: %t %s ../../test_common.cpp + * BUILD: %t %s ../../test_common.cpp LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipMemset3DRegressMultiThread.cpp b/tests/src/runtimeApi/memory/hipMemset3DRegressMultiThread.cpp index 80d92e9355..7ae81ad695 100644 --- a/tests/src/runtimeApi/memory/hipMemset3DRegressMultiThread.cpp +++ b/tests/src/runtimeApi/memory/hipMemset3DRegressMultiThread.cpp @@ -34,7 +34,7 @@ Testcase Scenarios : */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 LINK_OPTIONS -lpthread * TEST: %t --tests 1 * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipMemsetAsyncMultiThread.cpp b/tests/src/runtimeApi/memory/hipMemsetAsyncMultiThread.cpp index a7893d7bd7..7f6d379dc2 100644 --- a/tests/src/runtimeApi/memory/hipMemsetAsyncMultiThread.cpp +++ b/tests/src/runtimeApi/memory/hipMemsetAsyncMultiThread.cpp @@ -22,7 +22,7 @@ */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp + * BUILD: %t %s ../../test_common.cpp LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipMultiMemcpyMultiThrdMultiStrm.cpp b/tests/src/runtimeApi/memory/hipMultiMemcpyMultiThrdMultiStrm.cpp index 7388f44b9f..a1eebf20b1 100644 --- a/tests/src/runtimeApi/memory/hipMultiMemcpyMultiThrdMultiStrm.cpp +++ b/tests/src/runtimeApi/memory/hipMultiMemcpyMultiThrdMultiStrm.cpp @@ -21,7 +21,7 @@ // and also launch hipMemcpyAsync() api on the same stream. This test case is simulate the scenario // reported in SWDEV-181598. /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipMultiMemcpyMultiThread.cpp b/tests/src/runtimeApi/memory/hipMultiMemcpyMultiThread.cpp index 2a690b9832..ea8f32c965 100644 --- a/tests/src/runtimeApi/memory/hipMultiMemcpyMultiThread.cpp +++ b/tests/src/runtimeApi/memory/hipMultiMemcpyMultiThread.cpp @@ -21,7 +21,7 @@ // and also launch hipMemcpyAsync() api. This test case is simulate the scenario // reported in SWDEV-181598. /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/memory/hipPointerAttributes.cpp b/tests/src/runtimeApi/memory/hipPointerAttributes.cpp index 9666dd4693..a85dc156da 100644 --- a/tests/src/runtimeApi/memory/hipPointerAttributes.cpp +++ b/tests/src/runtimeApi/memory/hipPointerAttributes.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp + * BUILD: %t %s ../../test_common.cpp LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/module/hipModuleLoadDataMultThreadOnMultGPU.cpp b/tests/src/runtimeApi/module/hipModuleLoadDataMultThreadOnMultGPU.cpp index f8b436068b..dadcc2d222 100644 --- a/tests/src/runtimeApi/module/hipModuleLoadDataMultThreadOnMultGPU.cpp +++ b/tests/src/runtimeApi/module/hipModuleLoadDataMultThreadOnMultGPU.cpp @@ -18,7 +18,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/module/hipModuleLoadDataMultThreaded.cpp b/tests/src/runtimeApi/module/hipModuleLoadDataMultThreaded.cpp index 537195c5fb..4b03c3b189 100644 --- a/tests/src/runtimeApi/module/hipModuleLoadDataMultThreaded.cpp +++ b/tests/src/runtimeApi/module/hipModuleLoadDataMultThreaded.cpp @@ -18,7 +18,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM nvidia + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 EXCLUDE_HIP_PLATFORM nvidia LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/module/hipModuleLoadMultiThreaded.cpp b/tests/src/runtimeApi/module/hipModuleLoadMultiThreaded.cpp index dbd41900ce..24f0f782cf 100644 --- a/tests/src/runtimeApi/module/hipModuleLoadMultiThreaded.cpp +++ b/tests/src/runtimeApi/module/hipModuleLoadMultiThreaded.cpp @@ -19,7 +19,7 @@ THE SOFTWARE. /* HIT_START * BUILD_CMD: empty_kernel.code %hc --genco %S/empty_kernel.cpp -o empty_kernel.code - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/module/hipModuleTexture2dDrv.cpp b/tests/src/runtimeApi/module/hipModuleTexture2dDrv.cpp index 67c62f412e..94e753a585 100644 --- a/tests/src/runtimeApi/module/hipModuleTexture2dDrv.cpp +++ b/tests/src/runtimeApi/module/hipModuleTexture2dDrv.cpp @@ -23,7 +23,7 @@ THE SOFTWARE. /* Tests 6 and 7 are skipped for CUDA 11.2 due to cuda runtime issues */ /* HIT_START * BUILD_CMD: tex2d_kernel.code %hc --genco %S/tex2d_kernel.cpp -o tex2d_kernel.code - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST: %t --tests 0x01 * TEST: %t --tests 0x02 * TEST: %t --tests 0x03 diff --git a/tests/src/runtimeApi/multiThread/hipMultiThreadDevice.cpp b/tests/src/runtimeApi/multiThread/hipMultiThreadDevice.cpp index af48d5a367..18bf9c0bd2 100644 --- a/tests/src/runtimeApi/multiThread/hipMultiThreadDevice.cpp +++ b/tests/src/runtimeApi/multiThread/hipMultiThreadDevice.cpp @@ -1,5 +1,5 @@ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST_NAMED: %t hipMultiThreadDevice-serial --tests 0x1 * TEST_NAMED: %t hipMultiThreadDevice-pyramid --tests 0x4 * TEST_NAMED: %t hipMultiThreadDevice-nearzero --tests 0x10 diff --git a/tests/src/runtimeApi/multiThread/hipMultiThreadStreams1.cpp b/tests/src/runtimeApi/multiThread/hipMultiThreadStreams1.cpp index f1c683927b..b8fca4d02f 100644 --- a/tests/src/runtimeApi/multiThread/hipMultiThreadStreams1.cpp +++ b/tests/src/runtimeApi/multiThread/hipMultiThreadStreams1.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/multiThread/hipMultiThreadStreams2.cpp b/tests/src/runtimeApi/multiThread/hipMultiThreadStreams2.cpp index 2f2367775f..752ffd870d 100644 --- a/tests/src/runtimeApi/multiThread/hipMultiThreadStreams2.cpp +++ b/tests/src/runtimeApi/multiThread/hipMultiThreadStreams2.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/p2p/hipP2pLinkTypeAndHopFunc.cpp b/tests/src/runtimeApi/p2p/hipP2pLinkTypeAndHopFunc.cpp index 3cd5d915b5..6786124095 100644 --- a/tests/src/runtimeApi/p2p/hipP2pLinkTypeAndHopFunc.cpp +++ b/tests/src/runtimeApi/p2p/hipP2pLinkTypeAndHopFunc.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD_CMD: %t %hc %S/%s -o %T/%t %S/../../test_common.cpp -I %S/../../ -L%rocm-path/rocm_smi/lib -lrocm_smi64 -ldl EXCLUDE_HIP_PLATFORM nvidia + * BUILD_CMD: %t %hc %S/%s -o %T/%t %S/../../test_common.cpp -I %S/../../ -L%rocm-path/rocm_smi/lib -lrocm_smi64 -lpthread -ldl EXCLUDE_HIP_PLATFORM nvidia * TEST: %t --tests 0x1 * TEST: %t --tests 0x2 * TEST: %t --tests 0x3 diff --git a/tests/src/runtimeApi/stream/hipStreamACb_MStrm_Mgpu.cpp b/tests/src/runtimeApi/stream/hipStreamACb_MStrm_Mgpu.cpp index 35f0e15b11..d56ce2b3c0 100644 --- a/tests/src/runtimeApi/stream/hipStreamACb_MStrm_Mgpu.cpp +++ b/tests/src/runtimeApi/stream/hipStreamACb_MStrm_Mgpu.cpp @@ -21,7 +21,7 @@ // kernel. Verify that all the kernels queued are executed before the callback. /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/stream/hipStreamACb_MultiThread.cpp b/tests/src/runtimeApi/stream/hipStreamACb_MultiThread.cpp index d26e41019c..704621761e 100644 --- a/tests/src/runtimeApi/stream/hipStreamACb_MultiThread.cpp +++ b/tests/src/runtimeApi/stream/hipStreamACb_MultiThread.cpp @@ -22,7 +22,7 @@ THE SOFTWARE. // This test case is disabled currently. /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/stream/hipStreamAddCallbackCatch.cpp b/tests/src/runtimeApi/stream/hipStreamAddCallbackCatch.cpp index c694bf6d2a..59d05204ee 100644 --- a/tests/src/runtimeApi/stream/hipStreamAddCallbackCatch.cpp +++ b/tests/src/runtimeApi/stream/hipStreamAddCallbackCatch.cpp @@ -11,7 +11,7 @@ #include "test_common.h" /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS -std=c++11 LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/streamOperations/hipstream_operations.cpp b/tests/src/runtimeApi/streamOperations/hipstream_operations.cpp index cd4d9fd425..8cd3b7bec2 100644 --- a/tests/src/runtimeApi/streamOperations/hipstream_operations.cpp +++ b/tests/src/runtimeApi/streamOperations/hipstream_operations.cpp @@ -39,7 +39,7 @@ THE SOFTWARE. */ /* HIT_START - * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvidia + * BUILD: %t %s ../../test_common.cpp NVCC_OPTIONS --std=c++11 EXCLUDE_HIP_PLATFORM nvidia LINK_OPTIONS -lpthread * TEST: %t * HIT_END */ diff --git a/tests/src/runtimeApi/synchronization/cache_coherency_cpu_gpu.cpp b/tests/src/runtimeApi/synchronization/cache_coherency_cpu_gpu.cpp index 3e4aec033c..dae95f1264 100644 --- a/tests/src/runtimeApi/synchronization/cache_coherency_cpu_gpu.cpp +++ b/tests/src/runtimeApi/synchronization/cache_coherency_cpu_gpu.cpp @@ -19,7 +19,7 @@ THE SOFTWARE. // Simple test for Fine Grained CPU-GPU coherency. /* HIT_START - * BUILD: %t %s ../../test_common.cpp HIPCC_OPTIONS -std=c++11 -lpthread EXCLUDE_HIP_PLATFORM nvidia + * BUILD: %t %s ../../test_common.cpp EXCLUDE_HIP_PLATFORM nvidia LINK_OPTIONS -lpthread * TEST: %t * HIT_END */