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 Module Management #84

Open
wants to merge 66 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
66 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
7a213be
Create common code for module tests
music-dino Dec 7, 2022
580df9d
Create common code for module tests
music-dino Dec 7, 2022
f40fe6a
Merge branch 'module_common' into hipModuleLoad_tests
music-dino Dec 7, 2022
afa2e93
EXSWHTEC-109 - Implement tests for the hipModuleLoad family of APIs a…
music-dino Dec 7, 2022
4575966
EXSWHTEC-112 - Implement tests for hipModuleGetFunction
music-dino Dec 7, 2022
fb5ecb8
EXSWHTEC-111 - Implement tests for the hipModuleLaunchKernel family o…
music-dino Dec 7, 2022
0e719cb
EXSWHTEC-80 - Implement tests for hipModuleGetGlobal
music-dino Dec 7, 2022
7233aae
EXSWHTEC-113 - Implement tests for hipModuleGetTexRef
music-dino Dec 7, 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
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
26506e5
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 16, 2022
38254e2
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 16, 2022
58d7f00
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 16, 2022
e347b31
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 16, 2022
500b7b8
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 16, 2022
2003fb2
Merge branch 'hipModuleLoad_tests' of github.com:mirza-halilcevic/hip…
milos-mozetic Dec 16, 2022
5112096
Merge branch 'hipModuleGetFunction_tests' of github.com:mirza-halilce…
milos-mozetic Dec 16, 2022
7401c48
Merge branch 'hipModuleLaunchKernel_test' of github.com:mirza-halilce…
milos-mozetic Dec 16, 2022
5a44e86
Merge branch 'hipModuleGetTexRef_tests' of github.com:mirza-halilcevi…
milos-mozetic Dec 16, 2022
e61122f
Merge branch 'hipModuleGetGlobal_tests' of github.com:mirza-halilcevi…
milos-mozetic Dec 16, 2022
a7fd78b
EXSWHTEC-224 - Fix faulty resolved merge conflict
milos-mozetic Dec 16, 2022
b63acf0
EXSWHTEC-224 - Test cases ID clean up and documentation for Module Ma…
milos-mozetic Dec 19, 2022
05e34d3
Merge branch 'develop' into hipModuleLoad_tests
mangupta Mar 3, 2023
8686418
EXSWHTEC-109 - Disable build for Windows, add offload arch and output…
music-dino Mar 6, 2023
8390c65
Merge remote-tracking branch 'upstream/develop' into hipModuleLoad_tests
music-dino Apr 18, 2023
27ca3e2
EXSWHTEC-109 - Separate out negative tests that fail on AMD and disab…
music-dino Apr 18, 2023
77b2d58
EXSWHTEC-109 - Separate out negative tests for hipModuleUnload that f…
music-dino Apr 18, 2023
83e6499
Merge remote-tracking branch 'upstream/develop' into hipModuleGetGlob…
music-dino Apr 18, 2023
f092b57
EXSWHTEC-80 - Separate out tests that fail on AMD and disable them vi…
music-dino Apr 18, 2023
6358ee7
Merge remote-tracking branch 'upstream/develop' into hipModuleGetTexR…
music-dino Apr 18, 2023
cdc37a6
EXSWHTEC-113 - Separate out tests that fail on AMD and disable them v…
music-dino Apr 18, 2023
5af6b19
Merge branch 'develop' into doxygen_module_management_documentation
milos-mozetic Jun 22, 2023
015d7e4
Merge branch 'develop' into hipModuleLoad_tests
music-dino Jun 26, 2023
f80a7af
Merge branch 'develop' into hipModuleGetFunction_tests
music-dino Jun 26, 2023
bda9a89
Merge branch 'develop' into hipModuleLaunchKernel_test
music-dino Jun 26, 2023
b261ecf
Merge branch 'develop' into hipModuleLoad_tests
mangupta Jul 10, 2023
afdf15b
Update CMakeLists.txt
mangupta Jul 10, 2023
2fbb319
Update CMakeLists.txt
mangupta Jul 10, 2023
e1f2434
Update CMakeLists.txt
mangupta Jul 10, 2023
95b3d8c
Merge remote-tracking branch 'upstream/develop' into hipModuleLaunchK…
mirza-halilcevic Dec 28, 2023
2b4b804
Remove conflict marker.
mirza-halilcevic Dec 28, 2023
4e58bdc
Merge branch 'develop' into hipModuleGetFunction_tests
mirza-halilcevic Dec 28, 2023
a2c575b
Merge remote-tracking branch 'upstream/develop' into hipModuleLoad_tests
mirza-halilcevic Dec 28, 2023
8a7774f
Merge remote-tracking branch 'upstream/develop' into hipModuleGetGlob…
mirza-halilcevic Dec 28, 2023
2a481ba
Fix typo.
mirza-halilcevic Dec 28, 2023
f868f4b
Merge remote-tracking branch 'origin/develop' into hipModuleGetTexRef…
mirza-halilcevic Dec 28, 2023
73eedc2
Merge branch 'develop' into hipModuleLoad_tests
mirza-halilcevic Feb 18, 2024
4eb7814
Merge branch 'develop' into hipModuleGetFunction_tests
mirza-halilcevic Feb 18, 2024
a90b0b3
Merge branch 'develop' into hipModuleLaunchKernel_test
mirza-halilcevic Feb 18, 2024
dd315d4
Merge branch 'develop' into hipModuleGetGlobal_tests
mirza-halilcevic Feb 18, 2024
2c681b2
Merge branch 'develop' into hipModuleGetTexRef_tests
mirza-halilcevic Feb 18, 2024
cf96947
Merge remote-tracking branch 'origin/hipModuleGetFunction_tests' into…
mirza-halilcevic Feb 18, 2024
58acfe0
Merge remote-tracking branch 'origin/hipModuleLaunchKernel_test' into…
mirza-halilcevic Feb 18, 2024
8b5faf3
Merge remote-tracking branch 'origin/hipModuleGetGlobal_tests' into m…
mirza-halilcevic Feb 18, 2024
6cf67ec
Merge remote-tracking branch 'origin/hipModuleGetTexRef_tests' into m…
mirza-halilcevic Feb 18, 2024
4943554
Merge branch 'module_management_merged' into doxygen_module_managemen…
mirza-halilcevic Feb 18, 2024
0f2a549
Merge remote-tracking branch 'origin/develop' into doxygen_module_man…
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
2,540 changes: 2,540 additions & 0 deletions catch/DoxyfileTests

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions catch/include/hip_test_defgroups.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Copyright (c) 2021 - 2022 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.
*/

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

