Skip to content

Commit

Permalink
SWDEV-1 - Merge github PRs to amd-staging
Browse files Browse the repository at this point in the history
- #194
- #36
- #44
- #47
- #62
- #63
- #64
- #65
- #66
- #67
- #68
- #69
- #142
- #196
- #238

Change-Id: I74f7fef76d7d536b1cf89dad3e527c92d1cd21b5
  • Loading branch information
mangupta committed Dec 20, 2023
2 parents 6d8e62c + e0612f9 commit 6429ef1
Show file tree
Hide file tree
Showing 99 changed files with 9,848 additions and 2,565 deletions.
58 changes: 58 additions & 0 deletions catch/hipTestMain/config/config_amd_linux
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
"Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout_Not_Supported",
"Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters",
"Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Negative_Parameters",
"Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Negative_Parameters",
"Unit_hipGraphMemcpyNodeSetParamsToSymbol_Positive_Basic",
"Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Positive_Basic",
"Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Positive_Basic",
Expand Down Expand Up @@ -183,6 +185,62 @@
"Unit_hipMemUnmap_negative",
"=== SWDEV-432556,SWDEV-434211:Below test randomly failing in stress test ===",
"Unit_hipDeviceGetUuid_From_RocmInfo",
"=== SWDEV-434171: Below tests took long time to complete in stress test on 17/11/23 ===",
"Unit_Warp_Shfl_Positive_Basic - int",
"Unit_Warp_Shfl_Positive_Basic - unsigned int",
"Unit_Warp_Shfl_Positive_Basic - long",
"Unit_Warp_Shfl_Positive_Basic - unsigned long",
"Unit_Warp_Shfl_Positive_Basic - long long",
"Unit_Warp_Shfl_Positive_Basic - unsigned long long",
"Unit_Warp_Shfl_Positive_Basic - float",
"Unit_Warp_Shfl_Positive_Basic - double",
"Unit_Warp_Shfl_XOR_Positive_Basic - int",
"Unit_Warp_Shfl_XOR_Positive_Basic - unsigned int",
"Unit_Warp_Shfl_XOR_Positive_Basic - long",
"Unit_Warp_Shfl_XOR_Positive_Basic - unsigned long",
"Unit_Warp_Shfl_XOR_Positive_Basic - long long",
"Unit_Warp_Shfl_XOR_Positive_Basic - unsigned long long",
"Unit_Warp_Shfl_XOR_Positive_Basic - float",
"Unit_Warp_Shfl_XOR_Positive_Basic - double",
"=== SWDEV-434878: Below tests failed in stress test on 24/11/23 ===",
"Unit_hipGraphUpload_Negative_Parameters",
"Unit_hipModuleOccupancyMaxPotentialBlockSize_Negative_Parameters",
"Unit_hipModuleOccupancyMaxPotentialBlockSize_Positive_RangeValidation",
"Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Positive_RangeValidation",
"Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters",
"Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation",
"Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Positive_RangeValidation",
"=== SWDEV-435667: Below tests failing randomly in stress test on 01/12/23 ===",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - int",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - unsigned int",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - unsigned long",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - unsigned long long",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - float",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - double",
"Unit_atomicExch_Positive_Multi_Kernel - int",
"Unit_atomicExch_Positive_Multi_Kernel - unsigned int",
"Unit_atomicExch_Positive_Multi_Kernel - unsigned long",
"Unit_atomicExch_Positive_Multi_Kernel - unsigned long long",
"Unit_atomicExch_Positive_Multi_Kernel - float",
"Unit_atomicExch_Positive_Multi_Kernel - double",
"Unit_atomicExch_system_Positive_Peer_GPUs - int",
"Unit_atomicExch_system_Positive_Peer_GPUs - unsigned int",
"Unit_atomicExch_system_Positive_Peer_GPUs - unsigned long",
"Unit_atomicExch_system_Positive_Peer_GPUs - unsigned long long",
"Unit_atomicExch_system_Positive_Peer_GPUs - float",
"Unit_atomicExch_system_Positive_Peer_GPUs - double",
"Unit_atomicExch_system_Positive_Host_And_GPU - int",
"Unit_atomicExch_system_Positive_Host_And_GPU - unsigned int",
"Unit_atomicExch_system_Positive_Host_And_GPU - unsigned long",
"Unit_atomicExch_system_Positive_Host_And_GPU - unsigned long long",
"Unit_atomicExch_system_Positive_Host_And_GPU - float",
"Unit_atomicExch_system_Positive_Host_And_GPU - double",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - int",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - unsigned int",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - unsigned long",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - unsigned long long",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - float",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - double",
#endif
#if defined VEGA20
"=== SWDEV-419112 Below tests fail in stress test on 29/08/23 ===",
Expand Down
58 changes: 58 additions & 0 deletions catch/hipTestMain/config/config_amd_windows
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize_Not_Supported",
"Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout_Not_Supported",
"Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters",
"Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Negative_Parameters",
"Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Negative_Parameters",
"Unit_hipGraphMemcpyNodeSetParamsToSymbol_Positive_Basic",
"Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Positive_Basic",
"Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Positive_Basic",
Expand Down Expand Up @@ -282,6 +284,62 @@
"Unit_hipMemSetAccess_MultiProc",
"Unit_hipMemSetAccess_negative",
"Unit_hipMemUnmap_negative",
"=== SWDEV-434171: Below tests took long time to complete in stress test on 17/11/23 ===",
"Unit_Warp_Shfl_Positive_Basic - int",
"Unit_Warp_Shfl_Positive_Basic - unsigned int",
"Unit_Warp_Shfl_Positive_Basic - long",
"Unit_Warp_Shfl_Positive_Basic - unsigned long",
"Unit_Warp_Shfl_Positive_Basic - long long",
"Unit_Warp_Shfl_Positive_Basic - unsigned long long",
"Unit_Warp_Shfl_Positive_Basic - float",
"Unit_Warp_Shfl_Positive_Basic - double",
"Unit_Warp_Shfl_XOR_Positive_Basic - int",
"Unit_Warp_Shfl_XOR_Positive_Basic - unsigned int",
"Unit_Warp_Shfl_XOR_Positive_Basic - long",
"Unit_Warp_Shfl_XOR_Positive_Basic - unsigned long",
"Unit_Warp_Shfl_XOR_Positive_Basic - long long",
"Unit_Warp_Shfl_XOR_Positive_Basic - unsigned long long",
"Unit_Warp_Shfl_XOR_Positive_Basic - float",
"Unit_Warp_Shfl_XOR_Positive_Basic - double",
"=== SWDEV-434878: Below tests failed in stress test on 24/11/23 ===",
"Unit_hipGraphUpload_Negative_Parameters",
"Unit_hipModuleOccupancyMaxPotentialBlockSize_Negative_Parameters",
"Unit_hipModuleOccupancyMaxPotentialBlockSize_Positive_RangeValidation",
"Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Positive_RangeValidation",
"Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters",
"Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation",
"Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Positive_RangeValidation",
"=== SWDEV-435667: Below tests failing randomly in stress test on 01/12/23 ===",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - int",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - unsigned int",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - unsigned long",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - unsigned long long",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - float",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - double",
"Unit_atomicExch_Positive_Multi_Kernel - int",
"Unit_atomicExch_Positive_Multi_Kernel - unsigned int",
"Unit_atomicExch_Positive_Multi_Kernel - unsigned long",
"Unit_atomicExch_Positive_Multi_Kernel - unsigned long long",
"Unit_atomicExch_Positive_Multi_Kernel - float",
"Unit_atomicExch_Positive_Multi_Kernel - double",
"Unit_atomicExch_system_Positive_Peer_GPUs - int",
"Unit_atomicExch_system_Positive_Peer_GPUs - unsigned int",
"Unit_atomicExch_system_Positive_Peer_GPUs - unsigned long",
"Unit_atomicExch_system_Positive_Peer_GPUs - unsigned long long",
"Unit_atomicExch_system_Positive_Peer_GPUs - float",
"Unit_atomicExch_system_Positive_Peer_GPUs - double",
"Unit_atomicExch_system_Positive_Host_And_GPU - int",
"Unit_atomicExch_system_Positive_Host_And_GPU - unsigned int",
"Unit_atomicExch_system_Positive_Host_And_GPU - unsigned long",
"Unit_atomicExch_system_Positive_Host_And_GPU - unsigned long long",
"Unit_atomicExch_system_Positive_Host_And_GPU - float",
"Unit_atomicExch_system_Positive_Host_And_GPU - double",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - int",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - unsigned int",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - unsigned long",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - unsigned long long",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - float",
"Unit_atomicExch_system_Positive_Host_And_Peer_GPUs - double",
#endif
"End of json"
]
Expand Down
10 changes: 9 additions & 1 deletion catch/hipTestMain/config/config_nvidia_linux.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
"Grid_Group_Getters_Via_Non_Member_Functions_Positive_Basic",
"Grid_Group_Sync_Positive_Basic",
"dynamic_loading_device_kernels_from_library",
"Unit_tiled_partition"
"Unit_tiled_partition",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - int",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - unsigned int",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - unsigned long long",
"Unit_atomicExch_Positive_Same_Address_Compile_Time - float",
"Unit_atomicExch_system_Positive_Host_And_GPU - int",
"Unit_atomicExch_system_Positive_Host_And_GPU - unsigned int",
"Unit_atomicExch_system_Positive_Host_And_GPU - unsigned long long",
"Unit_atomicExch_system_Positive_Host_And_GPU - float"
]
}
6 changes: 3 additions & 3 deletions catch/hipTestMain/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ int main(int argc, char** argv) {
| Opt(cmd_options.progress)
["-P"]["--progress"]
("Show progress bar when running performance tests")
| Opt(cmd_options.extended_run)
["-E"]["--extended-run"]
("TODO: Description goes here")
| Opt(cmd_options.cg_extended_run, "cg_extened_run")
["-E"]["--cg-extended-run"]
("Number of iterations used for cooperative groups sync tests (default: 5)")
;
// clang-format on

Expand Down
4 changes: 2 additions & 2 deletions catch/include/cmd_options.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ THE SOFTWARE.
#pragma once

struct CmdOptions {
int iterations = 1000;
int iterations = 10;
int warmups = 100;
int cg_extended_run = 5;
bool no_display = false;
bool progress = false;
bool extended_run = false;
};

extern CmdOptions cmd_options;
4 changes: 4 additions & 0 deletions catch/include/cpu_grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct CPUGrid {
unsigned int thread_count_;
};

/* Generate dimensions for 1D, 2D and 3D blocks of threads */
inline dim3 GenerateThreadDimensions() {
hipDeviceProp_t props;
HIP_CHECK(hipGetDeviceProperties(&props, 0));
Expand All @@ -99,6 +100,7 @@ inline dim3 GenerateThreadDimensions() {
dim3(props.warpSize + 1, 3, 3));
}

/* Generate dimensions for 1D, 2D and 3D grids of blocks */
inline dim3 GenerateBlockDimensions() {
hipDeviceProp_t props;
HIP_CHECK(hipGetDeviceProperties(&props, 0));
Expand All @@ -116,6 +118,7 @@ inline dim3 GenerateBlockDimensions() {
dim3(5, 5, 5));
}

/* Generate dimensions for 1D, 2D and 3D blocks of threads - reduced set */
inline dim3 GenerateThreadDimensionsForShuffle() {
hipDeviceProp_t props;
HIP_CHECK(hipGetDeviceProperties(&props, 0));
Expand All @@ -136,6 +139,7 @@ inline dim3 GenerateThreadDimensionsForShuffle() {
dim3(props.warpSize + 1, 3, 3));
}

/* Generate dimensions for 1D, 2D and 3D grids of blocks - reduced set */
inline dim3 GenerateBlockDimensionsForShuffle() {
hipDeviceProp_t props;
HIP_CHECK(hipGetDeviceProperties(&props, 0));
Expand Down
13 changes: 13 additions & 0 deletions catch/include/hip_test_common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ THE SOFTWARE.
} \
}

