EXSWHTEC-224 - Test cases ID clean up and documentation for Device Management (#70)
- Test cases ID clean up and documentation for Device Management - Adjust doxygen comments to fix bugs - Adjust defgroup comments for test modules
This commit is contained in:
@@ -24,6 +24,16 @@ THE SOFTWARE.
|
||||
#include <hip/hip_runtime_api.h>
|
||||
#include <threaded_zig_zag_test.hh>
|
||||
|
||||
/**
|
||||
* @addtogroup hipDeviceSetMemPool hipDeviceSetMemPool
|
||||
* @{
|
||||
* @ingroup DeviceTest
|
||||
* `hipDeviceSetMemPool(int device, hipMemPool_t mem_pool)` -
|
||||
* Sets the current memory pool of a device.
|
||||
*
|
||||
* The memory pool must be local to the specified device.
|
||||
*/
|
||||
|
||||
static inline bool CheckMemPoolSupport(const int device) {
|
||||
int mem_pool_support = 0;
|
||||
HIP_CHECK(
|
||||
@@ -50,6 +60,18 @@ static inline hipMemPool_t CreateMemPool(const int device) {
|
||||
return mem_pool;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* - Validate behaviour when the valid MemPool is used, for multiple devices.
|
||||
* Test source
|
||||
* ------------------------
|
||||
* - unit/device/hipDeviceSetGetMemPool.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* - Platform specific (AMD)
|
||||
* - HIP_VERSION >= 5.2
|
||||
*/
|
||||
TEST_CASE("Unit_hipDeviceSetMemPool_Positive_Basic") {
|
||||
const int device = GENERATE(range(0, HipTest::getDeviceCount()));
|
||||
|
||||
@@ -63,6 +85,24 @@ TEST_CASE("Unit_hipDeviceSetMemPool_Positive_Basic") {
|
||||
HIP_CHECK(hipMemPoolDestroy(mem_pool));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* - Validate handling of invalid arguments:
|
||||
* -# When pointer to MemPool is `nullptr`
|
||||
* - Expected output: return `hipErrorInvalidValue`
|
||||
* -# When device ID is equal to -1
|
||||
* - Expected output: return `hipErrorInvalidValue`
|
||||
* -# When device ID is out of bounds
|
||||
* - Expected output: return `hipErrorInvalidValue`
|
||||
* Test source
|
||||
* ------------------------
|
||||
* - unit/device/hipDeviceSetGetMemPool.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* - Platform specific (AMD)
|
||||
* - HIP_VERSION >= 5.2
|
||||
*/
|
||||
TEST_CASE("Unit_hipDeviceSetMemPool_Negative_Parameters") {
|
||||
hipMemPool_t mem_pool;
|
||||
HIP_CHECK(hipDeviceGetDefaultMemPool(&mem_pool, 0));
|
||||
@@ -80,6 +120,31 @@ TEST_CASE("Unit_hipDeviceSetMemPool_Negative_Parameters") {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* End doxygen group hipDeviceSetMemPool.
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup hipDeviceGetMemPool hipDeviceGetMemPool
|
||||
* @{
|
||||
* @ingroup DeviceTest
|
||||
* `hipDeviceGetMemPool(hipMemPool_t* mem_pool, int device)` -
|
||||
* Gets the current memory pool for the specified device
|
||||
*/
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* - Checks that returned MemPool is the default MemPool.
|
||||
* Test source
|
||||
* ------------------------
|
||||
* - unit/device/hipDeviceSetGetMemPool.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* - Platform specific (AMD)
|
||||
* - HIP_VERSION >= 5.2
|
||||
*/
|
||||
TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Default") {
|
||||
const int device = GENERATE(range(0, HipTest::getDeviceCount()));
|
||||
|
||||
@@ -96,6 +161,18 @@ TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Default") {
|
||||
REQUIRE(mem_pool == default_mem_pool);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* - Checks that returned MemPool is equal to the mempool that is set.
|
||||
* Test source
|
||||
* ------------------------
|
||||
* - unit/device/hipDeviceSetGetMemPool.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* - Platform specific (AMD)
|
||||
* - HIP_VERSION >= 5.2
|
||||
*/
|
||||
TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Basic") {
|
||||
const int device = GENERATE(range(0, HipTest::getDeviceCount()));
|
||||
|
||||
@@ -114,6 +191,18 @@ TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Basic") {
|
||||
HIP_CHECK(hipMemPoolDestroy(mem_pool));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* - Checks that returned MemPool is equal to the mempool that is set from a different thread.
|
||||
* Test source
|
||||
* ------------------------
|
||||
* - unit/device/hipDeviceSetGetMemPool.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* - Platform specific (AMD)
|
||||
* - HIP_VERSION >= 5.2
|
||||
*/
|
||||
TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Threaded") {
|
||||
class HipDeviceGetMemPoolTest : public ThreadedZigZagTest<HipDeviceGetMemPoolTest> {
|
||||
public:
|
||||
@@ -141,6 +230,24 @@ TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Threaded") {
|
||||
test.run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* - Validates handling of invalid arguments:
|
||||
* -# When output pointer to the MemPool is `nullptr`
|
||||
* - Expected output: return `hipErrorInvalidValue`
|
||||
* -# When device ID is equal to -1
|
||||
* - Expected output: return `hipErrorInvalidValue`
|
||||
* -# When device ID is out of bounds
|
||||
* - Expected output: return `hipErrorInvalidValue`
|
||||
* Test source
|
||||
* ------------------------
|
||||
* - unit/device/hipDeviceSetGetMemPool.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* - Platform specific (AMD)
|
||||
* - HIP_VERSION >= 5.2
|
||||
*/
|
||||
TEST_CASE("Unit_hipDeviceGetMemPool_Negative_Parameters") {
|
||||
hipMemPool_t mem_pool;
|
||||
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user