Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXSWHTEC-224 - Test cases ID clean up and documentation for Occupancy #93

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cea96af
SWDEV-355313 - Move catch tests and samples
gargrahul Oct 26, 2022
909e7e4
SWDEV-355313 - Add README
gargrahul Nov 7, 2022
094b9af
SWDEV-355313 - Update amd-staging branch
gargrahul Nov 28, 2022
070bb7c
EXSWHTEC-174 - Add Doxygen configuration and common header with group…
milos-mozetic Dec 1, 2022
9daa6d0
SWDEV-355313 - Update README
gargrahul Dec 2, 2022
2a205ed
EXSWHTEC-200 - Add support for TEMPLATE_TEST_CASE preprocessing
milos-mozetic Dec 5, 2022
c49043e
SWDEV-355313 - Update latest code
gargrahul Dec 6, 2022
e0a7d7b
EXSWHTEC-106 - Reimplement tests for hipOccupancyMaxActiveBlocksPerMu…
nives-vukovic Dec 9, 2022
e095d78
EXSWHTEC-106 - Change section disable macros
nives-vukovic Dec 9, 2022
105cf2a
EXSWHTEC-105 - Implement tests for hipModuleOccupancyMaxActiveBlocksP…
nives-vukovic Dec 9, 2022
2db594f
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 13, 2022
1977515
EXSWHTEC-200 - Resolve conflicts in missed conflicted files
milos-mozetic Dec 13, 2022
14a4667
Merge remote-tracking branch 'origin/develop' into hipOccupancy_tests
nives-vukovic Dec 14, 2022
5260f80
Merge remote-tracking branch 'origin/develop' into hipModuleOccupancy…
nives-vukovic Dec 14, 2022
259be27
EXSWHTEC-200 - Add newline at the end of the file
milos-mozetic Dec 14, 2022
e0daf30
EXSWHTEC-200 - Extend the PREDEFINED list to define all macro names t…
milos-mozetic Dec 14, 2022
ed554f2
EXSWHTEC-106 - Disable AMD specific test due to defect
nives-vukovic Dec 20, 2022
a048cff
Merge branch 'hipOccupancy_tests' of github.com:mirza-halilcevic/hip-…
milos-mozetic Dec 20, 2022
9bf92de
Merge branch 'hipModuleOccupancy_tests' of github.com:mirza-halilcevi…
milos-mozetic Dec 20, 2022
e13aa21
EXSWHTEC-224 - Test cases ID clean up and documentation for Occupancy
milos-mozetic Dec 20, 2022
2dc90fd
EXSWHTEC-105 - Disable negative test using json file
nives-vukovic Mar 9, 2023
4c8b7f6
Merge branch 'develop' into doxygen_occupancy_documentation
milos-mozetic Jun 22, 2023
3be5ef1
Merge remote-tracking branch 'origin/develop' into hipModuleOccupancy…
nives-vukovic Jun 26, 2023
a68bfcd
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Jul 10, 2023
d7d63fb
Merge branch 'develop' into doxygen_occupancy_documentation
rakesroy Jul 25, 2023
1368d91
Merge remote-tracking branch 'origin/develop' into hipModuleOccupancy…
nives-vukovic Nov 16, 2023
47b7285
Merge remote-tracking branch 'origin/develop' into doxygen_occupancy_…
nives-vukovic Nov 20, 2023
a340275
Merge branch 'hipModuleOccupancy_tests' into doxygen_occupancy_docume…
nives-vukovic Nov 20, 2023
d5708c4
Merge remote-tracking branch 'origin/develop' into doxygen_occupancy_…
nives-vukovic Feb 5, 2024
9085493
EXSWHTEC-224 - Fix minor cleanup inconsistencies
nives-vukovic Feb 20, 2024
60eb35e
Merge branch 'develop' into doxygen_occupancy_documentation
mirza-halilcevic Feb 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions catch/include/hip_test_defgroups.hh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ THE SOFTWARE.
* @}
*/

/**
* @defgroup OccupancyTest Occupancy
* @{
* This section describes tests for the occupancy functions of HIP runtime API.
* @}
*/