/**
* @defgroup CallbackTest Callback Activity APIs
* @{
* This section describes tests for the callback/Activity of HIP runtime API.
* @}
*/

/**
* @defgroup GraphTest Graph Management
* @{
* This section describes the graph management types & functions of HIP runtime API.
* @}
*/

/**
* @defgroup ModuleTest Module Management
* @{
* This section describes tests for the module management functions of HIP runtime API.
* @}
*/
1 change: 1 addition & 0 deletions catch/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ add_subdirectory(multiThread)
add_subdirectory(compiler)
add_subdirectory(errorHandling)
add_subdirectory(cooperativeGrps)
add_subdirectory(module)
#if(HIP_PLATFORM STREQUAL "amd")
#add_subdirectory(clock)
#endif()
57 changes: 57 additions & 0 deletions catch/unit/module/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
set(TEST_SRC
hip_module_common.cc
hipModuleLoad.cc
hipModuleLoadData.cc
hipModuleLoadDataEx.cc
hipModuleUnload.cc
hipModuleGetFunction.cc
hipModuleLaunchKernel.cc
hipModuleGetGlobal.cc
hipModuleGetTexRef.cc
)

configure_file(not_a_module.txt not_a_module.txt)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_module.code
COMMAND ${CMAKE_CXX_COMPILER} --genco --std=c++17 ${CMAKE_CURRENT_SOURCE_DIR}/empty_module.cc -o empty_module.code
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/empty_module.cc)
add_custom_target(empty_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/empty_module.code)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code
COMMAND ${CMAKE_CXX_COMPILER} --genco --std=c++17 ${CMAKE_CURRENT_SOURCE_DIR}/get_function_module.cc -o get_function_module.code
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/get_function_module.cc)
add_custom_target(get_function_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code)

