SWDEV-470698 - fix formatting, add format check workflow (#657)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5840940caa
Коммит
f7338717ae
@@ -22,6 +22,4 @@ THE SOFTWARE.
|
||||
|
||||
#include "hip/hip_runtime.h"
|
||||
|
||||
extern "C" __global__ void simple_kernel() {
|
||||
printf("Hello World!");
|
||||
}
|
||||
extern "C" __global__ void simple_kernel() { printf("Hello World!"); }
|
||||
|
||||
@@ -35,21 +35,21 @@ const uint32_t kApiNumber{1024};
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Acquires HIP API names and checks that they are valid
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipApiName.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
TEST_CASE("Unit_hipApiName_Positive_Basic") {
|
||||
std::vector<std::string> hip_api_names;
|
||||
|
||||
for(uint32_t i = 0; i < kApiNumber; ++i) {
|
||||
if(strcmp(hipApiName(i), kUnknownApi)) {
|
||||
for (uint32_t i = 0; i < kApiNumber; ++i) {
|
||||
if (strcmp(hipApiName(i), kUnknownApi)) {
|
||||
hip_api_names.emplace_back(hipApiName(i));
|
||||
}
|
||||
}
|
||||
@@ -59,17 +59,17 @@ TEST_CASE("Unit_hipApiName_Positive_Basic") {
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Checks that upper and lower limit IDs are mapped to unknown APIs:
|
||||
* -# When the `uint32_t` upper limit is passed
|
||||
* - Expected output: return "unknown"
|
||||
* -# When the `uint32_t` lower limit is passed
|
||||
* - Expected output: return "unknown"
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipApiName.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
@@ -79,6 +79,6 @@ TEST_CASE("Unit_hipApiName_Negative_ReservedIds") {
|
||||
}
|
||||
|
||||
/**
|
||||
* End doxygen group CallbackTest.
|
||||
* @}
|
||||
*/
|
||||
* End doxygen group CallbackTest.
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -32,14 +32,14 @@ THE SOFTWARE.
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Creates a new stream for each available device
|
||||
* - Verifies that the Device Stream ID is equal to the Device ID
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipGetStreamDeviceId.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
@@ -53,14 +53,14 @@ TEST_CASE("Unit_hipGetStreamDeviceId_Positive_Threaded_Basic") {
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Creates a new stream for each available device, through multiple threads
|
||||
* - Verifies that the Device Stream ID is equal to the Device ID, from each thread
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipGetStreamDeviceId.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
* - Multithreaded GPU
|
||||
@@ -70,7 +70,7 @@ TEST_CASE("Unit_hipGetStreamDeviceId_Positive_Multithreaded_Basic") {
|
||||
const int device_count = HipTest::getDeviceCount();
|
||||
|
||||
auto thread_function = [&]() {
|
||||
for(int id = 0; id < device_count; ++id) {
|
||||
for (int id = 0; id < device_count; ++id) {
|
||||
HIP_CHECK_THREAD(hipSetDevice(id));
|
||||
|
||||
StreamGuard stream_guard{Streams::perThread};
|
||||
@@ -79,12 +79,11 @@ TEST_CASE("Unit_hipGetStreamDeviceId_Positive_Multithreaded_Basic") {
|
||||
};
|
||||
|
||||
std::vector<std::thread> thread_pool;
|
||||
for(unsigned int i = 0; i < max_threads; ++i) {
|
||||
for (unsigned int i = 0; i < max_threads; ++i) {
|
||||
thread_pool.emplace_back(thread_function);
|
||||
}
|
||||
|
||||
for(auto& thread: thread_pool)
|
||||
{
|
||||
for (auto& thread : thread_pool) {
|
||||
thread.join();
|
||||
}
|
||||
|
||||
@@ -93,13 +92,13 @@ TEST_CASE("Unit_hipGetStreamDeviceId_Positive_Multithreaded_Basic") {
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Checks that function returns valid ID if the stream is `nullptr`
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipGetStreamDeviceId.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
@@ -112,6 +111,6 @@ TEST_CASE("Unit_hipGetStreamDeviceId_Negative_Parameters") {
|
||||
}
|
||||
|
||||
/**
|
||||
* End doxygen group CallbackTest.
|
||||
* @}
|
||||
*/
|
||||
* End doxygen group CallbackTest.
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -32,14 +32,14 @@ THE SOFTWARE.
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Loads the simple kernel function from the matching module
|
||||
* - Checks that the valid name is returned for the loaded kernel function
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipKernelNameRef.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
@@ -55,13 +55,13 @@ TEST_CASE("Unit_hipKernelNameRef_Positive_Basic") {
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Checks that the API returns nullptr if the passed function is not loaded
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipKernelNameRef.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
@@ -71,6 +71,6 @@ TEST_CASE("Unit_hipKernelNameRef_Negative_Parameters") {
|
||||
}
|
||||
|
||||
/**
|
||||
* End doxygen group CallbackTest.
|
||||
* @}
|
||||
*/
|
||||
* End doxygen group CallbackTest.
|
||||
* @}
|
||||
*/
|
||||
|
||||
@@ -30,22 +30,20 @@ THE SOFTWARE.
|
||||
* returns the name of passed function pointer on desired stream
|
||||
*/
|
||||
|
||||
__global__ void test_kernel() {
|
||||
return;
|
||||
}
|
||||
__global__ void test_kernel() { return; }
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Creates new stream and a function pointer
|
||||
* - Verifies that valid API name is returned
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipKernelNameRefByPtr.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
TEST_CASE("Unit_hipKernelNameRefByPtr_Positive_Basic") {
|
||||
const void* kernel_ptr{reinterpret_cast<const void*>(&test_kernel)};
|
||||
@@ -56,14 +54,14 @@ TEST_CASE("Unit_hipKernelNameRefByPtr_Positive_Basic") {
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Passes `nullptr` stream while function pointer is valid
|
||||
* - Verifies that the returned value is not `nullptr`
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipKernelNameRefByPtr.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
@@ -76,17 +74,17 @@ TEST_CASE("Unit_hipKernelNameRefByPtr_Negative_StreamNullptr") {
|
||||
|
||||
/**
|
||||
* Test Description
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - Performs validation when the function pointer is `nullptr`
|
||||
* -# When stream is `nullptr`
|
||||
* - Expected output: return `nullptr`
|
||||
* -# When stream is valid
|
||||
* - Expected output: return `nullptr`
|
||||
* Test source
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - unit/callback/hipKernelNameRefByPtr.cc
|
||||
* Test requirements
|
||||
* ------------------------
|
||||
* ------------------------
|
||||
* - HIP_VERSION >= 5.2
|
||||
* - Platform specific (AMD)
|
||||
*/
|
||||
@@ -105,6 +103,6 @@ TEST_CASE("Unit_hipKernelNameRefByPtr_Negative_KernelNullptr") {
|
||||
}
|
||||
|
||||
/**
|
||||
* End doxygen group CallbackTest.
|
||||
* @}
|
||||
*/
|
||||
* End doxygen group CallbackTest.
|
||||
* @}
|
||||
*/
|
||||
|
||||
Ссылка в новой задаче
Block a user