/**
* @defgroup PeerToPeerTest PeerToPeer Device Memory Access
* @{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
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
Expand All @@ -16,15 +16,33 @@ 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.
*/
/*
Testcase Scenarios :
Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation - Test correct
execution of hipModuleOccupancyMaxActiveBlocksPerMultiprocessor for diffrent parameter values
Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters - Test unsuccessful
execution of hipModuleOccupancyMaxActiveBlocksPerMultiprocessor api when parameters are invalid
*/

#include "occupancy_common.hh"

/**
* @addtogroup hipModuleOccupancyMaxActiveBlocksPerMultiprocessor hipModuleOccupancyMaxActiveBlocksPerMultiprocessor
* @{
* @ingroup OccupancyTest
* `hipModuleOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks, hipFunction_t f,
* int blockSize, size_t dynSharedMemPerBlk)` -
* Returns occupancy for a device function.
*/

/**
* Test Description
* ------------------------
* - Validates handling of invalid arguments:
* -# When output pointer to the grid size is `nullptr`
* - Expected output: return `hipErrorInvalidValue`
* -# When block size is 0
* - Expected output: return `hipErrorInvalidValue`
* Test source
* ------------------------
* - unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters") {
hipModule_t module;
hipFunction_t function;
Expand All @@ -50,6 +68,21 @@ TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Para
HIP_CHECK(hipModuleUnload(module));
}

/**
* Test Description
* ------------------------
* - Check if grid size and block size are within valid range using basic kernel functions:
* -# When `dynSharedMemPerBlk = 0`
* - Expected output: return `hipSuccess`
* -# When `dynSharedMemPerBlk = sharedMemPerBlock`
* - Expected output: return `hipSuccess`
* Test source
* ------------------------
* - unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation") {
hipDeviceProp_t devProp;
hipModule_t module;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
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
Expand All @@ -16,17 +16,36 @@ 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.
*/
/*
Testcase Scenarios :
Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Positive_RangeValidation - Test
correct execution of hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags for diffrent
parameter values
Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Negative_Parameters - Test
unsuccessful execution of hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags api when
parameters are invalid
*/

#include "occupancy_common.hh"

/**
* @addtogroup hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags
* @{
* @ingroup OccupancyTest
* `hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks, hipFunction_t f,
* int blockSize, size_t dynSharedMemPerBlk, unsigned int flags)` -
* Returns occupancy for a device function.
*/

/**
* Test Description
* ------------------------
* - Validates handling of invalid arguments:
* -# When output pointer to the grid size is `nullptr`
* - Expected output: return `hipErrorInvalidValue`
* -# When block size is 0
* - Expected output: return `hipErrorInvalidValue`
* -# When flag is invalid, because only default flag is supported
* - Platform specific (NVIDIA)
* - Expected output: return `hipErrorInvalidValue`
* Test source
* ------------------------
* - unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Negative_Parameters") {
hipModule_t module;
hipFunction_t function;
Expand Down Expand Up @@ -60,6 +79,21 @@ TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Nega
HIP_CHECK(hipModuleUnload(module));
}

/**
* Test Description
* ------------------------
* - Check if grid size and block size are within valid range using basic kernel functions:
* -# When `dynSharedMemPerBlk = 0`
* - Expected output: return `hipSuccess`
* -# When `dynSharedMemPerBlk = sharedMemPerBlock`
* - Expected output: return `hipSuccess`
* Test source
* ------------------------
* - unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE(
"Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Positive_RangeValidation") {
hipDeviceProp_t devProp;
Expand Down
49 changes: 41 additions & 8 deletions catch/unit/occupancy/hipModuleOccupancyMaxPotentialBlockSize.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
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
Expand All @@ -16,15 +16,33 @@ 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.
*/
/*
Testcase Scenarios :
Unit_hipModuleOccupancyMaxPotentialBlockSize_Positive_RangeValidation - Test correct execution of
hipModuleOccupancyMaxPotentialBlockSize for diffrent parameter values
Unit_hipModuleOccupancyMaxPotentialBlockSize_Negative_Parameters - Test unsuccessful execution of
hipModuleOccupancyMaxPotentialBlockSize api when parameters are invalid
*/