// Check that an expression, errorExpr, evaluates to the expected error_t, expectedError.
#define HIPRTC_CHECK_ERROR(errorExpr, expectedError) \
{ \
auto localError = errorExpr; \
INFO("Matching Errors: " \
<< "\n Expected Error: " << hiprtcGetErrorString(expectedError) \
<< "\n Expected Code: " << expectedError << '\n' \
<< " Actual Error: " << hiprtcGetErrorString(localError) \
<< "\n Actual Code: " << localError << "\nStr: " << #errorExpr \
<< "\n In File: " << __FILE__ << "\n At line: " << __LINE__); \
REQUIRE(localError == expectedError); \
}

// Although its assert, it will be evaluated at runtime
#define HIP_ASSERT(x) \
{ REQUIRE((x)); }
Expand Down
51 changes: 49 additions & 2 deletions catch/include/hip_test_defgroups.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#include <hip_test_common.hh>

// Test groups are named based on the group names from hip_api_runtime.h, with adding "Test" suffix

/**
Expand Down Expand Up @@ -95,8 +97,46 @@ THE SOFTWARE.

/**
* @defgroup KernelTest Kernel Functions Management
* @{
* This section describes the various kernel functions invocation.
* @}
*/

/**
* @defgroup AtomicsTest Device Atomics
* @{
* This section describes the various kernel functions invocation.
* This section describes tests for the Device Atomic APIs.
* @}
*/