if(HIP_PLATFORM MATCHES "amd")
set(TEST_SRC ${TEST_SRC} hipExtModuleLaunchKernel.cc)
endif()

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code
COMMAND ${CMAKE_CXX_COMPILER} --genco --std=c++17 ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc -o launch_kernel_module.code
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc)
add_custom_target(launch_kernel_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_global_test_module.code
COMMAND ${CMAKE_CXX_COMPILER} --genco --std=c++17 ${CMAKE_CURRENT_SOURCE_DIR}/get_global_test_module.cc -o get_global_test_module.code
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/get_global_test_module.cc)
add_custom_target(get_global_test_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/get_global_test_module.code)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_tex_ref_module.code
COMMAND ${CMAKE_CXX_COMPILER} --genco --std=c++17 ${CMAKE_CURRENT_SOURCE_DIR}/get_tex_ref_module.cc -o get_tex_ref_module.code
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/get_tex_ref_module.cc)
add_custom_target(get_tex_ref_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/get_tex_ref_module.code)

if(HIP_PLATFORM MATCHES "amd")
set(RTCLIB "hiprtc")
else()
set(RTCLIB "nvrtc")
endif()
hip_add_exe_to_target(NAME ModuleTest
TEST_SRC ${TEST_SRC}
TEST_TARGET_NAME build_tests
LINKER_LIBS ${RTCLIB})
add_dependencies(ModuleTest empty_module)
add_dependencies(ModuleTest get_function_module)
add_dependencies(ModuleTest launch_kernel_module)
add_dependencies(ModuleTest get_tex_ref_module)
add_dependencies(MemoryTest get_global_test_module)
20 changes: 20 additions & 0 deletions catch/unit/module/empty_module.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Copyright (c) 2022 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.
*/
28 changes: 28 additions & 0 deletions catch/unit/module/get_function_module.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
Copyright (c) 2022 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.
*/

#include <hip/hip_runtime_api.h>

extern "C" {
__global__ void GlobalKernel() {}

__device__ void DeviceKernel() {}
}
42 changes: 42 additions & 0 deletions catch/unit/module/get_global_test_module.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
Copyright (c) 2022 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.
*/

#include "hip/hip_runtime.h"
#include "hip/hip_runtime_api.h"

#include "hipModuleGetGlobal.hh"

#define HIP_MODULE_GET_GLOBAL_TEST_DEFINE_DEVICE_GLOBALS(type) \
__device__ type type##_var = 0; \
__device__ type type##_arr[kArraySize] = {}; \
extern "C" { \
__global__ void type##_var_address_validation_kernel(void* ptr, bool* out) { \
*out = static_cast<void*>(&type##_var) == ptr; \
} \
__global__ void type##_arr_address_validation_kernel(void* ptr, bool* out) { \
*out = static_cast<void*>(type##_arr) == ptr; \
} \
}

HIP_MODULE_GET_GLOBAL_TEST_DEFINE_DEVICE_GLOBALS(int)
HIP_MODULE_GET_GLOBAL_TEST_DEFINE_DEVICE_GLOBALS(float)
HIP_MODULE_GET_GLOBAL_TEST_DEFINE_DEVICE_GLOBALS(char)
HIP_MODULE_GET_GLOBAL_TEST_DEFINE_DEVICE_GLOBALS(double)
24 changes: 24 additions & 0 deletions catch/unit/module/get_tex_ref_module.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright (c) 2022 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.
*/

#include <hip/hip_runtime_api.h>

texture<float, 2> tex;
Loading