#include "occupancy_common.hh"

/**
* @addtogroup hipModuleOccupancyMaxPotentialBlockSize hipModuleOccupancyMaxPotentialBlockSize
* @{
* @ingroup OccupancyTest
* `hipModuleOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
* hipFunction_t f, size_t dynSharedMemPerBlk, int blockSizeLimit)` -
* Determine the grid and block sizes to achieve maximum occupancy for a kernel.
*/

/**
* Test Description
* ------------------------
* - Validates handling of invalid arguments:
* -# When output pointer to the grid size is `nullptr`
* - Expected output: return `hipErrorInvalidValue`
* -# When output pointer to the block size is `nullptr`
* - Expected output: return `hipErrorInvalidValue`
* Test source
* ------------------------
* - unit/occupancy/hipModuleOccupancyMaxPotentialBlockSize.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSize_Negative_Parameters") {
hipModule_t module;
hipFunction_t function;
Expand All @@ -42,6 +60,21 @@ TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSize_Negative_Parameters") {
HIP_CHECK(hipModuleUnload(module));
}

/**
* Test Description
* ------------------------
* - Check if grid size and block size are within valid range using basic kernel functions:
* -# When `dynSharedMemPerBlk = 0, blockSizeLimit = 0`
* - Expected output: return `hipSuccess`
* -# When `dynSharedMemPerBlk = sharedMemPerBlock, blockSizeLimit = maxThreadsPerBlock`
* - Expected output: return `hipSuccess`
* Test source
* ------------------------
* - unit/occupancy/hipModuleOccupancyMaxPotentialBlockSize.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSize_Positive_RangeValidation") {
hipDeviceProp_t devProp;
hipModule_t module;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
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
Expand All @@ -16,15 +16,36 @@ 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.
*/
/*
Testcase Scenarios :
Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Positive_RangeValidation - Test correct
execution of hipModuleOccupancyMaxPotentialBlockSizeWithFlags for diffrent parameter values
Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Negative_Parameters - Test unsuccessful
execution of hipModuleOccupancyMaxPotentialBlockSizeWithFlags api when parameters are invalid
*/

#include "occupancy_common.hh"

/**
* @addtogroup hipModuleOccupancyMaxPotentialBlockSizeWithFlags hipModuleOccupancyMaxPotentialBlockSizeWithFlags
* @{
* @ingroup OccupancyTest
* `hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
* hipFunction_t f, size_t dynSharedMemPerBlk, int blockSizeLimit, unsigned int flags)` -
* Determine the grid and block sizes to achieves maximum occupancy for a kernel.
*/

/**
* Test Description
* ------------------------
* - Validates handling of invalid arguments:
* -# When output pointer to the grid size is `nullptr`
* - Expected output: return `hipErrorInvalidValue`
* -# When output pointer to the block size is `nullptr`
* - Expected output: return `hipErrorInvalidValue`
* -# When flag is invalid, because only default flag is supported
* - Platform specific (NVIDIA)
* - Expected output: return `hipErrorInvalidValue`
* Test source
* ------------------------
* - unit/occupancy/hipModuleOccupancyMaxPotentialBlockSizeWithFlags.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Negative_Parameters") {
hipModule_t module;
hipFunction_t function;
Expand Down Expand Up @@ -52,6 +73,21 @@ TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Negative_Parame
HIP_CHECK(hipModuleUnload(module));
}

/**
* Test Description
* ------------------------
* - Check if grid size and block size are within valid range using basic kernel functions:
* -# When `dynSharedMemPerBlk = 0, blockSizeLimit = 0`
* - Expected output: return `hipSuccess`
* -# When `dynSharedMemPerBlk = sharedMemPerBlock, blockSizeLimit = maxThreadsPerBlock`
* - Expected output: return `hipSuccess`
* Test source
* ------------------------
* - unit/occupancy/hipModuleOccupancyMaxPotentialBlockSizeWithFlags.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Positive_RangeValidation") {
hipDeviceProp_t devProp;
hipModule_t module;
Expand Down
Loading