/**
* @addtogroup atomicExch atomicExch
* @{
* @ingroup AtomicsTest
*/

/**
* Test Description
* ------------------------
* - Compiles atomicExch with invalid parameters.
* - Compiles the source with specialized Python tool.
* -# Utilizes sub-process to invoke compilation of faulty source.
* -# Performs post-processing of compiler output and counts errors.
* Test source
* ------------------------
* - unit/atomics/CMakeLists.txt
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_atomicExch_Negative_Parameters") {}
/**
* End doxygen group atomicExch.
* @}
*/

/**
* End doxygen group AtomicsTest.
* @}
*/

Expand All @@ -115,7 +155,14 @@ THE SOFTWARE.
* @}
*/

/**
/**
* @defgroup PerformanceTest Performance tests
* @{
* This section describes performance tests for the target API groups and use-cases.
* @}
*/

/**
* @defgroup ShflTest warp shuffle function Management
* @{
* This section describes the warp shuffle types & functions of HIP runtime API.
Expand Down
1 change: 1 addition & 0 deletions catch/include/performance_common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ THE SOFTWARE.
#include <resource_guards.hh>

#pragma clang diagnostic ignored "-Wunused-but-set-variable"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"

#if defined(_WIN32)
Expand Down
Loading

0 comments on commit 6429ef1

Please sign in to comment.