From dc726cd5158ae8453a08930d4d80504e582ab21a Mon Sep 17 00:00:00 2001 From: Ameya Keshava Mallya Date: Tue, 17 Mar 2026 21:43:18 +0000 Subject: [PATCH] Patch back from rocm-systems --- catch/ABM/AddKernels/CMakeLists.txt | 5 + catch/ABM/AddKernels/add.cc | 8 +- catch/ABM/CMakeLists.txt | 4 + catch/CMakeLists.txt | 313 +++++----- catch/README.md | 66 ++- catch/TypeQualifiers/CMakeLists.txt | 4 + catch/TypeQualifiers/hipManagedKeyword.cc | 34 +- catch/cmake/hip-tests.cmake | 21 +- catch/cmake/relative_paths.py | 72 ++- .../config/__pycache__/common.cpython-310.pyc | Bin 1406 -> 0 bytes catch/hipTestMain/CMakeLists.txt | 37 +- catch/hipTestMain/config/config_amd_linux | 54 +- catch/hipTestMain/config/config_amd_windows | 41 +- catch/hipTestMain/config/config_amd_wsl.json | 16 - .../config/config_nvidia_linux.json | 2 +- catch/hipTestMain/hip_test_context.cc | 19 +- catch/hipTestMain/hip_test_features.cc | 19 +- catch/hipTestMain/main.cc | 24 +- catch/include/cmd_options.hh | 25 +- catch/include/cpu_grid.h | 33 +- catch/include/hipMallocManagedCommon.hh | 19 +- catch/include/hip_array_common.hh | 23 +- catch/include/hip_test_checkers.hh | 24 +- catch/include/hip_test_common.hh | 26 +- catch/include/hip_test_context.hh | 68 +-- catch/include/hip_test_defgroups.hh | 24 +- catch/include/hip_test_features.hh | 24 +- catch/include/hip_test_filesystem.hh | 25 +- catch/include/hip_test_helper.hh | 24 +- catch/include/hip_test_kernels.hh | 24 +- catch/include/hip_test_process.hh | 24 +- catch/include/hip_test_rtc.hh | 24 +- catch/include/hip_test_smi.hh | 24 +- catch/include/hip_texture_helper.hh | 19 +- catch/include/kernel_mapping.hh | 21 +- catch/include/kernels.hh | 21 +- catch/include/memcpy1d_tests_common.hh | 24 +- catch/include/memcpy3d_tests_common.hh | 24 +- catch/include/performance_common.hh | 24 +- catch/include/resource_guards.hh | 21 +- catch/include/threaded_zig_zag_test.hh | 22 +- catch/include/utils.hh | 21 +- catch/include/warp_common.hh | 26 +- catch/kernels/CMakeLists.txt | 14 +- catch/kernels/Set.cpp | 19 +- catch/kernels/vectorADD.inl | 19 +- catch/multiproc/CMakeLists.txt | 24 +- catch/multiproc/childMalloc.cc | 21 +- catch/multiproc/deviceAllocationMproc.cc | 29 +- catch/multiproc/dummy_kernel.cpp | 24 +- .../hipDeviceComputeCapabilityMproc.cc | 23 +- catch/multiproc/hipDeviceGetPCIBusIdMproc.cc | 23 +- catch/multiproc/hipDeviceTotalMemMproc.cc | 23 +- catch/multiproc/hipGetDeviceAttributeMproc.cc | 26 +- catch/multiproc/hipGetDeviceCountMproc.cc | 23 +- .../multiproc/hipGetDevicePropertiesMproc.cc | 26 +- catch/multiproc/hipIpcEventHandle.cc | 25 +- catch/multiproc/hipIpcMemAccessTest.cc | 25 +- catch/multiproc/hipMallocConcurrencyMproc.cc | 25 +- catch/multiproc/hipMemCoherencyTstMProc.cc | 43 +- catch/multiproc/hipMemGetInfoMProc.cc | 36 +- catch/multiproc/hipNoGpuTsts.cc | 173 +++--- catch/multiproc/hipSetGetDeviceMproc.cc | 31 +- catch/packaging/CMakeLists.txt | 21 +- catch/performance/CMakeLists.txt | 20 +- catch/performance/event/CMakeLists.txt | 20 +- catch/performance/event/hipEventCreate.cc | 23 +- .../event/hipEventCreateWithFlags.cc | 23 +- catch/performance/event/hipEventDestroy.cc | 23 +- .../performance/event/hipEventElapsedTime.cc | 23 +- catch/performance/event/hipEventQuery.cc | 23 +- catch/performance/event/hipEventRecord.cc | 23 +- .../performance/event/hipEventSynchronize.cc | 23 +- catch/performance/example/CMakeLists.txt | 20 +- catch/performance/example/example.cc | 26 +- catch/performance/kernelLaunch/CMakeLists.txt | 20 +- .../kernelLaunch/hipExtLaunchKernel.cc | 26 +- .../kernelLaunch/hipExtLaunchKernelGGL.cc | 23 +- .../hipLaunchCooperativeKernel.cc | 26 +- .../kernelLaunch/hipLaunchKernel.cc | 26 +- .../kernelLaunch/kernel_launch_common.cc | 24 +- .../kernelLaunch/kernel_launch_common.hh | 24 +- .../kernelLaunch/triple_chevron.cc | 26 +- catch/performance/memcpy/CMakeLists.txt | 20 +- catch/performance/memcpy/hipMemcpy.cc | 31 +- catch/performance/memcpy/hipMemcpy2D.cc | 31 +- catch/performance/memcpy/hipMemcpy2DAsync.cc | 31 +- .../memcpy/hipMemcpy2DFromArray.cc | 27 +- .../memcpy/hipMemcpy2DFromArrayAsync.cc | 27 +- .../performance/memcpy/hipMemcpy2DToArray.cc | 27 +- .../memcpy/hipMemcpy2DToArrayAsync.cc | 27 +- catch/performance/memcpy/hipMemcpy3D.cc | 31 +- catch/performance/memcpy/hipMemcpy3DAsync.cc | 31 +- catch/performance/memcpy/hipMemcpyAsync.cc | 31 +- catch/performance/memcpy/hipMemcpyAtoH.cc | 23 +- catch/performance/memcpy/hipMemcpyDtoD.cc | 25 +- .../performance/memcpy/hipMemcpyDtoDAsync.cc | 25 +- catch/performance/memcpy/hipMemcpyDtoH.cc | 23 +- .../performance/memcpy/hipMemcpyDtoHAsync.cc | 23 +- .../performance/memcpy/hipMemcpyFromSymbol.cc | 27 +- .../memcpy/hipMemcpyFromSymbolAsync.cc | 27 +- catch/performance/memcpy/hipMemcpyHtoA.cc | 23 +- catch/performance/memcpy/hipMemcpyHtoD.cc | 23 +- .../performance/memcpy/hipMemcpyHtoDAsync.cc | 23 +- catch/performance/memcpy/hipMemcpyParam2D.cc | 31 +- .../memcpy/hipMemcpyParam2DAsync.cc | 31 +- catch/performance/memcpy/hipMemcpyToSymbol.cc | 27 +- .../memcpy/hipMemcpyToSymbolAsync.cc | 27 +- .../performance/memcpy/hipMemcpyWithKernel.cc | 26 +- .../performance/memcpy/hipMemcpyWithStream.cc | 31 +- .../memcpy/memcpy_performance_common.hh | 21 +- catch/performance/memset/CMakeLists.txt | 20 +- catch/performance/memset/hipMemset.cc | 26 +- catch/performance/memset/hipMemset2D.cc | 26 +- catch/performance/memset/hipMemset2DAsync.cc | 26 +- catch/performance/memset/hipMemset3D.cc | 26 +- catch/performance/memset/hipMemset3DAsync.cc | 26 +- catch/performance/memset/hipMemsetAsync.cc | 26 +- catch/performance/memset/hipMemsetD16.cc | 26 +- catch/performance/memset/hipMemsetD16Async.cc | 26 +- catch/performance/memset/hipMemsetD32.cc | 26 +- catch/performance/memset/hipMemsetD32Async.cc | 26 +- catch/performance/memset/hipMemsetD8.cc | 26 +- catch/performance/memset/hipMemsetD8Async.cc | 26 +- catch/performance/stream/CMakeLists.txt | 20 +- .../stream/hipExtStreamCreateWithCUMask.cc | 23 +- .../stream/hipExtStreamGetCUMask.cc | 23 +- catch/performance/stream/hipFreeAsync.cc | 23 +- catch/performance/stream/hipMallocAsync.cc | 23 +- .../stream/hipMallocFromPoolAsync.cc | 23 +- catch/performance/stream/hipMemPoolCreate.cc | 23 +- catch/performance/stream/hipMemPoolDestroy.cc | 23 +- .../stream/hipMemPoolExportPointer.cc | 23 +- .../hipMemPoolExportToShareableHandle.cc | 23 +- .../performance/stream/hipMemPoolGetAccess.cc | 23 +- .../stream/hipMemPoolGetAttribute.cc | 23 +- .../hipMemPoolImportFromShareableHandle.cc | 23 +- .../stream/hipMemPoolImportPointer.cc | 23 +- .../performance/stream/hipMemPoolSetAccess.cc | 23 +- .../stream/hipMemPoolSetAttribute.cc | 23 +- catch/performance/stream/hipMemPoolTrimTo.cc | 23 +- .../stream/hipStreamAddCallback.cc | 23 +- catch/performance/stream/hipStreamBasic.cc | 35 +- catch/performance/stream/hipStreamGetFlags.cc | 23 +- .../stream/hipStreamGetPriority.cc | 23 +- .../performance/stream/hipStreamWaitEvent.cc | 23 +- .../performance/stream/hipStreamWaitValue.cc | 25 +- .../performance/stream/hipStreamWriteValue.cc | 25 +- .../stream/mem_pools_performance_common.hh | 21 +- catch/performance/warpSync/CMakeLists.txt | 20 +- catch/performance/warpSync/warpSync.cc | 34 +- catch/perftests/CMakeLists.txt | 20 +- catch/perftests/compute/CMakeLists.txt | 20 +- catch/perftests/compute/hipPerfDotProduct.cc | 21 +- catch/perftests/compute/hipPerfMandelbrot.cc | 21 +- catch/perftests/dispatch/CMakeLists.txt | 20 +- .../dispatch/hipPerfDispatchSpeed.cc | 21 +- catch/perftests/event/CMakeLists.txt | 21 +- catch/perftests/event/hipEventOverFlowPerf.cc | 25 +- catch/perftests/event/hipKernelLookUpPerf.cc | 25 +- catch/perftests/graph/CMakeLists.txt | 19 +- catch/perftests/graph/hipGraphTopology.cc | 31 +- catch/perftests/graph/hipPerfGraphLaunch.cc | 31 +- catch/perftests/graph/parallelGraph.cc | 27 +- catch/perftests/memory/CMakeLists.txt | 20 +- catch/perftests/memory/FindNUMA.cmake | 20 +- .../hipPerfBufferCopyInterGpuPerformance.cc | 23 +- .../memory/hipPerfBufferCopyRectSpeed.cc | 29 +- .../memory/hipPerfBufferCopySpeed.cc | 29 +- .../memory/hipPerfBufferCopySpeedAll2All.cc | 37 +- .../memory/hipPerfBufferCopySpeedP2P.cc | 65 +-- .../memory/hipPerfDevMemReadSpeed.cc | 29 +- .../memory/hipPerfDevMemWriteSpeed.cc | 29 +- .../memory/hipPerfDeviceHeapMemory.cc | 24 +- .../perftests/memory/hipPerfHostNumaAlloc.cc | 29 +- .../memory/hipPerfHostNumaAllocWin.cc | 23 +- catch/perftests/memory/hipPerfMemFill.cc | 27 +- .../memory/hipPerfMemMallocCpyFree.cc | 29 +- catch/perftests/memory/hipPerfMemcpy.cc | 27 +- .../memory/hipPerfMemcpyAsyncSpeed.cc | 24 +- catch/perftests/memory/hipPerfMempool.cc | 23 +- catch/perftests/memory/hipPerfMemset.cc | 27 +- .../memory/hipPerfMemsetAsyncSpeed.cc | 24 +- catch/perftests/memory/hipPerfSampleRate.cc | 27 +- .../memory/hipPerfSharedMemReadSpeed.cc | 27 +- catch/perftests/stream/CMakeLists.txt | 20 +- .../stream/hipPerfDeviceConcurrency.cc | 21 +- .../hipPerfIncreasingNumberOfStreams.cc | 21 +- .../stream/hipPerfMultiStreamKernelLaunch.cc | 21 +- .../stream/hipPerfStreamConcurrency.cc | 21 +- .../stream/hipPerfStreamCreateCopyDestroy.cc | 21 +- catch/perftests/vmm/CMakeLists.txt | 20 +- catch/perftests/vmm/hipPerfVMMAlloc.cc | 23 +- catch/stress/CMakeLists.txt | 4 + catch/stress/deviceallocation/CMakeLists.txt | 4 + .../Stress_deviceAllocationStress.cc | 48 +- catch/stress/memory/CMakeLists.txt | 4 + .../stress/memory/hipHmmOvrSubscriptionTst.cc | 26 +- catch/stress/memory/hipHostMallocStress.cc | 25 +- catch/stress/memory/hipHostRegisterStress.cc | 26 +- catch/stress/memory/hipMalloc.cc | 21 +- catch/stress/memory/hipMallocConcurrency.cc | 27 +- catch/stress/memory/hipMallocManagedStress.cc | 27 +- .../memory/hipMemPrftchAsyncStressTst.cc | 23 +- catch/stress/memory/hipMemcpyMThreadMSize.cc | 23 +- catch/stress/memory/hold_memory.cc | 19 +- catch/stress/memory/memcpy.cc | 8 +- catch/stress/module/CMakeLists.txt | 4 + catch/stress/module/hipModuleLoadUnload.cc | 21 +- catch/stress/printf/CMakeLists.txt | 4 + .../printf/Stress_printf_ComplexKernels.cc | 28 +- .../printf/Stress_printf_SimpleKernels.cc | 41 +- catch/stress/printf/printf_common.h | 24 +- catch/stress/stream/CMakeLists.txt | 4 + catch/stress/stream/Stress_hipStreamCreate.cc | 27 +- catch/stress/stream/streamEnqueue.cc | 25 +- catch/unit/CMakeLists.txt | 45 +- catch/unit/assertion/CMakeLists.txt | 21 +- catch/unit/assertion/assert.cc | 25 +- catch/unit/assertion/constexpr_assert.cc | 59 -- catch/unit/assertion/static_assert.cc | 25 +- .../static_assert_kernels_negative.cc | 21 +- .../static_assert_kernels_positive.cc | 21 +- .../assertion/static_assert_kernels_rtc.hh | 21 +- catch/unit/atomics/CMakeLists.txt | 20 +- .../__hip_atomic_compare_exchange_strong.cc | 28 +- catch/unit/atomics/__hip_atomic_exchange.cc | 28 +- catch/unit/atomics/__hip_atomic_fetch_add.cc | 28 +- catch/unit/atomics/__hip_atomic_fetch_and.cc | 36 +- catch/unit/atomics/__hip_atomic_fetch_max.cc | 36 +- catch/unit/atomics/__hip_atomic_fetch_min.cc | 36 +- catch/unit/atomics/__hip_atomic_fetch_or.cc | 36 +- catch/unit/atomics/__hip_atomic_fetch_xor.cc | 36 +- catch/unit/atomics/acquire_release.cc | 44 +- catch/unit/atomics/arithmetic_common.hh | 24 +- catch/unit/atomics/atomicAdd.cc | 30 +- .../atomics/atomicAdd_negative_kernels.cc | 24 +- .../atomics/atomicAdd_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicAdd_system.cc | 32 +- catch/unit/atomics/atomicAnd.cc | 38 +- .../atomics/atomicAnd_negative_kernels.cc | 24 +- .../atomics/atomicAnd_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicAnd_system.cc | 30 +- catch/unit/atomics/atomicCAS.cc | 30 +- .../atomics/atomicCAS_negative_kernels.cc | 24 +- .../atomics/atomicCAS_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicCAS_system.cc | 32 +- catch/unit/atomics/atomicDec.cc | 30 +- .../atomics/atomicDec_negative_kernels.cc | 24 +- .../atomics/atomicDec_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicExch.cc | 32 +- catch/unit/atomics/atomicExch_common.hh | 24 +- .../atomics/atomicExch_negative_kernels.cc | 24 +- .../atomicExch_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicExch_system.cc | 32 +- .../atomicExch_system_negative_kernels.cc | 24 +- .../atomicExch_system_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicInc.cc | 30 +- .../atomics/atomicInc_negative_kernels.cc | 24 +- .../atomics/atomicInc_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicMax.cc | 32 +- .../atomics/atomicMax_negative_kernels.cc | 24 +- .../atomics/atomicMax_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicMax_system.cc | 30 +- catch/unit/atomics/atomicMin.cc | 32 +- .../atomics/atomicMin_negative_kernels.cc | 24 +- .../atomics/atomicMin_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicMin_system.cc | 30 +- catch/unit/atomics/atomicOr.cc | 32 +- .../unit/atomics/atomicOr_negative_kernels.cc | 24 +- .../atomics/atomicOr_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicOr_system.cc | 30 +- catch/unit/atomics/atomicSub.cc | 30 +- .../atomics/atomicSub_negative_kernels.cc | 24 +- .../atomics/atomicSub_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicSub_system.cc | 32 +- catch/unit/atomics/atomicXor.cc | 32 +- .../atomics/atomicXor_negative_kernels.cc | 24 +- .../atomics/atomicXor_negative_kernels_rtc.hh | 24 +- catch/unit/atomics/atomicXor_system.cc | 30 +- catch/unit/atomics/atomic_builtin_kernels.cc | 24 +- catch/unit/atomics/atomic_builtins.cc | 26 +- .../atomics/atomic_builtins_kernels_rtc.hh | 24 +- catch/unit/atomics/bitwise_common.hh | 24 +- catch/unit/atomics/memory_order_common.hh | 24 +- catch/unit/atomics/min_max_common.hh | 24 +- catch/unit/atomics/safeAtomicAdd.cc | 28 +- catch/unit/atomics/safeAtomicMax.cc | 36 +- catch/unit/atomics/safeAtomicMin.cc | 36 +- catch/unit/atomics/sequential_consistency.cc | 44 +- catch/unit/atomics/unsafeAtomicAdd.cc | 30 +- catch/unit/atomics/unsafeAtomicMax.cc | 36 +- catch/unit/atomics/unsafeAtomicMin.cc | 36 +- catch/unit/c_compilation/CMakeLists.txt | 42 +- catch/unit/c_compilation/hipGetDeviceProp.c | 21 +- catch/unit/c_compilation/hipGetDeviceProp.cc | 23 +- catch/unit/callback/CMakeLists.txt | 22 +- catch/unit/callback/SimpleKernel.cc | 24 +- catch/unit/callback/hipApiName.cc | 28 +- catch/unit/callback/hipGetStreamDeviceId.cc | 31 +- catch/unit/callback/hipKernelNameRef.cc | 28 +- catch/unit/callback/hipKernelNameRefByPtr.cc | 30 +- catch/unit/channelDescriptor/CMakeLists.txt | 20 +- .../channelDescriptor/channel_descriptor.cc | 33 +- .../channel_descriptor_common.hh | 21 +- catch/unit/clock/CMakeLists.txt | 20 +- catch/unit/clock/hipClockCheck.cc | 27 +- catch/unit/compileAndCaptureOutput.py | 20 +- catch/unit/compiler/CMakeLists.txt | 4 + catch/unit/compiler/hipClassKernel.cc | 38 +- catch/unit/compiler/hipClassKernel.h | 25 +- catch/unit/compiler/hipSpirvTest.cc | 26 +- catch/unit/compiler/hipSquare.cc | 25 +- catch/unit/compiler/hipSquareGenericTarget.cc | 31 +- catch/unit/complex/CMakeLists.txt | 94 ++- catch/unit/complex/complex.cc | 47 +- catch/unit/complex/complex_basic_common.hh | 22 +- .../complex/complex_cast_negative_kernels.cc | 21 +- .../complex_cast_negative_kernels_rtc.hh | 21 +- catch/unit/complex/complex_function_common.hh | 22 +- .../complex/complex_make_negative_kernels.cc | 21 +- .../complex_make_negative_kernels_rtc.hh | 21 +- .../complex_negative_kernels_1Arg_double.cc | 21 +- .../complex_negative_kernels_1Arg_float.cc | 21 +- .../complex_negative_kernels_1Arg_rtc.hh | 21 +- .../complex_negative_kernels_2Arg_double.cc | 21 +- .../complex_negative_kernels_2Arg_float.cc | 21 +- .../complex_negative_kernels_2Arg_rtc.hh | 21 +- .../complex/complex_negative_kernels_3Arg.cc | 21 +- .../complex_negative_kernels_3Arg_rtc.hh | 21 +- catch/unit/context/CMakeLists.txt | 22 +- catch/unit/context/hipCtxActivate.cc | 21 +- catch/unit/context/hipCtxNotSupported.cc | 35 +- catch/unit/context/hipDrvGetPCIBusId.cc | 25 +- catch/unit/context/hipDrvMemcpy.cc | 24 +- catch/unit/context/hipMemsetD8.cc | 24 +- catch/unit/cooperativeGrps/CMakeLists.txt | 36 +- .../unit/cooperativeGrps/binary_partition.cc | 23 +- catch/unit/cooperativeGrps/cg_any_all.cc | 29 +- catch/unit/cooperativeGrps/cg_ballot.cc | 25 +- .../unit/cooperativeGrps/cg_common_kernels.hh | 21 +- catch/unit/cooperativeGrps/coalesced_group.cc | 36 +- .../coalesced_group_tiled_partition.cc | 31 +- .../coalesced_groups_shfl_down_old.cc | 27 +- .../coalesced_groups_shfl_up_old.cc | 27 +- .../coalesced_tiled_groups_metagrp.cc | 27 +- .../cooperative_groups_common.hh | 21 +- catch/unit/cooperativeGrps/grid_group.cc | 28 +- .../hipCGCoalescedGroups_old.cc | 26 +- .../cooperativeGrps/hipCGGridGroupType_old.cc | 31 +- .../hipCGMultiGridGroupType_old.cc | 29 +- .../hipCGThreadBlockTileTypeShfl_old.cc | 27 +- .../hipCGThreadBlockType_old.cc | 27 +- .../hipCGTiledPartitionType_old.cc | 27 +- ...pLaunchCooperativeKernelMultiDevice_old.cc | 24 +- .../hipLaunchCooperativeKernel_old.cc | 26 +- catch/unit/cooperativeGrps/hip_cg_common.hh | 24 +- .../unit/cooperativeGrps/multi_grid_group.cc | 31 +- catch/unit/cooperativeGrps/split_barrier.cc | 21 +- catch/unit/cooperativeGrps/thread_block.cc | 33 +- .../unit/cooperativeGrps/thread_block_tile.cc | 35 +- catch/unit/device/CMakeLists.txt | 51 +- catch/unit/device/ResetUUIDInChild_Exe.cc | 22 +- catch/unit/device/chkUUIDFrmChildProc_Exe.cc | 22 +- catch/unit/device/chkUUIDInGrandChild_Exe.cc | 21 +- catch/unit/device/getDeviceCount_exe.cc | 24 +- catch/unit/device/getUUIDfrmRocinfo_Exe.cc | 22 +- catch/unit/device/hipChooseDevice.cc | 28 +- catch/unit/device/hipDeviceAPUCheck.cc | 26 +- catch/unit/device/hipDeviceCanAccessPeer.cc | 28 +- .../unit/device/hipDeviceComputeCapability.cc | 25 +- .../hipDeviceEnableDisablePeerAccess.cc | 30 +- catch/unit/device/hipDeviceGetByPCIBusId.cc | 27 +- .../unit/device/hipDeviceGetDefaultMemPool.cc | 28 +- catch/unit/device/hipDeviceGetLimit_old.cc | 78 --- catch/unit/device/hipDeviceGetName.cc | 30 +- catch/unit/device/hipDeviceGetPCIBusId.cc | 25 +- catch/unit/device/hipDeviceGetUuid.cc | 34 +- catch/unit/device/hipDeviceReset.cc | 27 +- .../unit/device/hipDeviceSetGetCacheConfig.cc | 27 +- catch/unit/device/hipDeviceSetGetLimit.cc | 54 +- catch/unit/device/hipDeviceSetGetMemPool.cc | 36 +- .../unit/device/hipDeviceSetGetScratchExe.cc | 21 +- .../device/hipDeviceSetGetSharedMemConfig.cc | 35 +- catch/unit/device/hipDeviceSetLimit_old.cc | 107 ---- catch/unit/device/hipDeviceSynchronize.cc | 30 +- catch/unit/device/hipDeviceTotalMem.cc | 27 +- catch/unit/device/hipDriverGetVersion.cc | 27 +- .../device/hipExtGetLinkTypeAndHopCount.cc | 28 +- catch/unit/device/hipGetDeviceAttribute.cc | 68 +-- catch/unit/device/hipGetDeviceCount.cc | 43 +- catch/unit/device/hipGetDeviceProperties.cc | 235 +------- catch/unit/device/hipGetDriverEntryPoint.cc | 29 +- catch/unit/device/hipGetProcAddressDevMgmt.cc | 28 +- catch/unit/device/hipGetProcAddressHelpers.hh | 21 +- catch/unit/device/hipGetProcAddressIpcApis.cc | 25 +- catch/unit/device/hipGetSetDeviceFlags.cc | 33 +- catch/unit/device/hipInit.cc | 27 +- catch/unit/device/hipIpcCloseMemHandle.cc | 28 +- catch/unit/device/hipIpcGetMemHandle.cc | 30 +- catch/unit/device/hipIpcOpenMemHandle.cc | 28 +- catch/unit/device/hipRuntimeGetVersion.cc | 25 +- catch/unit/device/hipSetGetDevice.cc | 33 +- catch/unit/device/hipSetValidDevices.cc | 40 +- catch/unit/device/multipleUUID_Exe.cc | 22 +- catch/unit/device/passUUIDToGrandChild_Exe.cc | 22 +- catch/unit/device/setEnvInChildProc_Exe.cc | 22 +- catch/unit/device/setuuidGetDevCount_Exe.cc | 22 +- catch/unit/device/uuidList.cc | 22 +- .../AtomicAdd_Coherent_withnoUnsafeflag.cc | 24 +- .../AtomicAdd_Coherent_withoutflag.cc | 24 +- .../AtomicAdd_Coherent_withunsafeflag.cc | 24 +- .../AtomicAdd_NonCoherent_withnoUnsafeflag.cc | 24 +- .../AtomicAdd_NonCoherent_withoutflag.cc | 24 +- .../AtomicAdd_NonCoherent_withunsafeflag.cc | 24 +- catch/unit/deviceLib/Atomic_func.cc | 25 +- ...AtomicsWithRandomActiveLanesInWavefront.cc | 29 +- catch/unit/deviceLib/BuiltIns_fadd.cc | 298 ---------- catch/unit/deviceLib/BuiltIns_fmax.cc | 30 +- catch/unit/deviceLib/BuiltIns_fmin.cc | 30 +- catch/unit/deviceLib/CMakeLists.txt | 113 ++-- .../deviceLib/DoublePrecisionIntrinsics.cc | 23 +- .../deviceLib/DoublePrecisionMathDevice.cc | 23 +- .../unit/deviceLib/DoublePrecisionMathHost.cc | 23 +- catch/unit/deviceLib/DynamicAllocas.cc | 24 +- catch/unit/deviceLib/FloatMathPrecise.cc | 125 ---- catch/unit/deviceLib/IntegerIntrinsics.cc | 23 +- catch/unit/deviceLib/SimpleAtomicsTest.cc | 23 +- .../deviceLib/SinglePrecisionIntrinsics.cc | 23 +- .../deviceLib/SinglePrecisionMathDevice.cc | 23 +- .../unit/deviceLib/SinglePrecisionMathHost.cc | 23 +- catch/unit/deviceLib/anyAll.cc | 32 +- catch/unit/deviceLib/ballot.cc | 29 +- catch/unit/deviceLib/bfloat16.cc | 46 +- catch/unit/deviceLib/bitExtract.cc | 26 +- catch/unit/deviceLib/bitInsert.cc | 26 +- catch/unit/deviceLib/brev.cc | 26 +- catch/unit/deviceLib/clz.cc | 26 +- catch/unit/deviceLib/defs.h | 22 +- catch/unit/deviceLib/deviceAllocCommon.h | 21 +- catch/unit/deviceLib/deviceAllocation.cc | 89 +-- catch/unit/deviceLib/ffs.cc | 26 +- catch/unit/deviceLib/floatMath.cc | 26 +- catch/unit/deviceLib/floatTM.cc | 26 +- catch/unit/deviceLib/fp16_ops.cc | 36 +- catch/unit/deviceLib/fp4_ocp.cc | 41 +- catch/unit/deviceLib/fp6_ocp.cc | 33 +- catch/unit/deviceLib/fp8_e8m0.cc | 32 +- catch/unit/deviceLib/fp8_fnuz.cc | 38 +- catch/unit/deviceLib/fp8_host.cc | 40 +- catch/unit/deviceLib/fp8_ocp.cc | 38 +- catch/unit/deviceLib/funnelshift.cc | 26 +- catch/unit/deviceLib/hadd.cc | 27 +- catch/unit/deviceLib/hipBfloat16.cc | 24 +- catch/unit/deviceLib/hipComplex.cc | 24 +- catch/unit/deviceLib/hipDeviceMemcpy.cc | 24 +- catch/unit/deviceLib/hipMathFunctions.cc | 25 +- catch/unit/deviceLib/hipStdComplex.cc | 23 +- catch/unit/deviceLib/hipTestAtomicAdd.cc | 23 +- catch/unit/deviceLib/hipTestClock.cc | 23 +- catch/unit/deviceLib/hipTestDevice.cc | 24 +- catch/unit/deviceLib/hipTestDeviceDouble.cc | 24 +- catch/unit/deviceLib/hipTestDeviceLimit.cc | 24 +- catch/unit/deviceLib/hipTestDeviceSymbol.cc | 29 +- catch/unit/deviceLib/hipTestDotFunctions.cc | 24 +- catch/unit/deviceLib/hipTestFMA.cc | 24 +- catch/unit/deviceLib/hipTestHalf.cc | 24 +- catch/unit/deviceLib/hipTestHalfConstexpr.cc | 24 +- catch/unit/deviceLib/hipTestHost.cc | 24 +- catch/unit/deviceLib/hipTestIncludeMath.cc | 24 +- catch/unit/deviceLib/hipTestNativeHalf.cc | 24 +- catch/unit/deviceLib/hipTestNew.cc | 24 +- catch/unit/deviceLib/hipThreadFence.cc | 24 +- catch/unit/deviceLib/hipVectorTypesDevice.cc | 26 +- catch/unit/deviceLib/hipVectorTypesHost.cc | 24 +- catch/unit/deviceLib/hip_test_make_type.cc | 23 +- catch/unit/deviceLib/hip_trig.cc | 24 +- catch/unit/deviceLib/hmax_hmin.cc | 30 +- catch/unit/deviceLib/kerDevAllocMultCO.cc | 21 +- catch/unit/deviceLib/kerDevAllocSingleKer.cc | 21 +- catch/unit/deviceLib/kerDevFreeMultCO.cc | 21 +- catch/unit/deviceLib/kerDevWriteMultCO.cc | 21 +- catch/unit/deviceLib/ldg.cc | 26 +- catch/unit/deviceLib/mbcnt.cc | 26 +- catch/unit/deviceLib/popc.cc | 26 +- catch/unit/deviceLib/syncthreadsand.cc | 26 +- catch/unit/deviceLib/syncthreadscount.cc | 26 +- catch/unit/deviceLib/syncthreadsor.cc | 26 +- catch/unit/deviceLib/threadfence_system.cc | 26 +- catch/unit/deviceLib/unsafeAtomicAddDevice.cc | 26 +- ...safeAtomicAdd_Coherent_withnounsafeflag.cc | 24 +- .../unsafeAtomicAdd_Coherent_withoutflag.cc | 24 +- ...unsafeAtomicAdd_Coherent_withunsafeflag.cc | 24 +- ...eAtomicAdd_NonCoherent_withnounsafeflag.cc | 24 +- ...unsafeAtomicAdd_NonCoherent_withoutflag.cc | 24 +- ...afeAtomicAdd_NonCoherent_withunsafeflag.cc | 24 +- catch/unit/deviceLib/unsafeAtomicAdd_RTC.cc | 33 +- catch/unit/device_memory/CMakeLists.txt | 53 +- catch/unit/device_memory/memcpy.cc | 26 +- .../device_memory/memcpy_negative_kernels.cc | 21 +- .../memcpy_negative_kernels_rtc.hh | 21 +- catch/unit/device_memory/memset.cc | 26 +- .../device_memory/memset_negative_kernels.cc | 21 +- .../memset_negative_kernels_rtc.hh | 21 +- catch/unit/dynamicLoading/CMakeLists.txt | 57 +- .../dynamicLoading/bit_extract_kernel.cpp | 22 +- .../complex_loading_behavior.cc | 24 +- .../unit/dynamicLoading/hipApiDynamicLoad.cc | 26 +- catch/unit/dynamicLoading/liblazyLoad.cc | 22 +- catch/unit/dynamicLoading/vecadd.cc | 22 +- catch/unit/errorHandling/CMakeLists.txt | 14 +- catch/unit/errorHandling/OutCapture.hh | 24 +- .../errorHandling/error_handling_common.cc | 24 +- .../errorHandling/error_handling_common.hh | 24 +- .../unit/errorHandling/hipDrvGetErrorName.cc | 25 +- .../errorHandling/hipDrvGetErrorString.cc | 25 +- catch/unit/errorHandling/hipDynamicLogging.cc | 24 +- .../unit/errorHandling/hipExtGetLastError.cc | 84 +-- catch/unit/errorHandling/hipGetErrorName.cc | 28 +- catch/unit/errorHandling/hipGetErrorString.cc | 28 +- catch/unit/errorHandling/hipGetLastError.cc | 102 +--- .../errorHandling/hipGetLastErrorEnv_Exe.cc | 23 +- .../errorHandling/hipGetLastErrorOnAbort.cc | 27 +- .../unit/errorHandling/hipPeekAtLastError.cc | 39 +- .../hipPeekAtLastErrorEnv_Exe.cc | 23 +- catch/unit/event/CMakeLists.txt | 5 + catch/unit/event/Unit_hipEvent.cc | 27 +- catch/unit/event/Unit_hipEventElapsedTime.cc | 36 +- catch/unit/event/Unit_hipEventIpc.cc | 26 +- .../event/Unit_hipEventIpc_shm_cleanup.cc | 26 +- catch/unit/event/Unit_hipEventMGpuMThreads.cc | 26 +- catch/unit/event/Unit_hipEventQuery.cc | 23 +- catch/unit/event/Unit_hipEventRecord.cc | 28 +- catch/unit/event/Unit_hipEvent_Negative.cc | 61 +- catch/unit/event/hipEventCreate.cc | 28 +- catch/unit/event/hipEventCreateWithFlags.cc | 40 +- catch/unit/event/hipEventDestroy.cc | 32 +- catch/unit/event/hipEventSynchronize.cc | 28 +- catch/unit/executionControl/CMakeLists.txt | 12 +- .../execution_control_common.cc | 24 +- .../execution_control_common.hh | 24 +- .../executionControl/hipExtLaunchKernel.cc | 32 +- .../hipExtLaunchMultiKernelMultiDevice.cc | 32 +- .../hipFuncGetAttributesBasic.cc | 28 +- .../executionControl/hipFuncSetAttribute.cc | 36 +- .../executionControl/hipFuncSetCacheConfig.cc | 30 +- .../hipFuncSetSharedMemConfig.cc | 30 +- .../hipGetProcAddressLaunchCbExecCtrlApis.cc | 27 +- .../hipLaunchCooperativeKernel.cc | 32 +- .../hipLaunchCooperativeKernelMultiDevice.cc | 32 +- .../unit/executionControl/hipLaunchKernel.cc | 32 +- catch/unit/executionControl/launch_api.cc | 32 +- catch/unit/g++/CMakeLists.txt | 4 + catch/unit/g++/hipMalloc.cc | 23 +- catch/unit/g++/hipMalloc.cpp | 21 +- catch/unit/g++/hipMalloc.h | 21 +- catch/unit/gcc/CMakeLists.txt | 4 + catch/unit/gcc/LaunchKernel.c | 20 +- catch/unit/gcc/LaunchKernel.h | 20 +- catch/unit/gcc/gccTest.cc | 25 +- catch/unit/gcc/gpu.cpp | 21 +- catch/unit/gcc/hipMalloc.c | 21 +- catch/unit/gl_interop/CMakeLists.txt | 4 + catch/unit/gl_interop/gl_interop_common.hh | 24 +- catch/unit/gl_interop/hipGLContextSwitch.cc | 24 +- catch/unit/gl_interop/hipGLGetDevices.cc | 30 +- .../gl_interop/hipGraphicsGLRegisterBuffer.cc | 30 +- .../gl_interop/hipGraphicsGLRegisterImage.cc | 30 +- .../gl_interop/hipGraphicsMapResources.cc | 28 +- .../hipGraphicsResourceGetMappedPointer.cc | 30 +- .../hipGraphicsSubResourceGetMappedArray.cc | 28 +- .../gl_interop/hipGraphicsUnmapResources.cc | 26 +- .../hipGraphicsUnregisterResource.cc | 26 +- catch/unit/graph/CMakeLists.txt | 73 +-- catch/unit/graph/add_Kernel.cpp | 22 +- catch/unit/graph/graph_dependency_common.hh | 22 +- .../graph_memcpy_to_from_symbol_common.hh | 24 +- .../graph/graph_memset_node_test_common.hh | 24 +- catch/unit/graph/graph_tests_common.hh | 24 +- .../graph/hipDeviceGetGraphMemAttribute.cc | 43 +- catch/unit/graph/hipDeviceGraphMemTrim.cc | 28 +- .../graph/hipDeviceSetGraphMemAttribute.cc | 28 +- catch/unit/graph/hipDrvGraphAddMemFreeNode.cc | 26 +- catch/unit/graph/hipDrvGraphAddMemcpyNode.cc | 33 +- catch/unit/graph/hipDrvGraphAddMemsetNode.cc | 31 +- .../hipDrvGraphExecMemcpyNodeSetParams.cc | 25 +- .../hipDrvGraphExecMemsetNodeSetParams.cc | 25 +- .../graph/hipDrvGraphMemcpyNodeGetParams.cc | 28 +- .../graph/hipDrvGraphMemcpyNodeSetParams.cc | 30 +- .../unit/graph/hipGetProcAddressGraphApis.cc | 43 +- catch/unit/graph/hipGraph.cc | 23 +- catch/unit/graph/hipGraphAddBatchMemOpNode.cc | 24 +- catch/unit/graph/hipGraphAddChildGraphNode.cc | 57 +- catch/unit/graph/hipGraphAddDependencies.cc | 27 +- .../unit/graph/hipGraphAddDependencies_old.cc | 226 ------- catch/unit/graph/hipGraphAddEmptyNode.cc | 27 +- .../unit/graph/hipGraphAddEventRecordNode.cc | 37 +- catch/unit/graph/hipGraphAddEventWaitNode.cc | 35 +- catch/unit/graph/hipGraphAddHostNode.cc | 31 +- catch/unit/graph/hipGraphAddKernelNode.cc | 34 +- catch/unit/graph/hipGraphAddMemAllocNode.cc | 52 +- catch/unit/graph/hipGraphAddMemFreeNode.cc | 30 +- catch/unit/graph/hipGraphAddMemcpyNode.cc | 87 ++- catch/unit/graph/hipGraphAddMemcpyNode1D.cc | 27 +- .../unit/graph/hipGraphAddMemcpyNode1D_old.cc | 27 +- .../graph/hipGraphAddMemcpyNodeFromSymbol.cc | 27 +- .../hipGraphAddMemcpyNodeFromSymbol_old.cc | 35 +- .../graph/hipGraphAddMemcpyNodeToSymbol.cc | 28 +- .../hipGraphAddMemcpyNodeToSymbol_old.cc | 35 +- catch/unit/graph/hipGraphAddMemcpyNode_old.cc | 551 ------------------ catch/unit/graph/hipGraphAddMemsetNode.cc | 39 +- catch/unit/graph/hipGraphAddNode.cc | 41 +- .../unit/graph/hipGraphAddNodeBeginCapture.cc | 31 +- catch/unit/graph/hipGraphAsyncUserObj.cc | 32 +- .../graph/hipGraphBatchMemOpNodeSetParams.cc | 26 +- .../graph/hipGraphChildGraphNodeGetGraph.cc | 26 +- catch/unit/graph/hipGraphClone.cc | 27 +- catch/unit/graph/hipGraphCloneComplx.cc | 59 +- catch/unit/graph/hipGraphCreate.cc | 25 +- catch/unit/graph/hipGraphCycle.cc | 31 +- catch/unit/graph/hipGraphDebugDotPrint.cc | 25 +- catch/unit/graph/hipGraphDestroy.cc | 25 +- catch/unit/graph/hipGraphDestroyNode.cc | 33 +- .../graph/hipGraphEventRecordNodeGetEvent.cc | 25 +- .../graph/hipGraphEventRecordNodeSetEvent.cc | 27 +- .../graph/hipGraphEventWaitNodeGetEvent.cc | 25 +- .../graph/hipGraphEventWaitNodeSetEvent.cc | 27 +- .../hipGraphExecBatchMemOpNodeSetParams.cc | 24 +- .../hipGraphExecChildGraphNodeSetParams.cc | 28 +- catch/unit/graph/hipGraphExecDestroy.cc | 25 +- .../hipGraphExecEventRecordNodeSetEvent.cc | 30 +- .../hipGraphExecEventWaitNodeSetEvent.cc | 27 +- catch/unit/graph/hipGraphExecGetFlags.cc | 26 +- .../graph/hipGraphExecHostNodeSetParams.cc | 29 +- .../graph/hipGraphExecKernelNodeSetParams.cc | 27 +- .../graph/hipGraphExecMemcpyNodeSetParams.cc | 30 +- .../hipGraphExecMemcpyNodeSetParams1D.cc | 29 +- .../hipGraphExecMemcpyNodeSetParams1D_old.cc | 25 +- ...pGraphExecMemcpyNodeSetParamsFromSymbol.cc | 27 +- ...phExecMemcpyNodeSetParamsFromSymbol_old.cc | 25 +- ...hipGraphExecMemcpyNodeSetParamsToSymbol.cc | 28 +- ...raphExecMemcpyNodeSetParamsToSymbol_old.cc | 25 +- .../hipGraphExecMemcpyNodeSetParams_old.cc | 25 +- .../graph/hipGraphExecMemsetNodeSetParams.cc | 30 +- catch/unit/graph/hipGraphExecNodeSetParams.cc | 27 +- catch/unit/graph/hipGraphExecUpdate.cc | 44 +- catch/unit/graph/hipGraphGetEdges.cc | 27 +- catch/unit/graph/hipGraphGetEdges_old.cc | 236 -------- catch/unit/graph/hipGraphGetNodes.cc | 27 +- catch/unit/graph/hipGraphGetNodes_old.cc | 325 ----------- catch/unit/graph/hipGraphGetRootNodes.cc | 27 +- catch/unit/graph/hipGraphGetRootNodes_old.cc | 33 +- catch/unit/graph/hipGraphHostNodeGetParams.cc | 31 +- catch/unit/graph/hipGraphHostNodeSetParams.cc | 29 +- catch/unit/graph/hipGraphInstantiate.cc | 29 +- .../graph/hipGraphInstantiateWithFlags.cc | 41 +- .../graph/hipGraphInstantiateWithParams.cc | 27 +- .../graph/hipGraphKernelNodeCopyAttributes.cc | 25 +- .../graph/hipGraphKernelNodeGetAttribute.cc | 26 +- .../unit/graph/hipGraphKernelNodeGetParams.cc | 27 +- .../graph/hipGraphKernelNodeSetAttribute.cc | 30 +- .../hipGraphKernelNodeSetAttribute_old.cc | 25 +- .../unit/graph/hipGraphKernelNodeSetParams.cc | 29 +- catch/unit/graph/hipGraphLaunch.cc | 25 +- catch/unit/graph/hipGraphLaunch_old.cc | 174 +----- .../graph/hipGraphMemAllocNodeGetParams.cc | 32 +- .../graph/hipGraphMemFreeNodeGetParams.cc | 25 +- .../unit/graph/hipGraphMemcpyNodeGetParams.cc | 26 +- .../graph/hipGraphMemcpyNodeGetParams_old.cc | 25 +- .../unit/graph/hipGraphMemcpyNodeSetParams.cc | 58 +- .../graph/hipGraphMemcpyNodeSetParams1D.cc | 27 +- .../hipGraphMemcpyNodeSetParams1D_old.cc | 25 +- .../hipGraphMemcpyNodeSetParamsFromSymbol.cc | 27 +- ...pGraphMemcpyNodeSetParamsFromSymbol_old.cc | 111 +--- .../hipGraphMemcpyNodeSetParamsToSymbol.cc | 27 +- ...hipGraphMemcpyNodeSetParamsToSymbol_old.cc | 118 +--- .../graph/hipGraphMemcpyNodeSetParams_old.cc | 212 ------- .../unit/graph/hipGraphMemsetNodeGetParams.cc | 25 +- .../unit/graph/hipGraphMemsetNodeSetParams.cc | 27 +- catch/unit/graph/hipGraphMultiDevice.cc | 26 +- catch/unit/graph/hipGraphNodeFindInClone.cc | 27 +- .../unit/graph/hipGraphNodeGetDependencies.cc | 25 +- .../graph/hipGraphNodeGetDependencies_old.cc | 347 ----------- .../graph/hipGraphNodeGetDependentNodes.cc | 25 +- .../hipGraphNodeGetDependentNodes_old.cc | 346 ----------- catch/unit/graph/hipGraphNodeGetEnabled.cc | 25 +- catch/unit/graph/hipGraphNodeGetType.cc | 36 +- catch/unit/graph/hipGraphNodeSetEnabled.cc | 31 +- catch/unit/graph/hipGraphNodeSetParams.cc | 27 +- catch/unit/graph/hipGraphPerf.cc | 63 +- catch/unit/graph/hipGraphReleaseUserObject.cc | 26 +- .../unit/graph/hipGraphRemoveDependencies.cc | 31 +- .../graph/hipGraphRemoveDependencies_old.cc | 439 -------------- catch/unit/graph/hipGraphRetainUserObject.cc | 32 +- catch/unit/graph/hipGraphUpload.cc | 29 +- .../unit/graph/hipLaunchHostFuncWithGraph.cc | 30 +- catch/unit/graph/hipMatMul.cc | 21 +- catch/unit/graph/hipSimpleGraphWithKernel.cc | 23 +- catch/unit/graph/hipStreamBeginCapture.cc | 71 +-- .../graph/hipStreamBeginCaptureToGraph.cc | 56 +- catch/unit/graph/hipStreamBeginCapture_old.cc | 75 +-- .../graph/hipStreamCaptureAPIRestrictions.cc | 21 +- .../hipStreamCaptureExtModuleLaunchKernel.cc | 24 +- catch/unit/graph/hipStreamEndCapture.cc | 29 +- catch/unit/graph/hipStreamEndCapture_old.cc | 31 +- catch/unit/graph/hipStreamGetCaptureInfo.cc | 27 +- .../unit/graph/hipStreamGetCaptureInfo_old.cc | 208 +------ .../unit/graph/hipStreamGetCaptureInfo_v2.cc | 27 +- .../graph/hipStreamGetCaptureInfo_v2_old.cc | 279 --------- catch/unit/graph/hipStreamIsCapturing.cc | 29 +- catch/unit/graph/hipStreamIsCapturing_old.cc | 221 +------ .../hipStreamUpdateCaptureDependencies.cc | 29 +- .../hipThreadExchangeStreamCaptureMode.cc | 25 +- catch/unit/graph/hipUserObjectCreate.cc | 35 +- catch/unit/graph/hipUserObjectRelease.cc | 26 +- catch/unit/graph/hipUserObjectRetain.cc | 26 +- catch/unit/graph/stream_capture_common.hh | 22 +- catch/unit/graph/user_object_common.hh | 24 +- catch/unit/hip_specific/CMakeLists.txt | 20 +- catch/unit/hip_specific/hip_check_VGPRs.cpp | 26 +- catch/unit/hip_specific/hip_hc_8pk.cc | 29 +- .../hip_hc_8pk_negative_kernels.cc | 21 +- .../hip_hc_8pk_negative_kernels_rtc.hh | 21 +- catch/unit/kernel/CMakeLists.txt | 20 +- catch/unit/kernel/hipAutoThreadIdx.cc | 26 +- catch/unit/kernel/hipConfigureCall.cc | 25 +- catch/unit/kernel/hipDynamicShared.cc | 23 +- catch/unit/kernel/hipDynamicShared2.cc | 23 +- catch/unit/kernel/hipEmptyKernel.cc | 23 +- .../unit/kernel/hipExtLaunchKernelGGLBasic.cc | 24 +- catch/unit/kernel/hipGridLaunch.cc | 24 +- catch/unit/kernel/hipLanguageExtensions.cc | 23 +- catch/unit/kernel/hipLaunchBounds.cc | 25 +- catch/unit/kernel/hipLaunchBoundsBasic.cc | 24 +- catch/unit/kernel/hipLaunchKernelEx.cc | 34 +- catch/unit/kernel/hipLaunchParm.cc | 23 +- catch/unit/kernel/hipLaunchParmFunctor.cc | 23 +- .../unit/kernel/hipMemFaultStackAllocation.cc | 23 +- catch/unit/kernel/hipPrintfKernel.cc | 24 +- catch/unit/kernel/hipSetupArgument.cc | 25 +- catch/unit/kernel/hipTestConstant.cc | 24 +- catch/unit/kernel/hipTestGlobalVariable.cc | 24 +- catch/unit/kernel/hipTestMemKernel.cc | 24 +- catch/unit/kernel/printf_common.h | 24 +- catch/unit/launchBounds/CMakeLists.txt | 20 +- catch/unit/launchBounds/launch_bounds.cc | 27 +- .../launch_bounds_compiler_error_kernels.cc | 21 +- .../launch_bounds_negative_kernels_rtc.hh | 21 +- .../launch_bounds_parse_error_kernels.cc | 21 +- catch/unit/library/CMakeLists.txt | 37 +- catch/unit/library/hipKernelGetAttribute.cc | 24 +- catch/unit/library/lib_attribute.cc | 24 +- catch/unit/library/library_negative.cc | 26 +- catch/unit/library/loadlib_co.cc | 28 +- catch/unit/library/loadlib_rtc.cc | 26 +- catch/unit/math/CMakeLists.txt | 227 ++++---- catch/unit/math/Float16.hh | 24 +- catch/unit/math/binary_common.hh | 25 +- catch/unit/math/casting_common.hh | 23 +- catch/unit/math/casting_double_funcs.cc | 57 +- .../math/casting_double_negative_kernels.cc | 21 +- .../casting_double_negative_kernels_rtc.hh | 21 +- catch/unit/math/casting_float_funcs.cc | 47 +- .../math/casting_float_negative_kernels.cc | 21 +- .../casting_float_negative_kernels_rtc.hh | 21 +- catch/unit/math/casting_half2_common.hh | 23 +- catch/unit/math/casting_half2_funcs.cc | 56 +- .../math/casting_half2_negative_kernels.cc | 21 +- catch/unit/math/casting_half2int_funcs.cc | 30 +- .../math/casting_half2int_negative_kernels.cc | 21 +- catch/unit/math/casting_half_float_funcs.cc | 36 +- .../casting_half_float_negative_kernels.cc | 21 +- catch/unit/math/casting_int2half_funcs.cc | 32 +- .../math/casting_int2half_negative_kernels.cc | 21 +- catch/unit/math/casting_int_funcs.cc | 63 +- .../unit/math/casting_int_negative_kernels.cc | 21 +- .../math/casting_int_negative_kernels_rtc.hh | 21 +- .../unit/math/double_precision_intrinsics.cc | 30 +- ...e_precision_intrinsics_negative_kernels.cc | 24 +- catch/unit/math/half_precision_arithmetic.cc | 24 +- ...f_precision_arithmetic_negative_kernels.cc | 24 +- catch/unit/math/half_precision_common.hh | 30 +- catch/unit/math/half_precision_comparison.cc | 28 +- ...f_precision_comparison_negative_kernels.cc | 24 +- catch/unit/math/half_precision_math.cc | 24 +- .../half_precision_math_negative_kernels.cc | 24 +- catch/unit/math/integer_intrinsics.cc | 74 +-- .../integer_intrinsics_negative_kernels.cc | 24 +- catch/unit/math/log_funcs.cc | 39 +- catch/unit/math/math_common.hh | 22 +- catch/unit/math/math_log_negative_kernels.cc | 21 +- .../math/math_log_negative_kernels_rtc.hh | 21 +- catch/unit/math/math_pow_negative_kernels.cc | 21 +- .../math/math_pow_negative_kernels_rtc.hh | 21 +- catch/unit/math/math_reference_impl.hh | 24 +- .../math/math_remainder_negative_kernels.cc | 21 +- ...remainder_rounding_negative_kernels_rtc.hh | 21 +- .../math_root_negative_kernels_1Dand2D.cc | 21 +- .../math_root_negative_kernels_3Dand4D.cc | 21 +- .../math/math_root_negative_kernels_rtc.hh | 21 +- .../math/math_rounding_negative_kernels.cc | 21 +- catch/unit/math/math_special_func_kernels.cc | 21 +- .../math/math_special_func_kernels_rtc.hh | 21 +- catch/unit/math/misc_funcs.cc | 51 +- catch/unit/math/misc_negative_kernels.cc | 24 +- catch/unit/math/misc_negative_kernels_rtc.hh | 24 +- catch/unit/math/pow_common.hh | 23 +- catch/unit/math/pow_funcs.cc | 61 +- catch/unit/math/quaternary_common.hh | 25 +- .../unit/math/remainder_and_rounding_funcs.cc | 63 +- catch/unit/math/root_funcs.cc | 73 +-- .../unit/math/single_precision_intrinsics.cc | 30 +- ...e_precision_intrinsics_negative_kernels.cc | 24 +- catch/unit/math/special_common.hh | 21 +- catch/unit/math/special_funcs.cc | 117 ++-- catch/unit/math/ternary_common.hh | 25 +- catch/unit/math/thread_pool.hh | 23 +- .../trig_double_precision_negative_kernels.cc | 24 +- catch/unit/math/trig_funcs.cc | 65 +-- .../trig_single_precision_negative_kernels.cc | 24 +- catch/unit/math/unary_common.hh | 27 +- catch/unit/math/validators.hh | 24 +- catch/unit/memory/CMakeLists.txt | 48 +- catch/unit/memory/DriverContext.cc | 24 +- catch/unit/memory/DriverContext.hh | 24 +- catch/unit/memory/MemUtils.hh | 24 +- .../unit/memory/array_memcpy_tests_common.hh | 21 +- catch/unit/memory/hipArray.cc | 36 +- catch/unit/memory/hipArray3DCreate.cc | 43 +- catch/unit/memory/hipArray3DGetDescriptor.cc | 28 +- catch/unit/memory/hipArrayCommon.hh | 24 +- catch/unit/memory/hipArrayCreate.cc | 37 +- catch/unit/memory/hipArrayGetDescriptor.cc | 34 +- catch/unit/memory/hipArrayGetInfo.cc | 28 +- catch/unit/memory/hipDeviceGetMemPool.cc | 32 +- catch/unit/memory/hipDeviceSetMemPool.cc | 32 +- catch/unit/memory/hipDrvMemcpy2DUnaligned.cc | 31 +- catch/unit/memory/hipDrvMemcpy3D.cc | 36 +- catch/unit/memory/hipDrvMemcpy3DAsync.cc | 36 +- catch/unit/memory/hipDrvMemcpy3DAsync_old.cc | 112 +--- catch/unit/memory/hipDrvMemcpy3D_old.cc | 35 +- catch/unit/memory/hipDrvPtrGetAttributes.cc | 28 +- catch/unit/memory/hipExtMallocWithFlags.cc | 32 +- catch/unit/memory/hipFree.cc | 58 +- catch/unit/memory/hipFreeArray.cc | 29 +- catch/unit/memory/hipFreeAsync.cc | 28 +- catch/unit/memory/hipFreeHost.cc | 32 +- catch/unit/memory/hipFreeMipmappedArray.cc | 30 +- .../memory/hipGetProcAddressMemoryApis.cc | 51 +- catch/unit/memory/hipGetSymbolSizeAddress.cc | 29 +- catch/unit/memory/hipHostAlloc.cc | 43 +- catch/unit/memory/hipHostFree.cc | 32 +- catch/unit/memory/hipHostGetDevicePointer.cc | 30 +- catch/unit/memory/hipHostGetFlags.cc | 32 +- catch/unit/memory/hipHostMalloc.cc | 46 +- catch/unit/memory/hipHostMallocTests.cc | 23 +- catch/unit/memory/hipHostRegister.cc | 54 +- catch/unit/memory/hipHostUnregister.cc | 36 +- catch/unit/memory/hipMalloc.cc | 42 +- catch/unit/memory/hipMalloc3D.cc | 27 +- catch/unit/memory/hipMalloc3DArray.cc | 53 +- catch/unit/memory/hipMallocArray.cc | 51 +- catch/unit/memory/hipMallocAsync.cc | 49 +- catch/unit/memory/hipMallocFromPoolAsync.cc | 59 +- catch/unit/memory/hipMallocHost.cc | 32 +- catch/unit/memory/hipMallocManaged.cc | 25 +- catch/unit/memory/hipMallocManagedFlagsTst.cc | 28 +- .../memory/hipMallocManaged_MultiScenario.cc | 33 +- catch/unit/memory/hipMallocMipmappedArray.cc | 55 +- catch/unit/memory/hipMallocMngdMultiThread.cc | 37 +- catch/unit/memory/hipMallocPitch.cc | 48 +- catch/unit/memory/hipMemAdvise.cc | 39 +- catch/unit/memory/hipMemAdviseMmap.cc | 23 +- .../hipMemAdvise_AlignedAllocMem_Exe.cc | 25 +- catch/unit/memory/hipMemAdvise_old.cc | 545 +---------------- catch/unit/memory/hipMemAdvise_v2.cc | 31 +- catch/unit/memory/hipMemAllocHost.cc | 34 +- catch/unit/memory/hipMemCoherencyTst.cc | 29 +- catch/unit/memory/hipMemGetAddressRange.cc | 25 +- catch/unit/memory/hipMemGetInfo.cc | 23 +- catch/unit/memory/hipMemGetMemPool.cc | 19 +- catch/unit/memory/hipMemPoolApi.cc | 31 +- catch/unit/memory/hipMemPoolCreate.cc | 27 +- catch/unit/memory/hipMemPoolDestroy.cc | 21 +- catch/unit/memory/hipMemPoolExportPointer.cc | 28 +- .../hipMemPoolExportToShareableHandle.cc | 34 +- .../hipMemPoolImportFromShareableHandle.cc | 28 +- catch/unit/memory/hipMemPoolImportPointer.cc | 28 +- catch/unit/memory/hipMemPoolMaxAlloc.cc | 21 +- catch/unit/memory/hipMemPoolSetGetAccess.cc | 37 +- .../unit/memory/hipMemPoolSetGetAttribute.cc | 46 +- catch/unit/memory/hipMemPoolTrimTo.cc | 27 +- catch/unit/memory/hipMemPrefetchAsync.cc | 31 +- .../unit/memory/hipMemPrefetchAsyncExtTsts.cc | 29 +- catch/unit/memory/hipMemPrefetchAsync_v2.cc | 29 +- catch/unit/memory/hipMemPtrGetInfo.cc | 28 +- catch/unit/memory/hipMemRangeGetAttribute.cc | 55 +- .../memory/hipMemRangeGetAttribute_old.cc | 219 +------ catch/unit/memory/hipMemRangeGetAttributes.cc | 28 +- .../memory/hipMemRangeGetAttributes_old.cc | 303 ---------- catch/unit/memory/hipMemSetMemPool.cc | 19 +- catch/unit/memory/hipMemVmm.cc | 27 +- catch/unit/memory/hipMemcpy2D.cc | 34 +- catch/unit/memory/hipMemcpy2DArrayToArray.cc | 27 +- catch/unit/memory/hipMemcpy2DAsync.cc | 34 +- catch/unit/memory/hipMemcpy2DAsync_old.cc | 269 +-------- catch/unit/memory/hipMemcpy2DFromArray.cc | 32 +- .../unit/memory/hipMemcpy2DFromArrayAsync.cc | 30 +- .../memory/hipMemcpy2DFromArrayAsync_old.cc | 238 +------- catch/unit/memory/hipMemcpy2DFromArray_old.cc | 201 +------ catch/unit/memory/hipMemcpy2DToArray.cc | 32 +- catch/unit/memory/hipMemcpy2DToArrayAsync.cc | 32 +- .../memory/hipMemcpy2DToArrayAsync_old.cc | 231 +------- catch/unit/memory/hipMemcpy2DToArray_old.cc | 198 +------ catch/unit/memory/hipMemcpy2D_old.cc | 229 +------- catch/unit/memory/hipMemcpy3D.cc | 38 +- catch/unit/memory/hipMemcpy3DAsync.cc | 36 +- catch/unit/memory/hipMemcpy3DAsync_old.cc | 139 +---- catch/unit/memory/hipMemcpy3DBatchAsync.cc | 26 +- catch/unit/memory/hipMemcpy3DPeer.cc | 24 +- catch/unit/memory/hipMemcpy3DPeerAsync.cc | 24 +- catch/unit/memory/hipMemcpy3D_old.cc | 157 +---- catch/unit/memory/hipMemcpyAllApiNegative.cc | 27 +- catch/unit/memory/hipMemcpyAsync.cc | 31 +- .../unit/memory/hipMemcpyAsync_derivatives.cc | 45 +- catch/unit/memory/hipMemcpyAsync_old.cc | 59 +- catch/unit/memory/hipMemcpyAtoA.cc | 23 +- catch/unit/memory/hipMemcpyAtoD.cc | 23 +- catch/unit/memory/hipMemcpyAtoH.cc | 31 +- catch/unit/memory/hipMemcpyAtoHAsync.cc | 25 +- catch/unit/memory/hipMemcpyAtoH_old.cc | 147 +---- catch/unit/memory/hipMemcpyBatchAsync.cc | 30 +- .../memory/hipMemcpyDeviceToDeviceNoCU.cc | 29 +- catch/unit/memory/hipMemcpyDtoA.cc | 27 +- catch/unit/memory/hipMemcpyDtoD.cc | 23 +- catch/unit/memory/hipMemcpyDtoDAsync.cc | 25 +- catch/unit/memory/hipMemcpyFromSymbol.cc | 27 +- catch/unit/memory/hipMemcpyHtoA.cc | 32 +- catch/unit/memory/hipMemcpyHtoAAsync.cc | 31 +- catch/unit/memory/hipMemcpyHtoA_old.cc | 151 +---- catch/unit/memory/hipMemcpyParam2D.cc | 36 +- catch/unit/memory/hipMemcpyParam2DAsync.cc | 36 +- .../unit/memory/hipMemcpyParam2DAsync_old.cc | 330 +---------- catch/unit/memory/hipMemcpyParam2D_old.cc | 316 ---------- catch/unit/memory/hipMemcpyPeer.cc | 30 +- catch/unit/memory/hipMemcpyPeerAsync.cc | 32 +- catch/unit/memory/hipMemcpyPeerAsync_old.cc | 157 +---- catch/unit/memory/hipMemcpyPeer_old.cc | 147 ----- catch/unit/memory/hipMemcpySync.cc | 30 +- catch/unit/memory/hipMemcpyWithStream.cc | 31 +- .../memory/hipMemcpyWithStreamMultiThread.cc | 23 +- catch/unit/memory/hipMemcpyWithStream_old.cc | 63 +- catch/unit/memory/hipMemcpy_EdgeCases.cc | 30 +- catch/unit/memory/hipMemcpy_MultiThread.cc | 23 +- catch/unit/memory/hipMemcpy_derivatives.cc | 41 +- catch/unit/memory/hipMemset.cc | 31 +- catch/unit/memory/hipMemset2D.cc | 27 +- .../hipMemset2DAsyncMultiThreadAndKernel.cc | 23 +- catch/unit/memory/hipMemset3D.cc | 30 +- catch/unit/memory/hipMemset3DFunctional.cc | 37 +- .../memory/hipMemset3DRegressMultiThread.cc | 27 +- catch/unit/memory/hipMemsetAsync.cc | 32 +- catch/unit/memory/hipMemsetAsyncAndKernel.cc | 21 +- catch/unit/memory/hipMemsetBasic.cc | 21 - catch/unit/memory/hipMemsetD16.cc | 29 +- catch/unit/memory/hipMemsetD16Async.cc | 27 +- catch/unit/memory/hipMemsetD2D16.cc | 28 +- catch/unit/memory/hipMemsetD2D16Async.cc | 28 +- catch/unit/memory/hipMemsetD2D32.cc | 28 +- catch/unit/memory/hipMemsetD2D32Async.cc | 28 +- catch/unit/memory/hipMemsetD2D8.cc | 28 +- catch/unit/memory/hipMemsetD2D8Async.cc | 28 +- catch/unit/memory/hipMemsetD32.cc | 29 +- catch/unit/memory/hipMemsetD32Async.cc | 27 +- catch/unit/memory/hipMemsetD8Async.cc | 27 +- catch/unit/memory/hipMemsetFunctional.cc | 67 +-- catch/unit/memory/hipMemsetNegative.cc | 39 +- catch/unit/memory/hipMemsetSync.cc | 32 +- catch/unit/memory/hipPointerGetAttribute.cc | 38 +- catch/unit/memory/hipPointerGetAttributes.cc | 42 +- catch/unit/memory/hipPointerSetAttribute.cc | 28 +- catch/unit/memory/hipPtrGetAttribute.cc | 26 +- .../unit/memory/hipSVMTestByteGranularity.cpp | 2 +- .../hipSVMTestFineGrainMemoryConsistency.cpp | 2 +- .../memory/hipSVMTestFineGrainSyncBuffers.cpp | 2 +- .../hipSVMTestSharedAddressSpaceFineGrain.cpp | 4 +- catch/unit/memory/hipStreamAttachMemAsync.cc | 36 +- catch/unit/memory/inlineVar.cc | 23 +- catch/unit/memory/malloc.cc | 17 - catch/unit/memory/memcpy2d_tests_common.hh | 24 +- catch/unit/memory/memoryCommon.hh | 21 +- catch/unit/memory/mempool_common.hh | 20 +- catch/unit/module/CMakeLists.txt | 368 +++++++----- catch/unit/module/addKernel.cc | 21 +- catch/unit/module/coopKernel.cpp | 21 +- catch/unit/module/copiousArgKernel.cc | 21 +- catch/unit/module/copyKernel.cc | 23 +- catch/unit/module/empty_module.cc | 23 +- catch/unit/module/get_function_module.cc | 23 +- catch/unit/module/get_global_test_module.cc | 23 +- catch/unit/module/get_tex_ref_module.cc | 23 +- catch/unit/module/hipDrvLaunchKernelEx.cc | 32 +- catch/unit/module/hipExtLaunchKernelGGL.cc | 24 +- ...pExtLaunchMultiKernelMultiDevFunctional.cc | 24 +- catch/unit/module/hipExtModuleLaunchKernel.cc | 33 +- catch/unit/module/hipFuncGetAttribute.cc | 28 +- catch/unit/module/hipFuncGetAttributes.cc | 24 +- catch/unit/module/hipFuncSetAttribute.cc | 24 +- .../unit/module/hipFuncSetSharedMemConfig.cc | 24 +- catch/unit/module/hipGetFuncBySymbol.cc | 31 +- catch/unit/module/hipGetFuncBySymbol_exe.cc | 21 +- .../module/hipGetProcAddressModuleApis.cc | 29 +- catch/unit/module/hipHccModuleLaunchKernel.cc | 28 +- catch/unit/module/hipKerArgOptimization.cc | 23 +- catch/unit/module/hipLinkCreate.cc | 31 +- catch/unit/module/hipManagedKeywordBasic.cc | 24 +- catch/unit/module/hipModule.cc | 24 +- catch/unit/module/hipModuleGetFunction.cc | 29 +- .../unit/module/hipModuleGetFunctionCount.cc | 26 +- catch/unit/module/hipModuleGetGlobal.cc | 37 +- catch/unit/module/hipModuleGetGlobal.hh | 23 +- catch/unit/module/hipModuleGetLoadingMode.cc | 207 ------- catch/unit/module/hipModuleGetTexRef.cc | 31 +- .../hipModuleLaunchCooperativeKernel.cc | 32 +- ...oduleLaunchCooperativeKernelMultiDevice.cc | 35 +- catch/unit/module/hipModuleLaunchKernel.cc | 32 +- catch/unit/module/hipModuleLoad.cc | 29 +- catch/unit/module/hipModuleLoadData.cc | 27 +- catch/unit/module/hipModuleLoadDataEx.cc | 27 +- catch/unit/module/hipModuleLoadFatBinary.cc | 26 +- .../hipModuleLoadMultProcessOnMultGPU.cc | 24 +- catch/unit/module/hipModuleUnload.cc | 28 +- catch/unit/module/hip_module_common.cc | 23 +- catch/unit/module/hip_module_common.hh | 23 +- .../module/hip_module_launch_kernel_common.hh | 23 +- catch/unit/module/kernel_composite_test.cpp | 22 +- catch/unit/module/kernel_count.cpp | 22 +- catch/unit/module/launch_kernel_module.cc | 23 +- catch/unit/module/managed_kernel.cpp | 22 +- catch/unit/module/matmul.cpp | 22 +- .../module/testhipModuleLoadUnloadFunc_exe.cc | 22 +- catch/unit/module/vcpy_kernel.cpp | 22 +- catch/unit/multiThread/CMakeLists.txt | 4 + .../multiThread/hipMemsetAsyncMultiThread.cc | 21 +- .../unit/multiThread/hipMultiThreadDevice.cc | 8 +- .../multiThread/hipMultiThreadStreams1.cc | 30 +- .../multiThread/hipMultiThreadStreams2.cc | 26 +- catch/unit/occupancy/CMakeLists.txt | 20 +- ...cupancyMaxActiveBlocksPerMultiprocessor.cc | 28 +- ...xActiveBlocksPerMultiprocessorWithFlags.cc | 27 +- ...hipModuleOccupancyMaxPotentialBlockSize.cc | 26 +- ...OccupancyMaxPotentialBlockSizeWithFlags.cc | 26 +- ...ipOccupancyAvailableDynamicSMemPerBlock.cc | 25 +- ...cupancyMaxActiveBlocksPerMultiprocessor.cc | 35 +- ...xActiveBlocksPerMultiprocessorWithFlags.cc | 25 +- ...ncyMaxActiveBlocksPerMultiprocessor_old.cc | 89 --- .../hipOccupancyMaxPotentialBlockSize.cc | 28 +- ...PotentialBlockSizeVariableSMemWithFlags.cc | 35 +- .../hipOccupancyMaxPotentialBlockSize_old.cc | 78 --- catch/unit/occupancy/occupancy_common.hh | 22 +- catch/unit/occupancy/simple_kernel.cc | 21 +- catch/unit/p2p/CMakeLists.txt | 8 +- catch/unit/p2p/hipDeviceGetP2PAttribute.cc | 25 +- .../unit/p2p/hipDeviceGetP2PAttribute_exe.cc | 21 +- catch/unit/p2p/hipP2pLinkTypeAndHopFunc.cc | 23 +- catch/unit/p2p/hipP2pLinkTypeAndHopFunc.h | 21 +- catch/unit/printf/CMakeLists.txt | 53 +- catch/unit/printf/hipPrintfAltForms.cc | 24 +- catch/unit/printf/hipPrintfBasic.cc | 24 +- catch/unit/printf/hipPrintfManyDevices.cc | 24 +- catch/unit/printf/hipPrintfManyWaves.cc | 24 +- catch/unit/printf/hipPrintfStar.cc | 24 +- catch/unit/printf/hipPrintfWidthPrecision.cc | 24 +- catch/unit/printf/printfFlags.cc | 26 +- catch/unit/printf/printfFlagsNonHost.cc | 24 +- catch/unit/printf/printfFlagsNonHost_exe.cc | 21 +- catch/unit/printf/printfFlags_exe.cc | 24 +- catch/unit/printf/printfHost.cc | 24 +- catch/unit/printf/printfLength.cc | 26 +- catch/unit/printf/printfLength_exe.cc | 24 +- catch/unit/printf/printfNonHost.cc | 30 +- catch/unit/printf/printfSpecifiers.cc | 28 +- catch/unit/printf/printfSpecifiersNonHost.cc | 26 +- .../printf/printfSpecifiersNonHost_exe.cc | 24 +- catch/unit/printf/printfSpecifiers_exe.cc | 24 +- catch/unit/printf/printf_common.h | 22 +- catch/unit/printf/printf_negative_kernels.cc | 24 +- .../printf/printf_negative_kernels_rtc.hh | 24 +- catch/unit/rtc/CMakeLists.txt | 18 +- catch/unit/rtc/ChkPtrdiff_t_Exe.cc | 23 +- catch/unit/rtc/RtcConfig.json | 2 +- catch/unit/rtc/RtcFunctions.cpp | 471 ++++++++------- catch/unit/rtc/RtcUtility.cpp | 79 +-- catch/unit/rtc/customOptions.cc | 6 +- catch/unit/rtc/headers/RtcFact.h | 21 +- catch/unit/rtc/headers/RtcFunctions.h | 21 +- catch/unit/rtc/headers/RtcKernels.h | 21 +- catch/unit/rtc/headers/RtcUtility.h | 21 +- catch/unit/rtc/headers/printf_common.h | 71 ++- catch/unit/rtc/headers/test_header1.h | 6 + catch/unit/rtc/headers/test_header2.h | 6 + catch/unit/rtc/hipRTCDeviceMalloc.cc | 2 +- catch/unit/rtc/hipRtcBfloat16.cc | 23 +- catch/unit/rtc/hipRtcComplexHeader.cc | 23 +- catch/unit/rtc/hipRtcFunctional.cc | 26 +- catch/unit/rtc/hipRtcPtrdiff_t.cc | 26 +- catch/unit/rtc/hipStreamCaptureRtc.cc | 23 +- catch/unit/rtc/hiprtcComplrOptnTesting.cc | 93 ++- catch/unit/rtc/hiprtcGetLoweredName.cc | 23 +- catch/unit/rtc/hiprtc_Bitcode_UndefinedFn.cc | 23 +- .../rtc/hiprtc_MathConstants_HeaderTst.cc | 23 +- .../rtc/hiprtc_MathFunctions_HeaderTst.cc | 23 +- .../unit/rtc/hiprtc_TextureTypes_HeaderTst.cc | 23 +- .../unit/rtc/hiprtc_VectorTypes_HeaderTst.cc | 23 +- catch/unit/rtc/hiprtc_bfloat16_HeaderTst.cc | 23 +- catch/unit/rtc/hiprtc_fp16_HeaderTst.cc | 23 +- catch/unit/rtc/includepath.cc | 2 +- catch/unit/rtc/linker.cc | 12 +- catch/unit/rtc/rtc_reduce.cc | 24 +- catch/unit/rtc/saxpy.cc | 2 +- catch/unit/rtc/saxpy.h | 6 + catch/unit/rtc/shfl.cc | 26 +- catch/unit/rtc/shfl.hh | 24 +- catch/unit/rtc/shfl_sync.cc | 26 +- catch/unit/rtc/stdheaders.cc | 26 +- catch/unit/rtc/warpsize.cc | 26 +- catch/unit/stream/CMakeLists.txt | 23 +- catch/unit/stream/hipAPIStreamDisable.cc | 75 --- .../stream/hipDeviceGetStreamPriorityRange.cc | 25 +- catch/unit/stream/hipLaunchHostFunc.cc | 39 +- catch/unit/stream/hipMultiStream.cc | 26 +- catch/unit/stream/hipStreamACb_MultiThread.cc | 23 +- .../stream/hipStreamACb_StrmSyncTiming.cc | 23 +- catch/unit/stream/hipStreamAddCallback.cc | 29 +- catch/unit/stream/hipStreamAttachMemAsync.cc | 25 +- .../stream/hipStreamAttachMemAsync_old.cc | 143 ----- catch/unit/stream/hipStreamBatchMemOp.cc | 24 +- catch/unit/stream/hipStreamCopyAttributes.cc | 27 +- catch/unit/stream/hipStreamCreate.cc | 25 +- catch/unit/stream/hipStreamCreateWithFlags.cc | 29 +- .../stream/hipStreamCreateWithPriority.cc | 35 +- catch/unit/stream/hipStreamDestroy.cc | 30 +- catch/unit/stream/hipStreamGetCUMask.cc | 25 +- catch/unit/stream/hipStreamGetDevice.cc | 31 +- catch/unit/stream/hipStreamGetFlags.cc | 28 +- catch/unit/stream/hipStreamGetFlags_spt.cc | 28 +- catch/unit/stream/hipStreamGetId.cc | 33 +- catch/unit/stream/hipStreamGetPriority.cc | 33 +- catch/unit/stream/hipStreamGetPriority_spt.cc | 27 +- catch/unit/stream/hipStreamLegacy.cc | 30 +- catch/unit/stream/hipStreamLegacy_Ext.cc | 50 +- .../hipStreamLegacy_compiler_options.cc | 25 +- catch/unit/stream/hipStreamLegacy_exe.cc | 21 +- catch/unit/stream/hipStreamQuery.cc | 31 +- catch/unit/stream/hipStreamQuery_spt.cc | 30 +- .../unit/stream/hipStreamSetGetAttributes.cc | 27 +- catch/unit/stream/hipStreamSynchronize.cc | 31 +- catch/unit/stream/hipStreamSynchronize_spt.cc | 28 +- catch/unit/stream/hipStreamValue.cc | 36 +- catch/unit/stream/hipStreamWaitEvent.cc | 28 +- catch/unit/stream/hipStreamWithCUMask.cc | 29 +- catch/unit/stream/streamCommon.cc | 21 +- catch/unit/stream/streamCommon.hh | 21 +- catch/unit/streamperthread/CMakeLists.txt | 17 +- .../hipGetProcAddressSptApis.cc | 41 +- .../hipStreamPerThrdCompilerOptn.cc | 23 +- .../streamperthread/hipStreamPerThrdTsts.cc | 33 +- .../hipStreamPerThread_Basic.cc | 35 +- .../hipStreamPerThread_DeviceReset.cc | 25 +- .../hipStreamPerThread_Event.cc | 25 +- .../hipStreamPerThread_MultiThread.cc | 23 +- catch/unit/surface/CMakeLists.txt | 24 +- catch/unit/surface/hipCreateSurfaceObject.cc | 26 +- catch/unit/surface/hipDestroySurfaceObject.cc | 26 +- catch/unit/surface/surf1D.cc | 36 +- catch/unit/surface/surf1DLayered.cc | 30 +- catch/unit/surface/surf2D.cc | 36 +- catch/unit/surface/surf2DLayered.cc | 30 +- catch/unit/surface/surf3D.cc | 36 +- catch/unit/surface/surfCubemap.cc | 36 +- catch/unit/surface/surfCubemapLayered.cc | 30 +- catch/unit/surface/surf_common.h | 24 +- catch/unit/synchronization/CMakeLists.txt | 26 +- .../cache_coherency_cpu_gpu.cc | 24 +- .../cache_coherency_gpu_gpu.cc | 24 +- catch/unit/synchronization/copy_coherency.cc | 23 +- catch/unit/syncthreads/CMakeLists.txt | 20 +- catch/unit/syncthreads/__syncthreads.cc | 26 +- catch/unit/syncthreads/__syncthreads_and.cc | 38 +- .../__syncthreads_and_negative_kernels.cc | 24 +- .../__syncthreads_and_negative_kernels_rtc.hh | 24 +- catch/unit/syncthreads/__syncthreads_count.cc | 38 +- .../__syncthreads_count_negative_kernels.cc | 24 +- ..._syncthreads_count_negative_kernels_rtc.hh | 24 +- catch/unit/syncthreads/__syncthreads_or.cc | 38 +- .../__syncthreads_or_negative_kernels.cc | 24 +- .../__syncthreads_or_negative_kernels_rtc.hh | 24 +- catch/unit/syncthreads/syncthreads_common.hh | 24 +- catch/unit/texture/CMakeLists.txt | 45 +- catch/unit/texture/fixed_point.hh | 24 +- catch/unit/texture/hipBindTexture.cc | 27 +- catch/unit/texture/hipBindTexture2D.cc | 27 +- catch/unit/texture/hipBindTextureToArray.cc | 29 +- .../texture/hipBindTextureToMipmappedArray.cc | 25 +- .../hipCreateTextureObject_ArgValidation.cc | 23 +- .../texture/hipCreateTextureObject_Array.cc | 25 +- .../texture/hipCreateTextureObject_Linear.cc | 23 +- .../texture/hipCreateTextureObject_Pitch2D.cc | 23 +- .../hipDeviceGetTexture1DLinearMaxWidth.cc | 27 +- catch/unit/texture/hipFreeMipmappedArray.cc | 26 +- catch/unit/texture/hipGetChanDesc.cc | 25 +- .../unit/texture/hipGetMipmappedArrayLevel.cc | 26 +- .../texture/hipGetTextureAlignmentOffset.cc | 28 +- catch/unit/texture/hipGetTextureReference.cc | 28 +- catch/unit/texture/hipMallocMipmappedArray.cc | 26 +- catch/unit/texture/hipMipmappedArrayCreate.cc | 26 +- .../unit/texture/hipMipmappedArrayDestroy.cc | 26 +- .../unit/texture/hipMipmappedArrayGetLevel.cc | 26 +- .../hipMipmappedArrayGetMemoryRequirements.cc | 29 +- .../texture/hipNormalizedFloatValueTex.cc | 23 +- .../unit/texture/hipSimpleTexture1DLayered.cc | 25 +- .../unit/texture/hipSimpleTexture2DLayered.cc | 25 +- catch/unit/texture/hipSimpleTexture3D.cc | 23 +- catch/unit/texture/hipTex1DFetchCheckModes.cc | 23 +- catch/unit/texture/hipTexObjPitch.cc | 23 +- catch/unit/texture/hipTexObjectCreate.cc | 43 +- catch/unit/texture/hipTexObjectTests.cc | 35 +- catch/unit/texture/hipTexRefGetAddress.cc | 30 +- catch/unit/texture/hipTexRefGetAddressMode.cc | 25 +- catch/unit/texture/hipTexRefGetArray.cc | 25 +- catch/unit/texture/hipTexRefGetBorderColor.cc | 25 +- catch/unit/texture/hipTexRefGetFlags.cc | 25 +- catch/unit/texture/hipTexRefGetFormat.cc | 27 +- .../unit/texture/hipTexRefGetMaxAnisotropy.cc | 25 +- catch/unit/texture/hipTexRefSetAddress.cc | 30 +- catch/unit/texture/hipTexRefSetAddress2D.cc | 25 +- catch/unit/texture/hipTexRefSetAddressMode.cc | 25 +- catch/unit/texture/hipTexRefSetArray.cc | 27 +- catch/unit/texture/hipTexRefSetBorderColor.cc | 25 +- catch/unit/texture/hipTexRefSetFlags.cc | 25 +- catch/unit/texture/hipTexRefSetFormat.cc | 25 +- .../unit/texture/hipTexRefSetGetFilterMode.cc | 23 +- .../hipTexRefSetGetMipmapFilterMode.cc | 23 +- .../texture/hipTexRefSetGetMipmapLevelBias.cc | 23 +- .../hipTexRefSetGetMipmapLevelClamp.cc | 23 +- .../texture/hipTexRefSetGetMipmappedArray.cc | 24 +- .../unit/texture/hipTexRefSetMaxAnisotropy.cc | 25 +- catch/unit/texture/hipTextureMipmapObj1D.cc | 73 +-- catch/unit/texture/hipTextureMipmapObj2D.cc | 73 +-- catch/unit/texture/hipTextureMipmapObj3D.cc | 73 +-- .../unit/texture/hipTextureObj1DCheckModes.cc | 23 +- .../texture/hipTextureObj1DCheckSRGBModes.cc | 29 +- catch/unit/texture/hipTextureObj1DFetch.cc | 23 +- catch/unit/texture/hipTextureObj2D.cc | 23 +- .../unit/texture/hipTextureObj2DCheckModes.cc | 23 +- .../texture/hipTextureObj2DCheckSRGBModes.cc | 25 +- .../unit/texture/hipTextureObj3DCheckModes.cc | 23 +- .../unit/texture/hipTextureObjFetchVector.cc | 23 +- catch/unit/texture/hipTextureObjectTests.cc | 35 +- catch/unit/texture/hipTextureRef2D.cc | 23 +- catch/unit/texture/hipUnbindTexture.cc | 29 +- catch/unit/texture/kernels.hh | 24 +- catch/unit/texture/test_fixture.hh | 24 +- catch/unit/texture/tex1D.cc | 28 +- catch/unit/texture/tex1DGrad.cc | 28 +- catch/unit/texture/tex1DLayered.cc | 28 +- catch/unit/texture/tex1DLayeredGrad.cc | 28 +- catch/unit/texture/tex1DLayeredLod.cc | 28 +- catch/unit/texture/tex1DLod.cc | 28 +- catch/unit/texture/tex1Dfetch.cc | 28 +- catch/unit/texture/tex2D.cc | 28 +- catch/unit/texture/tex2DGrad.cc | 28 +- catch/unit/texture/tex2DLayered.cc | 28 +- catch/unit/texture/tex2DLayeredGrad.cc | 28 +- catch/unit/texture/tex2DLayeredLod.cc | 28 +- catch/unit/texture/tex2DLod.cc | 28 +- catch/unit/texture/tex2Dgather.cc | 26 +- catch/unit/texture/tex3D.cc | 28 +- catch/unit/texture/tex3DGrad.cc | 28 +- catch/unit/texture/tex3DLod.cc | 28 +- catch/unit/texture/texCubemap.cc | 28 +- catch/unit/texture/texCubemapGrad.cc | 28 +- catch/unit/texture/texCubemapLayered.cc | 28 +- catch/unit/texture/texCubemapLayeredGrad.cc | 28 +- catch/unit/texture/texCubemapLayeredLod.cc | 28 +- catch/unit/texture/texCubemapLod.cc | 28 +- catch/unit/texture/tex_ref_get_module.cc | 23 +- catch/unit/texture/texture_reference.hh | 24 +- catch/unit/texture/utils.hh | 24 +- catch/unit/texture/vec4.hh | 24 +- catch/unit/threadfence/CMakeLists.txt | 22 +- catch/unit/threadfence/__threadfence.cc | 34 +- catch/unit/threadfence/__threadfence_block.cc | 34 +- .../unit/threadfence/__threadfence_system.cc | 28 +- catch/unit/threadfence/threadfence_common.hh | 24 +- catch/unit/vector_types/CMakeLists.txt | 20 +- catch/unit/vector_types/dim3.cc | 37 +- .../vector_types/negative_bitwise_double.cc | 21 +- .../vector_types/negative_bitwise_float.cc | 21 +- .../negative_bitwise_float_double_rtc.hh | 21 +- ...calculate_assign_with_unsigned_value_1D.cc | 21 +- ...calculate_assign_with_unsigned_value_2D.cc | 21 +- ...calculate_assign_with_unsigned_value_3D.cc | 21 +- ...calculate_assign_with_unsigned_value_4D.cc | 21 +- ...negative_calculate_assign_with_value_1D.cc | 21 +- ...negative_calculate_assign_with_value_2D.cc | 21 +- ...negative_calculate_assign_with_value_3D.cc | 21 +- ...negative_calculate_assign_with_value_4D.cc | 21 +- ...egative_calculate_assign_with_value_rtc.hh | 21 +- .../vector_types/negative_macros_common.hh | 21 +- .../vector_types/negative_negate_unsigned.cc | 21 +- .../negative_negate_unsigned_rtc.hh | 21 +- .../vector_types/vector_operations_common.hh | 21 +- catch/unit/vector_types/vector_types.cc | 57 +- .../unit/vector_types/vector_types_common.hh | 21 +- .../virtualMemoryManagement/CMakeLists.txt | 31 +- .../hipGetProcAddressVmmApis.cc | 23 +- .../hipMemAddressFree.cc | 28 +- .../hipMemAddressReserve.cc | 30 +- .../virtualMemoryManagement/hipMemCreate.cc | 40 +- .../hipMemExportToShareableHandle.cc | 30 +- .../hipMemGetAllocationGranularity.cc | 30 +- ...hipMemGetAllocationPropertiesFromHandle.cc | 30 +- .../hipMemGetHandleForAddressRange.cc | 41 +- .../hipMemImportFromShareableHandle.cc | 36 +- .../unit/virtualMemoryManagement/hipMemMap.cc | 42 +- .../hipMemMapArrayAsync.cc | 26 +- .../virtualMemoryManagement/hipMemRelease.cc | 28 +- .../hipMemRetainAllocationHandle.cc | 30 +- .../hipMemSetGetAccess.cc | 60 +- .../virtualMemoryManagement/hipMemUnmap.cc | 28 +- .../virtualMemoryManagement/hipMemVmm_old.cc | 91 --- .../virtualMemoryManagement/hip_vmm_common.hh | 24 +- catch/unit/vulkan_interop/CMakeLists.txt | 4 + .../unit/vulkan_interop/graph_tests_common.hh | 24 +- .../hipDestroyExternalMemory.cc | 27 +- .../hipDestroyExternalSemaphore.cc | 27 +- .../hipExternalMemoryGetMappedBuffer.cc | 35 +- ...ipExternalMemoryGetMappedMipmappedArray.cc | 33 +- ...hipGraphAddExternalSemaphoresSignalNode.cc | 31 +- .../hipGraphAddExternalSemaphoresWaitNode.cc | 31 +- ...ecExternalSemaphoresSignalNodeSetParams.cc | 33 +- ...ExecExternalSemaphoresWaitNodeSetParams.cc | 33 +- ...phExternalSemaphoresSignalNodeGetParams.cc | 25 +- ...phExternalSemaphoresSignalNodeSetParams.cc | 32 +- ...raphExternalSemaphoresWaitNodeGetParams.cc | 25 +- ...raphExternalSemaphoresWaitNodeSetParams.cc | 31 +- .../vulkan_interop/hipImportExternalMemory.cc | 27 +- .../hipImportExternalSemaphore.cc | 27 +- .../hipSignalExternalSemaphoresAsync.cc | 31 +- .../hipWaitExternalSemaphoresAsync.cc | 31 +- .../vulkan_interop/signal_semaphore_common.hh | 21 +- catch/unit/vulkan_interop/vulkan_test.cc | 23 +- catch/unit/vulkan_interop/vulkan_test.hh | 21 +- .../vulkan_interop/wait_semaphore_common.hh | 21 +- catch/unit/warp/CMakeLists.txt | 23 +- catch/unit/warp/hipMatchSyncAllTests.cc | 23 +- catch/unit/warp/hipMatchSyncAnyTests.cc | 23 +- catch/unit/warp/hipShflSyncDownTests.cc | 23 +- catch/unit/warp/hipShflSyncTests.cc | 23 +- catch/unit/warp/hipShflSyncUpTests.cc | 23 +- catch/unit/warp/hipShflSyncXorTests.cc | 23 +- catch/unit/warp/hipShflTests.cc | 25 +- catch/unit/warp/hipShflUpDownTest.cc | 27 +- catch/unit/warp/hipVoteSyncTests.cc | 27 +- catch/unit/warp/warp_all.cc | 30 +- catch/unit/warp/warp_any.cc | 30 +- catch/unit/warp/warp_ballot.cc | 30 +- catch/unit/warp/warp_reduce.cc | 28 +- catch/unit/warp/warp_shfl.cc | 23 +- catch/unit/warp/warp_shfl_common.hh | 25 +- catch/unit/warp/warp_shfl_down.cc | 23 +- catch/unit/warp/warp_shfl_up.cc | 23 +- catch/unit/warp/warp_shfl_xor.cc | 34 +- catch/unit/warp/warp_vote_common.hh | 21 +- samples/0_Intro/CMakeLists.txt | 23 +- samples/0_Intro/bit_extract/CMakeLists.txt | 20 +- samples/0_Intro/bit_extract/bit_extract.cpp | 24 +- samples/0_Intro/generic_target/CMakeLists.txt | 20 +- samples/0_Intro/generic_target/saxpy.cpp | 24 +- samples/0_Intro/generic_target/square.cpp | 24 +- samples/0_Intro/module_api/CMakeLists.txt | 22 +- samples/0_Intro/module_api/defaultDriver.cpp | 24 +- .../0_Intro/module_api/launchKernelHcc.cpp | 24 +- samples/0_Intro/module_api/runKernel.cpp | 24 +- samples/0_Intro/module_api/vcpy_kernel.cpp | 24 +- .../0_Intro/module_api_global/CMakeLists.txt | 22 +- .../0_Intro/module_api_global/runKernel.cpp | 24 +- .../0_Intro/module_api_global/vcpy_kernel.cpp | 24 +- samples/0_Intro/square/CMakeLists.txt | 135 ++++- samples/0_Intro/square/square.cu | 24 +- samples/0_Intro/square/square.hipref.cpp | 24 +- samples/1_Utils/CMakeLists.txt | 22 +- .../1_Utils/hipDispatchLatency/CMakeLists.txt | 24 +- .../hipDispatchEnqueueRateMT.cpp | 21 +- .../hipDispatchLatency/hipDispatchLatency.cpp | 21 +- .../hipDispatchLatency/test_kernel.cpp | 21 +- samples/1_Utils/hipInfo/CMakeLists.txt | 20 +- samples/1_Utils/hipInfo/hipInfo.cpp | 24 +- .../0_MatrixTranspose/CMakeLists.txt | 20 +- .../0_MatrixTranspose/MatrixTranspose.cpp | 24 +- .../2_Cookbook/10_inline_asm/CMakeLists.txt | 20 +- .../2_Cookbook/10_inline_asm/inline_asm.cpp | 24 +- .../11_texture_driver/CMakeLists.txt | 24 +- .../11_texture_driver/tex2dKernel.cpp | 23 +- .../11_texture_driver/texture2dDrv.cpp | 24 +- .../CMakeLists.txt | 28 +- .../MatrixTranspose.cpp | 24 +- .../12_cmake_hip_add_executable/Readme.md | 2 + .../2_Cookbook/13_occupancy/CMakeLists.txt | 20 +- samples/2_Cookbook/13_occupancy/occupancy.cpp | 21 +- samples/2_Cookbook/14_gpu_arch/CMakeLists.txt | 20 +- samples/2_Cookbook/14_gpu_arch/gpuarch.cpp | 21 +- .../device_functions/CMakeLists.txt | 97 ++- .../device_functions/hipDevice.cpp | 22 +- .../device_functions/hipMain2.cpp | 22 +- .../host_functions/CMakeLists.txt | 106 +++- .../host_functions/hipMain1.cpp | 22 +- .../host_functions/hipOptLibrary.cpp | 22 +- .../16_assembly_to_executable/CMakeLists.txt | 125 ++-- .../16_assembly_to_executable/square.cpp | 21 +- .../17_llvm_ir_to_executable/CMakeLists.txt | 148 +++-- .../17_llvm_ir_to_executable/square.cpp | 21 +- .../18_cmake_hip_device/CMakeLists.txt | 55 +- .../2_Cookbook/18_cmake_hip_device/square.cpp | 24 +- .../2_Cookbook/19_cmake_lang/CMakeLists.txt | 10 + .../19_cmake_lang/MatrixTranspose.cpp | 24 +- samples/2_Cookbook/1_hipEvent/CMakeLists.txt | 20 +- samples/2_Cookbook/1_hipEvent/hipEvent.cpp | 24 +- .../21_cmake_hip_cxx_clang/CMakeLists.txt | 55 +- .../21_cmake_hip_cxx_clang/square.cpp | 24 +- .../22_cmake_hip_lang/CMakeLists.txt | 44 +- .../2_Cookbook/22_cmake_hip_lang/square.hip | 24 +- .../2_Cookbook/23_cmake_hiprtc/CMakeLists.txt | 55 +- samples/2_Cookbook/23_cmake_hiprtc/saxpy.cpp | 24 +- .../2_Cookbook/3_shared_memory/CMakeLists.txt | 20 +- .../3_shared_memory/sharedMemory.cpp | 24 +- samples/2_Cookbook/4_shfl/CMakeLists.txt | 20 +- samples/2_Cookbook/4_shfl/shfl.cpp | 24 +- samples/2_Cookbook/5_2dshfl/2dshfl.cpp | 24 +- samples/2_Cookbook/5_2dshfl/CMakeLists.txt | 20 +- .../6_dynamic_shared/CMakeLists.txt | 20 +- .../6_dynamic_shared/dynamic_shared.cpp | 24 +- samples/2_Cookbook/7_streams/CMakeLists.txt | 20 +- samples/2_Cookbook/7_streams/stream.cpp | 24 +- samples/2_Cookbook/8_peer2peer/CMakeLists.txt | 20 +- samples/2_Cookbook/8_peer2peer/peer2peer.cpp | 21 +- samples/2_Cookbook/9_unroll/CMakeLists.txt | 20 +- samples/2_Cookbook/9_unroll/unroll.cpp | 24 +- samples/2_Cookbook/CMakeLists.txt | 35 +- samples/CMakeLists.txt | 46 +- samples/common/DetectGPUArchs.cmake | 31 +- samples/common/hip_helper.h | 24 +- samples/packaging/CMakeLists.txt | 21 +- utils/coverage/CMakeLists.txt | 20 +- utils/coverage/hipAPI.cpp | 24 +- utils/coverage/hipAPI.h | 24 +- utils/coverage/hipAPICoverageUtils.cpp | 24 +- utils/coverage/hipAPICoverageUtils.h | 24 +- utils/coverage/hipAPIGroup.cpp | 24 +- utils/coverage/hipAPIGroup.h | 24 +- utils/coverage/mainCoverage.cpp | 24 +- utils/coverage/reportGenerators.cpp | 24 +- utils/coverage/reportGenerators.h | 24 +- 1464 files changed, 11372 insertions(+), 39098 deletions(-) delete mode 100644 catch/config/__pycache__/common.cpython-310.pyc delete mode 100644 catch/unit/assertion/constexpr_assert.cc delete mode 100644 catch/unit/device/hipDeviceGetLimit_old.cc delete mode 100644 catch/unit/device/hipDeviceSetLimit_old.cc delete mode 100644 catch/unit/deviceLib/BuiltIns_fadd.cc delete mode 100644 catch/unit/deviceLib/FloatMathPrecise.cc delete mode 100644 catch/unit/graph/hipGraphAddDependencies_old.cc delete mode 100644 catch/unit/graph/hipGraphAddMemcpyNode_old.cc delete mode 100644 catch/unit/graph/hipGraphGetEdges_old.cc delete mode 100644 catch/unit/graph/hipGraphGetNodes_old.cc delete mode 100644 catch/unit/graph/hipGraphMemcpyNodeSetParams_old.cc delete mode 100644 catch/unit/graph/hipGraphNodeGetDependencies_old.cc delete mode 100644 catch/unit/graph/hipGraphNodeGetDependentNodes_old.cc delete mode 100644 catch/unit/graph/hipGraphRemoveDependencies_old.cc delete mode 100644 catch/unit/graph/hipStreamGetCaptureInfo_v2_old.cc delete mode 100644 catch/unit/memory/hipMemRangeGetAttributes_old.cc delete mode 100644 catch/unit/memory/hipMemcpyParam2D_old.cc delete mode 100644 catch/unit/memory/hipMemcpyPeer_old.cc delete mode 100644 catch/unit/memory/hipMemsetBasic.cc delete mode 100644 catch/unit/memory/malloc.cc delete mode 100644 catch/unit/module/hipModuleGetLoadingMode.cc delete mode 100644 catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor_old.cc delete mode 100644 catch/unit/occupancy/hipOccupancyMaxPotentialBlockSize_old.cc delete mode 100644 catch/unit/stream/hipAPIStreamDisable.cc delete mode 100644 catch/unit/stream/hipStreamAttachMemAsync_old.cc delete mode 100644 catch/unit/virtualMemoryManagement/hipMemVmm_old.cc diff --git a/catch/ABM/AddKernels/CMakeLists.txt b/catch/ABM/AddKernels/CMakeLists.txt index 776f0fa5f..fdbcd0093 100644 --- a/catch/ABM/AddKernels/CMakeLists.txt +++ b/catch/ABM/AddKernels/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC add.cc @@ -6,3 +10,4 @@ set(TEST_SRC hip_add_exe_to_target(NAME ABMAddKernels TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests) + diff --git a/catch/ABM/AddKernels/add.cc b/catch/ABM/AddKernels/add.cc index 1b7c56cdf..019b4ab72 100644 --- a/catch/ABM/AddKernels/add.cc +++ b/catch/ABM/AddKernels/add.cc @@ -1,3 +1,9 @@ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -6,7 +12,7 @@ template __global__ void add(T* a, T* b, T* c, size_t size) { if (i < size) c[i] = a[i] + b[i]; } -TEMPLATE_TEST_CASE("ABM_AddKernel_MultiTypeMultiSize", "", int, long, float, long long, double) { +TEMPLATE_TEST_CASE(ABM_AddKernel_MultiTypeMultiSize, int, long, float, long long, double) { auto size = GENERATE(as{}, 100, 500, 1000); TestType *d_a, *d_b, *d_c; auto res = hipMalloc(&d_a, sizeof(TestType) * size); diff --git a/catch/ABM/CMakeLists.txt b/catch/ABM/CMakeLists.txt index 53fa9e8b0..f9034f7b0 100644 --- a/catch/ABM/CMakeLists.txt +++ b/catch/ABM/CMakeLists.txt @@ -1 +1,5 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + add_subdirectory(AddKernels) diff --git a/catch/CMakeLists.txt b/catch/CMakeLists.txt index ecd1cca3e..d27592334 100644 --- a/catch/CMakeLists.txt +++ b/catch/CMakeLists.txt @@ -1,6 +1,26 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + cmake_minimum_required(VERSION 3.20) -project(hiptests LANGUAGES C CXX HIP) +if (HIP_PLATFORM MATCHES "nvidia") + if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) + set(CMAKE_CUDA_ARCHITECTURES 75) + endif() + set(GPGPU_LANGUAGE CUDA) + set(GPGPU_LINKER_LIBRARIES hip::host hip::device cuda) +elseif (HIP_PLATFORM MATCHES "amd") + set(GPGPU_LANGUAGE HIP) + set(GPGPU_LINKER_LIBRARIES hip::host hip::device) +endif() +project(hiptests LANGUAGES C CXX ${GPGPU_LANGUAGE}) +enable_language(${GPGPU_LANGUAGE}) + +if (HIP_PLATFORM MATCHES "nvidia") + find_package(CUDAToolkit REQUIRED) + set(CMAKE_HIP_COMPILER ${CUDAToolkit_NVCC_EXECUTABLE}) +endif() option(ENABLE_ADDRESS_SANITIZER "Option to enable ASAN build" OFF) option(BUILD_SHARED_LIBS "Option for testing shared libraries" ON) @@ -12,7 +32,7 @@ option(RTC_TESTING "Run tests using HIP RTC to compile the kernels" OFF) option(ENABLE_SPIRV "Build hip-tests for SPIRV" OFF) if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") + set(CMAKE_BUILD_TYPE "Release") endif() set(CMAKE_CXX_STANDARD 17) @@ -24,6 +44,7 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../../lib") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) find_package(hip REQUIRED) +include_directories(${hip_INCLUDE_DIRS}) find_package(hiprtc) find_package(Git) find_package(Python 3 COMPONENTS Interpreter REQUIRED) @@ -32,20 +53,20 @@ find_program(HIPCONFIG_EXEC hipconfig REQUIRED) # hip root dir is 3 levels down the hip-config.cmake file path set(HIP_PATH ${hip_DIR}/../../../) if(NOT DEFINED ROCM_PATH) - set(ROCM_PATH "/opt/rocm") - if(NOT EXISTS "${ROCM_PATH}") - set(ROCM_PATH ${HIP_PATH}) - endif() + set(ROCM_PATH "/opt/rocm") + if(NOT EXISTS "${ROCM_PATH}") + set(ROCM_PATH ${HIP_PATH}) + endif() endif() if(UNIX) - if(NOT ENABLE_SPIRV) - find_program(ROCM_AGENT_ENUMERATOR_EXEC rocm_agent_enumerator REQUIRED) - endif() - find_program(GCC_EXEC gcc) - find_program(GXX_EXEC g++) + if(NOT ENABLE_SPIRV) + find_program(ROCM_AGENT_ENUMERATOR_EXEC rocm_agent_enumerator REQUIRED) + endif() + find_program(GCC_EXEC gcc) + find_program(GXX_EXEC g++) else() # Win32 - find_program(LLVM_RC_EXEC NAMES llvm-rc llvm-rc.exe + find_program(LLVM_RC_EXEC NAMES llvm-rc llvm-rc.exe PATHS ${HIP_PATH} ${HIP_PATH}../lc/bin ${ROCM_PATH}) endif() @@ -57,19 +78,19 @@ message(STATUS "HIP Lib path: ${HIP_LIB_INSTALL_DIR}") set(HIP_PATH_OPT "--hip-path=${HIP_PATH}") if(TEST_CLOCK_CYCLE) - add_definitions(-DTEST_CLOCK_CYCLE) + add_definitions(-DTEST_CLOCK_CYCLE) endif() # flag to generate standalone exe per src file. message(STATUS "STANDALONE_TESTS : ${STANDALONE_TESTS}") if(NOT WIN32) - set(CPACK_SET_DESTDIR ON CACHE BOOL "Installer package will install hip catch to CMAKE_INSTALL_PREFIX instead of CPACK_PACKAGING_INSTALL_PREFIX") + set(CPACK_SET_DESTDIR ON CACHE BOOL "Installer package will install hip catch to CMAKE_INSTALL_PREFIX instead of CPACK_PACKAGING_INSTALL_PREFIX") endif() # Check if platform is set if(NOT HIP_PLATFORM STREQUAL "amd" AND NOT HIP_PLATFORM STREQUAL "nvidia") - message(FATAL_ERROR "Unexpected HIP_PLATFORM: " ${HIP_PLATFORM}) + message(FATAL_ERROR "Unexpected HIP_PLATFORM: " ${HIP_PLATFORM}) endif() execute_process(COMMAND ${HIPCONFIG_EXEC} --version @@ -99,23 +120,23 @@ endif() set(ASAN_CONFIG_DEF) if(ENABLE_ADDRESS_SANITIZER OR THEROCK_SANITIZER STREQUAL "ASAN" OR THEROCK_SANITIZER STREQUAL "HOST_ASAN") - message(STATUS "Building catch tests with Address Sanitizer options") - # If user is building hip-tests standalone (without TheRock) and wants to turn on sanitizer - # We append the flags manually, otherwise we use TheRock's CXX flags which already should have - # `-fsanitize=address` in it. - if(ENABLE_ADDRESS_SANITIZER) - # We support clang for this - if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR NOT CMAKE_HIP_COMPILER_ID STREQUAL "Clang") - message(WARNING "CXX and HIP compiler are not Clang, sanitizer build might fail") - endif() - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -shared-libasan -g") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -shared-libasan -g") + message(STATUS "Building catch tests with Address Sanitizer options") + # If user is building hip-tests standalone (without TheRock) and wants to turn on sanitizer + # We append the flags manually, otherwise we use TheRock's CXX flags which already should have + # `-fsanitize=address` in it. + if(ENABLE_ADDRESS_SANITIZER) + # We support clang for this + if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR NOT CMAKE_HIP_COMPILER_ID STREQUAL "Clang") + message(WARNING "CXX and HIP compiler are not Clang, sanitizer build might fail") endif() - set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -fsanitize=address -fno-omit-frame-pointer -shared-libasan -g") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -shared-libasan") - add_compile_definitions(ENABLE_ADDRESS_SANITIZER) - set(ASAN_CONFIG_DEF "-DENABLE_ADDRESS_SANITIZER") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-omit-frame-pointer -shared-libasan -g") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -shared-libasan -g") + endif() + set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} -fsanitize=address -fno-omit-frame-pointer -shared-libasan -g") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address -shared-libasan") + add_compile_definitions(ENABLE_ADDRESS_SANITIZER) + set(ASAN_CONFIG_DEF "-DENABLE_ADDRESS_SANITIZER") endif() string(REPLACE "." ";" VERSION_LIST ${HIP_VERSION}) @@ -127,60 +148,66 @@ list(GET VERSION_LIST 0 HIP_VERSION_PATCH) list(GET VERSION_LIST 1 HIP_VERSION_GITHASH) if(DEFINED ENV{ROCM_LIBPATCH_VERSION}) - set(HIP_PACKAGING_VERSION_PATCH ${HIP_VERSION_PATCH}.$ENV{ROCM_LIBPATCH_VERSION}) + set(HIP_PACKAGING_VERSION_PATCH ${HIP_VERSION_PATCH}.$ENV{ROCM_LIBPATCH_VERSION}) else() - set(HIP_PACKAGING_VERSION_PATCH ${HIP_VERSION_PATCH}-${HIP_VERSION_GITHASH}) + set(HIP_PACKAGING_VERSION_PATCH ${HIP_VERSION_PATCH}-${HIP_VERSION_GITHASH}) endif() find_package(Catch2 3.8.1 QUIET) if(Catch2_FOUND) - message(STATUS "Catch2 v3.8.1 found: ${Catch2_DIR}") - # for packaging - set(CATCH_ADD_TESTS_SCRIPT ${Catch2_DIR}/CatchAddTests.cmake) - file(GLOB CATCH_LIBS "${Catch2_DIR}/../../*Catch2*") + message(STATUS "Catch2 v3.8.1 found: ${Catch2_DIR}") + # for packaging + set(CATCH_ADD_TESTS_SCRIPT ${Catch2_DIR}/CatchAddTests.cmake) + file(GLOB CATCH_LIBS "${Catch2_DIR}/../../*Catch2*") else() - # On Windows, ensure Catch2 uses the same MSVC runtime library and build configuration as our tests - if(WIN32) - set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libraries" FORCE) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "MSVC runtime library" FORCE) - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(win_disable_warnings -fms-runtime-lib=static_dbg) - endif() + # On Windows, ensure Catch2 uses the same MSVC runtime library and build configuration as our tests + if(WIN32) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build static libraries" FORCE) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "MSVC runtime library" FORCE) + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(win_disable_warnings -fms-runtime-lib=static_dbg) endif() - # Setup catch2 manually - include(FetchContent) - FetchContent_Declare( + endif() + # Setup catch2 manually + include(FetchContent) + FetchContent_Declare( Catch2 DOWNLOAD_EXTRACT_TIMESTAMP OFF URL "https://rocm-third-party-deps.s3.us-east-2.amazonaws.com/Catch2-3.8.1.tar.gz" URL_HASH SHA256=18b3f70ac80fccc340d8c6ff0f339b2ae64944782f8d2fca2bd705cf47cadb79 ) - FetchContent_MakeAvailable(Catch2) - # for packaging - set(CATCH_ADD_TESTS_SCRIPT ${Catch2_SOURCE_DIR}/extras/CatchAddTests.cmake) - set(CATCH_LIBS $) + FetchContent_MakeAvailable(Catch2) + # for packaging + set(CATCH_ADD_TESTS_SCRIPT ${Catch2_SOURCE_DIR}/extras/CatchAddTests.cmake) + set(CATCH_LIBS $) endif() include(cmake/hip-tests.cmake) include(CTest) +set(CATCH_BUILD_DIR catch_tests) + +set(CATCH_INCLUDE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CATCH_BUILD_DIR}/include) +execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CATCH_INCLUDE_BINARY_DIR}) + include_directories( "./include" + ${CATCH_INCLUDE_BINARY_DIR} "./kernels" "${CMAKE_CURRENT_LIST_DIR}/external/picojson" ) if (RTC_TESTING) - add_definitions(-DRTC_TESTING=ON) + add_definitions(-DRTC_TESTING=ON) endif() add_definitions(-DKERNELS_PATH="${CMAKE_CURRENT_SOURCE_DIR}/kernels/") -set(CATCH_BUILD_DIR catch_tests) +# old config set(HIP_TEST_CONFIG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CATCH_BUILD_DIR}/config) file(MAKE_DIRECTORY ${HIP_TEST_CONFIG_BINARY_DIR}) file(GLOB JSON_FILES "./hipTestMain/config/*.json") foreach(json IN LISTS JSON_FILES) - file(COPY ${json} + file(COPY ${json} DESTINATION ${HIP_TEST_CONFIG_BINARY_DIR}) endforeach() @@ -199,38 +226,41 @@ if (WIN32) SET(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "") endif() -# Add debug flags for RelWithDebInfo and Debug builds on Windows +# Add debug and optimization flags for Windows builds if(WIN32) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_compile_options($<$,$,$>>:-g>) add_compile_options($<$,$,$>>:-gcodeview>) - add_compile_options($<$,$,$>>:-gline-tables-only>) + add_compile_options($<$,$>:-O3>) + add_compile_options($<$,$>:-O2>) + add_compile_options($<$,$>:-O0>) endif() if(CMAKE_HIP_COMPILER_ID STREQUAL "Clang" OR HIP_PLATFORM STREQUAL "amd") add_compile_options($<$,$,$>>:-g>) add_compile_options($<$,$,$>>:-gcodeview>) - add_compile_options($<$,$,$>>:-gline-tables-only>) + add_compile_options($<$,$>:-O3>) + add_compile_options($<$,$>:-O2>) + add_compile_options($<$,$>:-O0>) + endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_HIP_COMPILER_ID STREQUAL "Clang" OR HIP_PLATFORM STREQUAL "amd") add_link_options($<$,$>:-Xlinker>) add_link_options($<$,$>:/DEBUG:FULL>) endif() endif() if(HIP_PLATFORM STREQUAL "amd") - if(WIN32) - set(win_disable_warnings ${win_disable_warnings} -Wno-ignored-attributes -Wno-microsoft-cast) - # Windows for some reason does not honor the `CMAKE_CXX_STANDARD` we set initially in the file - # Which results in errors about missing headers etc - set(win_cxx_standard -std=c++17) - endif() - add_compile_options(${HIP_PATH_OPT} ${win_cxx_standard} -x hip -Wall -Wextra -Wvla -Wno-deprecated -Wno-option-ignored -Wno-unused-parameter ${win_disable_warnings}) - if(CMAKE_BUILD_TYPE STREQUAL "Release") - add_compile_options(-O3) - endif() + if(WIN32) + set(win_disable_warnings ${win_disable_warnings} -Wno-ignored-attributes -Wno-microsoft-cast) + # Windows for some reason does not honor the `CMAKE_CXX_STANDARD` we set initially in the file + # Which results in errors about missing headers etc + set(win_cxx_standard -std=c++17) + endif() + add_compile_options(${HIP_PATH_OPT} ${win_cxx_standard} -x hip -Wall -Wextra -Wvla -Wno-deprecated -Wno-option-ignored -Wno-unused-parameter ${win_disable_warnings}) endif() # Turn off CMAKE_HIP_ARCHITECTURES Feature if cmake version is 3.21+ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.21.0) - set(CMAKE_HIP_ARCHITECTURES OFF) + set(CMAKE_HIP_ARCHITECTURES OFF) endif() message(STATUS "CMAKE HIP ARCHITECTURES: ${CMAKE_HIP_ARCHITECTURES}") @@ -244,33 +274,33 @@ message(STATUS "CMAKE HIP ARCHITECTURES: ${CMAKE_HIP_ARCHITECTURES}") # OFFLOAD_ARCH_STR # rocm_agent_enumerator if(ENABLE_SPIRV) - set(OFFLOAD_ARCH_STR "--offload-arch=amdgcnspirv") + set(OFFLOAD_ARCH_STR "--offload-arch=amdgcnspirv") elseif(DEFINED OFFLOAD_ARCH_STR) - string(REPLACE "--offload-arch=" "" HIP_GPU_ARCH_LIST ${OFFLOAD_ARCH_STR}) + string(REPLACE "--offload-arch=" "" HIP_GPU_ARCH_LIST ${OFFLOAD_ARCH_STR}) elseif(DEFINED GPU_TARGETS) - foreach(_hip_gpu_arch ${GPU_TARGETS}) - set(OFFLOAD_ARCH_STR "--offload-arch=${_hip_gpu_arch} ${OFFLOAD_ARCH_STR}") - endforeach() + foreach(_hip_gpu_arch ${GPU_TARGETS}) + set(OFFLOAD_ARCH_STR "--offload-arch=${_hip_gpu_arch} ${OFFLOAD_ARCH_STR}") + endforeach() elseif(NOT DEFINED OFFLOAD_ARCH_STR AND EXISTS "${ROCM_AGENT_ENUMERATOR_EXEC}" AND HIP_PLATFORM STREQUAL "amd" AND UNIX) - execute_process(COMMAND "${ROCM_PATH}/bin/rocm_agent_enumerator" + execute_process(COMMAND "${ROCM_PATH}/bin/rocm_agent_enumerator" OUTPUT_VARIABLE HIP_GPU_ARCH RESULT_VARIABLE ROCM_AGENT_ENUM_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE) - # Trim out gfx000 - string(REPLACE "gfx000\n" "" HIP_GPU_ARCH ${HIP_GPU_ARCH}) - if (NOT HIP_GPU_ARCH STREQUAL "") - string(REGEX REPLACE "\n" ";" HIP_GPU_ARCH_LIST "${HIP_GPU_ARCH}") - list(REMOVE_DUPLICATES HIP_GPU_ARCH_LIST) - list(LENGTH HIP_GPU_ARCH_LIST HIP_GPU_ARCH_LEN) - set(OFFLOAD_ARCH_STR "") - foreach(_hip_gpu_arch ${HIP_GPU_ARCH_LIST}) - set(OFFLOAD_ARCH_STR "--offload-arch=${_hip_gpu_arch} ${OFFLOAD_ARCH_STR}") - endforeach() - else() - message(STATUS "ROCm Agent Enumerator found no valid architectures") - endif() + # Trim out gfx000 + string(REPLACE "gfx000\n" "" HIP_GPU_ARCH ${HIP_GPU_ARCH}) + if (NOT HIP_GPU_ARCH STREQUAL "") + string(REGEX REPLACE "\n" ";" HIP_GPU_ARCH_LIST "${HIP_GPU_ARCH}") + list(REMOVE_DUPLICATES HIP_GPU_ARCH_LIST) + list(LENGTH HIP_GPU_ARCH_LIST HIP_GPU_ARCH_LEN) + set(OFFLOAD_ARCH_STR "") + foreach(_hip_gpu_arch ${HIP_GPU_ARCH_LIST}) + set(OFFLOAD_ARCH_STR "--offload-arch=${_hip_gpu_arch} ${OFFLOAD_ARCH_STR}") + endforeach() + else() + message(STATUS "ROCm Agent Enumerator found no valid architectures") + endif() endif() # Trim any trailing spaces, this trips up the cxx function call @@ -278,9 +308,14 @@ string(STRIP "${OFFLOAD_ARCH_STR}" OFFLOAD_ARCH_STR) message(STATUS "Using offload arch string: ${OFFLOAD_ARCH_STR}") if(DEFINED OFFLOAD_ARCH_STR) - set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} ${OFFLOAD_ARCH_STR}") + set(CMAKE_HIP_FLAGS "${CMAKE_HIP_FLAGS} ${OFFLOAD_ARCH_STR}") endif() +string(TOUPPER "${CMAKE_BUILD_TYPE}" _HIP_BUILD_TYPE_UPPER) +separate_arguments(HIP_DEVICE_BUILD_FLAGS_NO_ARCH NATIVE_COMMAND + "${CMAKE_HIP_FLAGS} ${CMAKE_HIP_FLAGS_${_HIP_BUILD_TYPE_UPPER}}") +list(FILTER HIP_DEVICE_BUILD_FLAGS_NO_ARCH EXCLUDE REGEX "--offload-arch=") + # get hip-tests commit short hash execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} @@ -294,37 +329,42 @@ endif() set(OFFLOAD_ARCH_LIST ${OFFLOAD_ARCH_STR}) separate_arguments(OFFLOAD_ARCH_LIST) list(REMOVE_DUPLICATES OFFLOAD_ARCH_LIST) -set(hip_gpu_arch_list "") +set(HIP_GPU_ARCH_LIST "") foreach(__offload_arch ${OFFLOAD_ARCH_LIST}) string(REPLACE "--offload-arch=" "" targetid ${__offload_arch}) string(REPLACE ":" ";" target_id_list ${targetid}) list(GET target_id_list 0 arch) - string(APPEND hip_gpu_arch_list "${arch};") - list(REMOVE_DUPLICATES hip_gpu_arch_list) + string(APPEND HIP_GPU_ARCH_LIST "${arch};") + list(REMOVE_DUPLICATES HIP_GPU_ARCH_LIST) endforeach() +# config generation +add_subdirectory(config) + +# old config if(WIN32) - set(configToUse "config_amd_windows") - set(config_file ${CMAKE_SOURCE_DIR}/hipTestMain/config/${configToUse}) - set(json_file ${HIP_TEST_CONFIG_BINARY_DIR}/${configToUse}.json) + set(configToUse "config_amd_windows") + set(config_file ${CMAKE_SOURCE_DIR}/hipTestMain/config/${configToUse}) + set(json_file ${HIP_TEST_CONFIG_BINARY_DIR}/${configToUse}.json) - set(cmd "${CLANG_CPP_EXEC} -P ${ASAN_CONFIG_DEF} -DGITHASH=\"${HIP_VERSION_GITHASH}\" ${config_file}>${json_file}") - message(${cmd}) - execute_process(COMMAND cmd.exe /C ${cmd} + set(cmd "${CLANG_CPP_EXEC} -P ${ASAN_CONFIG_DEF} -DGITHASH=\"${HIP_VERSION_GITHASH}\" ${config_file}>${json_file}") + message(${cmd}) + execute_process(COMMAND cmd.exe /C ${cmd} RESULT_VARIABLE json_result) - message(STATUS "${configToUse}.json file generation result: ${json_result}") + message(STATUS "${configToUse}.json file generation result: ${json_result}") else() set(configToUse "config_amd_linux") - foreach(arch ${hip_gpu_arch_list}) + foreach(arch ${HIP_GPU_ARCH_LIST}) set(config_file ${CMAKE_SOURCE_DIR}/hipTestMain/config/${configToUse}) set(json_file ${HIP_TEST_CONFIG_BINARY_DIR}/${configToUse}_${arch}.json) set(cmd "${CLANG_CPP_EXEC} -P ${ASAN_CONFIG_DEF} -D${arch} -DGITHASH=\\\"${HIP_VERSION_GITHASH}\\\" ${config_file}>${json_file}") message(${cmd}) execute_process(COMMAND bash -c ${cmd} RESULT_VARIABLE json_result) - message(STATUS "${configToUse}_${arch}.json file generation result: ${json_result}") - endforeach() + message(STATUS "${configToUse}_${arch}.json file generation result: ${json_result}") + endforeach() endif() + # prints the catch info to a file string(TIMESTAMP _timestamp UTC) set(_autogen "# Auto-generated by cmake on ${_timestamp} UTC\n") @@ -345,60 +385,51 @@ file(COPY ${CATCH_ADD_TESTS_SCRIPT} set_property(GLOBAL APPEND PROPERTY G_INSTALL_SCRIPT_TARGETS ${CATCH_ADD_TESTS_SCRIPT}) # copy python script and headers to catch test package -set(CATCH_INCLUDE_DIR include) -execute_process(COMMAND ${CMAKE_COMMAND} -E - make_directory ${CMAKE_CURRENT_BINARY_DIR}/${CATCH_BUILD_DIR}/${CATCH_INCLUDE_DIR}) - file(COPY ./unit/compileAndCaptureOutput.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CATCH_BUILD_DIR}/unit ) -file(COPY ./include/hip_test_common.hh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CATCH_BUILD_DIR}/${CATCH_INCLUDE_DIR}) -file(COPY ./include/hip_test_context.hh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${CATCH_BUILD_DIR}/${CATCH_INCLUDE_DIR}) +file(COPY ./include/hip_test_common.hh DESTINATION ${CATCH_INCLUDE_BINARY_DIR}) +file(COPY ./include/hip_test_context.hh DESTINATION ${CATCH_INCLUDE_BINARY_DIR}) # Enable device lambda on nvidia platforms if(HIP_PLATFORM STREQUAL "nvidia") - # SPIRV is not supported on it - if(ENABLE_SPIRV) - message(FATAL_ERROR "SPIRV is not supported on this platform") - endif() + # SPIRV is not supported on it + if(ENABLE_SPIRV) + message(FATAL_ERROR "SPIRV is not supported on this platform") + endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --extended-lambda") - add_compile_options(-Xcompiler=-Wno-deprecated-declarations) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --extended-lambda") + add_compile_options(-Xcompiler=-Wno-deprecated-declarations) endif() add_custom_target(build_tests ALL) +add_dependencies(build_tests hip_tests_config) # Tests folder if(BUILD_UNIT_TESTS) - add_subdirectory(unit ${CATCH_BUILD_DIR}/unit) - add_subdirectory(ABM ${CATCH_BUILD_DIR}/ABM) - add_subdirectory(kernels ${CATCH_BUILD_DIR}/kernels) - add_subdirectory(hipTestMain ${CATCH_BUILD_DIR}/hipTestMain) - add_subdirectory(TypeQualifiers ${CATCH_BUILD_DIR}/TypeQualifiers) - if(UNIX) - add_subdirectory(multiproc ${CATCH_BUILD_DIR}/multiproc) - endif() + add_subdirectory(unit ${CATCH_BUILD_DIR}/unit) + add_subdirectory(ABM ${CATCH_BUILD_DIR}/ABM) + add_subdirectory(kernels ${CATCH_BUILD_DIR}/kernels) + add_subdirectory(hipTestMain ${CATCH_BUILD_DIR}/hipTestMain) + add_subdirectory(TypeQualifiers ${CATCH_BUILD_DIR}/TypeQualifiers) + if(UNIX) + add_subdirectory(multiproc ${CATCH_BUILD_DIR}/multiproc) + endif() endif() if(BUILD_PERF_TESTS) - add_subdirectory(perftests ${CATCH_BUILD_DIR}/perftests) - add_subdirectory(performance ${CATCH_BUILD_DIR}/performance) + add_subdirectory(perftests ${CATCH_BUILD_DIR}/perftests) + add_subdirectory(performance ${CATCH_BUILD_DIR}/performance) endif() if(BUILD_STRESS_TESTS) - add_subdirectory(stress ${CATCH_BUILD_DIR}/stress) + add_subdirectory(stress ${CATCH_BUILD_DIR}/stress) endif() add_custom_target(gen_coverage - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/utils/coverage - COMMAND ${CMAKE_COMMAND} -B ${CMAKE_CURRENT_BINARY_DIR}/utils/coverage -S ${CMAKE_CURRENT_SOURCE_DIR}/../utils/coverage - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/utils/coverage --target clean-cov-report - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/utils/coverage - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/utils/coverage/generateHipAPICoverage ${HIP_PATH}/include ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/utils/coverage/ - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating Test Coverage Report" - USES_TERMINAL - VERBATIM -) -set_property(TARGET gen_coverage PROPERTY EXCLUDE_FROM_ALL TRUE) + COMMAND ${CMAKE_COMMAND} -B build/ + COMMAND ${CMAKE_COMMAND} --build build/ + COMMAND ./build/generateHipAPICoverage ${HIP_PATH}/include + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../utils/coverage + COMMENT "Generating Test Coverage Report") # packaging the tests add_subdirectory(packaging) @@ -407,14 +438,14 @@ add_subdirectory(packaging) # check if doxygen is installed find_package(Doxygen) if(DOXYGEN_FOUND) - # Configure Doxyfile with proper paths - set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/DoxyfileTests) - set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/DoxyfileTests.out) - configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) + # Configure Doxyfile with proper paths + set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/DoxyfileTests) + set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/DoxyfileTests.out) + configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) - add_custom_target(build_docs + add_custom_target(build_docs COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} COMMENT "Generating test plan documentation with Doxygen") else() - message(STATUS "Doxygen was not found. Building test plan documentation will not be available") + message(STATUS "Doxygen was not found. Building test plan documentation will not be available") endif() diff --git a/catch/README.md b/catch/README.md index 5f3f4dacd..0a70aa239 100644 --- a/catch/README.md +++ b/catch/README.md @@ -18,9 +18,6 @@ Tests in Catch2 are declared via ```TEST_CASE```. Running Subtest: ctest –R “...†(Regex to match the subtest name) ## New Features -- Skip test without recompiling tests, by addition of a json file. Default name is ```config.json``` , this can be overridden by using the variable ```HIP_CATCH_EXCLUDE_FILE=some_config.json```. -- Json file supports regex. Ex: All tests which has the word ‘Memset’ can be skipped using ‘*Memset*’ -- Support multiple skip test list which can be set via environment variable, so you can have multiple files containing different skip test lists and can pick and choose among them depending on your platform and os. - Better CI integration via xunit compatible output - hip-tests can be built in SPIRV, where all kernels are compiled in SPIRV, enable with cmake flag `-DENABLE_SPIRV=ON`. By default its `OFF`. @@ -51,31 +48,42 @@ TEST_CASE("hipExtAPIs") { #endif ``` -## Config file schema -Some tests can be skipped using a config file placed in hipTestMain/config folder. Multiple config files can be defined for different configurations. -The naming convention for the file needs to be "config_platform_os_archname.json" -Platform and os are mandatory. -Arch name is optional and takes precedence while loading the json file. -Currently the json files need to be manually chosen by the executor for the architecture of choice. - -example: -config_amd_windows.json -config_nvidia_windows.json - -The schema of the json file is as follows: -```json -{ - "DisabledTests": - [ - "TestName1", - "TestName2", - ... - ] -} +## Configuration + +All configuration for the test cases is done through the `hip_tests_config.yaml` file. +Every test case has its own entry. Currently supported options are: +- level : Specify to which level the case belongs to (e.g. Level_2 is a standard test) +- tags : List all Catch2 tags that the case is associated with +- disabled : List all platforms where the case should be disabled +The group name is automatically added as a tag for every case. +Changing the configuration file will retrigger the build, so we have an up to date configuration every time. + +Example: +```yaml +unit: + atomics: + Unit_atomicExch_system_Positive_Peer_GPUs: + <<: *level_2 + tags: [multigpu] + # SWDEV-435667: Below tests failing randomly in stress test on 01/12/23 + disabled: [amd_wsl] +``` +will be generated as (on an AMD linux machine) as: +```cpp +#define Unit_atomicExch_system_Positive_Peer_GPUs "Unit_atomicExch_system_Positive_Peer_GPUs", "[multigpu][level_2][atomics]" ``` +and on an AMD WSL machine as (skipping the test): +```cpp +#define Unit_atomicExch_system_Positive_Peer_GPUs "Unit_atomicExch_system_Positive_Peer_GPUs", "[.]" +``` +and this macro is expanded in the actual test case definition +```cpp +TEMPLATE_TEST_CASE(Unit_atomicExch_system_Positive_Peer_GPUs, int, float, double) +``` + +Every newly added test should mandate adding an entry to the configuration file. ## Environment Variables -- `HIP_CATCH_EXCLUDE_FILE` : This variable can be set to the config file name or full path. Disabled tests will be read from this. - `HT_LOG_ENABLE` : This is for debugging the HIP Test Framework itself. Setting it to 1, all `LogPrintf` will be printed on screen ## Test Macros @@ -174,8 +182,13 @@ The process must be a standalone exe inside the same folder as other tests. Initially, the new tests can be enabled via using ```-DHIP_CATCH_TEST=1```. After porting existing tests, this will be turned on by default. ## Building a single test +Generate `hip_tests_config.hh` before compilation +```bash +python3 /catch/config/parse_config.py /catch/config/configs /hip_tests_config.hh +``` + ```bash -hipcc -I/tests/catch/include /tests/catch/hipTestMain/standalone_main.cc -I/tests/catch/external/Catch2 -g -o +hipcc -I /catch/include -I /catch/external/picojson -I /catch/hipTestMain/main.cc /catch/hipTestMain/hip_test_context.cc -I -L -lCatch2 -I $HIP_PATH/include -O1 -ggdb -o ``` ## Debugging support @@ -188,6 +201,7 @@ Catch2 allows multiple ways in which you can debug the test case. ## External Libs being used - [Catch2](https://github.com/catchorg/Catch2) - Testing framework - [picojson](https://github.com/kazuho/picojson) - For config file parsing +- [PyYAML](https://pyyaml.org/) - For config file parsing (Python script) # Testing Guidelines Tests fall in 5 categories and its file name prefix are as follows: diff --git a/catch/TypeQualifiers/CMakeLists.txt b/catch/TypeQualifiers/CMakeLists.txt index 0219c0021..f8eb8017f 100644 --- a/catch/TypeQualifiers/CMakeLists.txt +++ b/catch/TypeQualifiers/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests set(TEST_SRC hipManagedKeyword.cc diff --git a/catch/TypeQualifiers/hipManagedKeyword.cc b/catch/TypeQualifiers/hipManagedKeyword.cc index e698b2e8a..db6de8c90 100644 --- a/catch/TypeQualifiers/hipManagedKeyword.cc +++ b/catch/TypeQualifiers/hipManagedKeyword.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* @@ -39,6 +26,17 @@ static __global__ void managed_add(size_t size) { static __global__ void managed_inc() { atomicAdd(&m_X, 1.0f); } TEST_CASE("Unit_hipManagedKeyword_SingleGpu") { + int numDevices = 0; + HIP_CHECK(hipGetDeviceCount(&numDevices)); + for (int i = 0; i < numDevices; i++) { + int managed_memory = 0; + HIP_CHECK(hipDeviceGetAttribute(&managed_memory, hipDeviceAttributeManagedMemory, i)); + if (!managed_memory) { + HipTest::HIP_SKIP_TEST("managed memory access not supported on device"); + return; + } + } + for (size_t i = 0; i < N; i++) { m_A[i] = 1.0f; m_B[i] = 2.0f; @@ -58,13 +56,13 @@ TEST_CASE("Unit_hipManagedKeyword_SingleGpu") { } } -TEST_CASE("Unit_hipManagedKeyword_MultiGpu") { +TEST_CASE(Unit_hipManagedKeyword_MultiGpu) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); for (int i = 0; i < numDevices; i++) { int managed_memory = 0; - HIPCHECK(hipDeviceGetAttribute(&managed_memory, hipDeviceAttributeManagedMemory, i)); + HIP_CHECK(hipDeviceGetAttribute(&managed_memory, hipDeviceAttributeManagedMemory, i)); if (!managed_memory) { HipTest::HIP_SKIP_TEST("managed memory access not supported on device"); return; diff --git a/catch/cmake/hip-tests.cmake b/catch/cmake/hip-tests.cmake index bee293da5..5505bf55e 100644 --- a/catch/cmake/hip-tests.cmake +++ b/catch/cmake/hip-tests.cmake @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + include(Catch) ############################################################################### @@ -66,8 +70,8 @@ function(hip_gen_exe_target) endif() # Create shared lib of all tests - set_source_files_properties(${SRC_NAME} PROPERTIES LANGUAGE HIP) - set_source_files_properties(${COMMON_SHARED_SRC} PROPERTIES LANGUAGE HIP) + set_source_files_properties(${SRC_NAME} PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) + set_source_files_properties(${COMMON_SHARED_SRC} PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) if(NOT RTC_TESTING) add_executable(${_EXE_NAME} EXCLUDE_FROM_ALL ${SRC_NAME} ${COMMON_SHARED_SRC} $ $) else () @@ -78,7 +82,7 @@ function(hip_gen_exe_target) target_link_libraries(${_EXE_NAME} nvrtc) endif() endif() - set_target_properties(${_EXE_NAME} PROPERTIES LINKER_LANGUAGE HIP) + set_target_properties(${_EXE_NAME} PROPERTIES LINKER_LANGUAGE ${GPGPU_LANGUAGE}) if (DEFINED _PROPERTY) set_property(TARGET ${_EXE_NAME} PROPERTY ${_PROPERTY}) @@ -108,20 +112,21 @@ function(hip_gen_exe_target) if (DEFINED _COMPILE_OPTIONS) target_compile_options(${_EXE_NAME} PUBLIC ${_COMPILE_OPTIONS}) endif() - target_link_libraries(${_EXE_NAME} Catch2::Catch2) - target_link_libraries(${_EXE_NAME} hip::host hip::device) + target_link_libraries(${_EXE_NAME} Catch2::Catch2 ${GPGPU_LINKER_LIBRARIES}) foreach(arg IN LISTS _UNPARSED_ARGUMENTS) - message(WARNING "Unparsed arguments: ${arg}") + message(WARNING "Unparsed arguments: ${arg}") endforeach() # add binary to global list of binaries to install set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS ${_EXE_NAME}) - catch_discover_tests("${_EXE_NAME}" DISCOVERY_MODE PRE_TEST PROPERTIES SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST") + catch_discover_tests("${_EXE_NAME}" DISCOVERY_MODE PRE_TEST PROPERTIES ADD_TAGS_AS_LABELS SKIP_REGULAR_EXPRESSION "HIP_SKIP_THIS_TEST") file(GLOB CTEST_INC_FILES "${CMAKE_CURRENT_BINARY_DIR}/${_EXE_NAME}-*_include.cmake") set_property(GLOBAL APPEND PROPERTY G_INSTALL_CTEST_INCLUDE_FILES ${CTEST_INC_FILES}) + add_dependencies(${_EXE_NAME} hip_tests_config) + if(NOT _STANDALONE_FLAG EQUAL "1") break() endif() endforeach() -endfunction() \ No newline at end of file +endfunction() diff --git a/catch/cmake/relative_paths.py b/catch/cmake/relative_paths.py index b8330fda4..dbd14c2cb 100644 --- a/catch/cmake/relative_paths.py +++ b/catch/cmake/relative_paths.py @@ -5,11 +5,13 @@ if len(sys.argv) > 1: build_folder = sys.argv[1] - install_folder = sys.argv[2] - #print(f"In relative_paths.py [1]: build folder: {build_folder}") - #print(f"In relative_paths.py [2]: install folder: {install_folder}") + install_folder = sys.argv[2] + # print(f"In relative_paths.py [1]: build folder: {build_folder}") + # print(f"In relative_paths.py [2]: install folder: {install_folder}") else: - print(f"Args not provided. Please provide arg1-build folder-catch_tests, arg2-install folder") + print( + f"Args not provided. Please provide arg1-build folder-catch_tests, arg2-install folder" + ) exit(1) install_folder = os.path.abspath(install_folder) @@ -24,7 +26,7 @@ get_filename_component(CTEST_CURRENT_DIR ${FULL_FILE_PATH} DIRECTORY) get_filename_component(EXE_PATH ${CTEST_CURRENT_DIR}/.. REALPATH) """ -if os.name == 'posix': +if os.name == "posix": library_path_str = """ set(LIB_PATH ${EXE_PATH}/../../../lib) file(GLOB HIP_LIBS "${LIB_PATH}/libamdhip64*") @@ -34,11 +36,12 @@ set(LIB_PATH "/opt/rocm/lib") endif() """ - ctest_current_str = ctest_current_str + library_path_str + ctest_current_str += library_path_str inc_cmake_pattern = "_include.cmake" ctesttest_pattern = "CTestTestfile.cmake" + def make_test_files_portable(filenames): """ changes the absolute paths with relative paths @@ -48,53 +51,67 @@ def make_test_files_portable(filenames): try: filename = os.path.abspath(filename) # Read the entire content of the file - with open(filename, 'r') as file: + with open(filename, "r", encoding="utf-8") as file: file_content = file.read() - #print(f"**Done reading now parsing", filename) + # print(f"**Done reading now parsing", filename) # 1 replace abs path with filename. Make relative - old_text=os.path.dirname(os.path.abspath(filename)) - abs_dir_path = os.path.join(old_text, '') + old_text = os.path.dirname(os.path.abspath(filename)) + abs_dir_path = os.path.join(old_text, "") old_text = abs_dir_path.replace("\\", "/") if modified_msg not in file_content: file_content = modified_msg + file_content # Perform the replacement - modified_content = file_content.replace(old_text, '') + modified_content = file_content.replace(old_text, "") if inc_cmake_pattern in filename: - # 2 get folder path relative to the current *_include.cmake + # 2 get folder path relative to the current *_include.cmake if r"get_filename_component(FULL_FILE_PATH" not in modified_content: - modified_content = ctest_current_str + modified_content + modified_content = ctest_current_str + modified_content # 3 CTEST_FILE to have parameterized relative file test_cmake_pattern = r"\[==\[(\w+-[a-f0-9]+_tests.cmake)\]==\]" replace_test_pattern = r"${CTEST_CURRENT_DIR}/\1" - modified_content = re.sub(test_cmake_pattern, replace_test_pattern, modified_content) + modified_content = re.sub( + test_cmake_pattern, replace_test_pattern, modified_content + ) # 4 script to use CatchAddTests.cmake from build rather than src add_test_pattern = r'include\(".*CatchAddTests\.cmake"\)' - replace_add_test_pattern = 'include("${CTEST_CURRENT_DIR}/CatchAddTests.cmake")' - modified_content = re.sub(add_test_pattern, replace_add_test_pattern, modified_content) + replace_add_test_pattern = ( + 'include("${CTEST_CURRENT_DIR}/CatchAddTests.cmake")' + ) + modified_content = re.sub( + add_test_pattern, replace_add_test_pattern, modified_content + ) # 5 use exe from previous folder exe_pattern = r"TEST_EXECUTABLE\s+\[==\[(.*?)\]==\]" - replace_exe_pattern = r'TEST_EXECUTABLE ${EXE_PATH}/\1' - modified_content = re.sub(exe_pattern, replace_exe_pattern, modified_content) + replace_exe_pattern = r"TEST_EXECUTABLE ${EXE_PATH}/\1" + modified_content = re.sub( + exe_pattern, replace_exe_pattern, modified_content + ) # 6 include _ctest.cmake file with path ctest_test_pattern = r'include\("(.*?_tests\.cmake)"\)' replace_ctest_pattern = r'include("${CTEST_CURRENT_DIR}/\1")' - modified_content = re.sub(ctest_test_pattern, replace_ctest_pattern, modified_content) + modified_content = re.sub( + ctest_test_pattern, replace_ctest_pattern, modified_content + ) # 7 use script folder as cwd cwd_pattern = r"TEST_WORKING_DIR\s+\[==\[(.*?)\]==\]" - replace_cwd_pattern = r'TEST_WORKING_DIR ${EXE_PATH}' - modified_content = re.sub(cwd_pattern, replace_cwd_pattern, modified_content) + replace_cwd_pattern = r"TEST_WORKING_DIR ${EXE_PATH}" + modified_content = re.sub( + cwd_pattern, replace_cwd_pattern, modified_content + ) # 8 modify ld_library_path - if os.name == 'posix': + if os.name == "posix": lib_path_pattern = r"TEST_DL_PATHS\s+\[==\[(.*?)\]==\]" - replace_lib_path_pattern = r'TEST_DL_PATHS ${LIB_PATH}' - modified_content = re.sub(lib_path_pattern, replace_lib_path_pattern, modified_content) + replace_lib_path_pattern = r"TEST_DL_PATHS ${LIB_PATH}" + modified_content = re.sub( + lib_path_pattern, replace_lib_path_pattern, modified_content + ) filename = os.path.basename(filename) install_path = os.path.join(install_script, filename) # Write the modified content back to the file - with open(install_path, 'w') as file: + with open(install_path, "w", encoding="utf-8") as file: file.write(modified_content) - #print(f"**Done parsing now writing into", install_path) + # print(f"**Done parsing now writing into", install_path) except IOError as e: print(f"Error: '{e}'") sys.exit({e}) @@ -102,5 +119,6 @@ def make_test_files_portable(filenames): print(f"An error occurred: {e}") sys.exit({e}) -inccmake_files = glob.glob(build_folder + "/**/*"+inc_cmake_pattern, recursive=True) + +inccmake_files = glob.glob(build_folder + "/**/*" + inc_cmake_pattern, recursive=True) make_test_files_portable(inccmake_files) diff --git a/catch/config/__pycache__/common.cpython-310.pyc b/catch/config/__pycache__/common.cpython-310.pyc deleted file mode 100644 index 234d4e5cedef0bd62f7b8e181a8b552cd2d3401d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmZux&5j&35Vqa!o}QoGY+xZ-l!zAMuoGo>gv2RAh(8JCzyvm%po~DHp0;PlOLx0t zdlF{VBY~DX4}g$%IKg{xw8Zvwr^;>^|B^vf4 z8+`cDXSQ9;b0aDxGuy4Wno3oqWyWpW35IK=oXn00VL7+zsO;?P;t zn2{@>xq_C|1Q)cXEB6J#@CiP!xYG|Ul@%{7RXk-j${|isS-MDz+_rT(<>OqY434#@ zBIn~OH8Z=z_*9g_2wCc};olldozk{4SsGp%8)veZh?2A4klKY0d2)X+lLa4~rY4)E zb2b33PI+eZ;CRN5WcJMfxGN6yLK|M_7uuPq4m^K@%vlb=|5Tj7QWUa0tQNNGf*Uv6 zmmO_AfDZ29Yya*BJy_N2u#sVaXQK@-j^zxd{u|(X;Q18Ts-Y5AWQo@j@CFhwK}~!P z0$`T{qZD!w{3i!*ZRX&)H3jR?geJO()_WlfSCE%;{0aK{&1Ga-byU-HvTS*M?6F-( zE65;=_Run}zVPaU(B7LUoi34zah3QI1M|ru z8QvL=?+tGsk3T)SbMN!JhyJiHHYf&twpopbu5O2xx`5B38(vf{`)8ql?{_Vc+EQP} z^i+ycxqpS~0zi-Yh%G(I<-`|`jdhg^U*Yj2)x1m#ZZEwQPrq%u&8Iir(OdKIKfU6v zRjy9ej=S)Z3v*q)VMZS+3c+J_q0%57KSFJthH(+1C4M4uzj<%ur zT^no%*I>PhV@&W4j>#@aJDC2X_TgYZQrBTodk(f7Bo189c>Ttuu8ozyIexE@Y@YM? R9k0IOVibetIEXvF_ES~-fCvBp diff --git a/catch/hipTestMain/CMakeLists.txt b/catch/hipTestMain/CMakeLists.txt index 5fdda22ed..35485f409 100644 --- a/catch/hipTestMain/CMakeLists.txt +++ b/catch/hipTestMain/CMakeLists.txt @@ -1,34 +1,25 @@ -# Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT if(CMAKE_BUILD_TYPE MATCHES "^Debug$") - add_definitions(-DHT_LOG_ENABLE) + add_definitions(-DHT_LOG_ENABLE) endif() set(MAIN_SRC main.cc hip_test_context.cc - hip_test_features.cc) + hip_test_features.cc + hip_test_params.cc + hip_test_listener.cc) add_library(Main_Object EXCLUDE_FROM_ALL OBJECT ${MAIN_SRC}) -set_source_files_properties(${MAIN_SRC} PROPERTIES LANGUAGE HIP) +set_source_files_properties(${MAIN_SRC} PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) if(ENABLE_SPIRV) - target_compile_definitions(Main_Object PRIVATE ENABLE_SPIRV) + target_compile_definitions(Main_Object PRIVATE ENABLE_SPIRV) endif() -target_link_libraries(Main_Object PRIVATE Catch2::Catch2) +target_link_libraries(Main_Object PRIVATE Catch2::Catch2 hip::host hip::device) + +# Include path for generated headers (hip_test_parameters.hh) +target_include_directories(Main_Object PRIVATE ${CATCH_INCLUDE_BINARY_DIR}) + +add_dependencies(Main_Object hip_tests_config) diff --git a/catch/hipTestMain/config/config_amd_linux b/catch/hipTestMain/config/config_amd_linux index 9bab389f6..0f07a0be7 100644 --- a/catch/hipTestMain/config/config_amd_linux +++ b/catch/hipTestMain/config/config_amd_linux @@ -17,27 +17,6 @@ "NOTE: The following 2 tests are disabled due to defect - EXSWHTEC-238", "Unit_hipMemRangeGetAttribute_Positive_AccessedBy_Basic", "Unit_hipMemRangeGetAttribute_Positive_AccessedBy_Partial_Range", - "=== 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_Positive_Basic - __half", - "Unit_Warp_Shfl_Positive_Basic - __half2", - "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", - "Unit_Warp_Shfl_XOR_Positive_Basic - __half", - "Unit_Warp_Shfl_XOR_Positive_Basic - __half2", "=== SWDEV-439004: Below tests failing randomly in CQE staging ===", "Unit_hipGraphicsMapResources_Negative_Parameters", "Unit_hipGraphicsSubResourceGetMappedArray_Negative_Parameters", @@ -76,7 +55,6 @@ "Unit_dynamic_loading_device_kernels_from_library", "Unit_hipDrvLaunchKernelEx_With_CooperativeKernelWithArgs", "Unit_hipModuleGetFunctionCount_Functional", - "Unit_BuiltInAtomicAdd_NonCoherentGlobalMemWithRtc", "Unit_atomicAdd_system_Positive_Peer_GPUs - unsigned long long", "Unit_hipMultiThreadDevice_SerialPyramid", "Unit_Device___clzll_Sanity_Positive - unsigned long long int", @@ -86,7 +64,7 @@ "=== special values test, fix: comment out [HEX_DBL(-, 1, fffffffffffff, +, 31), HEX_DBL(+, 1, fffffffffffff, +, 31)]", "Unit_Device_sinpi_Accuracy_Positive - double", "Unit_Device_cospi_Accuracy_Positive - double", - "Unit_Device_sincospi_Accuracy_Positive - double", + "Unit_Device_sincospi_Accuracy_Positive_double", "=== special values test, fix: comment out [-3.0f, -1.5f, HEX_FLT(-, 0, 00000c, -, 126), HEX_FLT(-, 0, 000006, -, 126), +3.0f, 1.5f, HEX_FLT(+, 0, 00000c, -, 126), HEX_FLT(+, 0, 000006, -, 126),]", "Unit_Device_fma_Accuracy_Positive - float", "=== special values test, fix: comment out [HEX_DBL(-, 1, fffffffffffff, +, 31), HEX_DBL(-, 1, fffffffffffff, +, 30), HEX_DBL(+, 1, fffffffffffff, +, 31), HEX_DBL(+, 1, fffffffffffff, +, 30)]", @@ -189,28 +167,14 @@ "Unit_hipMallocAsync_MThread_ThreadLocalStream", "Unit_hipMallocAsync_StreamEvent_CrissCross", "Unit_hipMemGetHandleForAddressRange_MulProc_Socket_DeviceMem", - #endif - #if defined gfx90a || defined gfx942 || defined gfx950 || defined amdgcnspirv - "Unit_Warp_Shfl_Up_Positive_Basic - int", - "Unit_Warp_Shfl_Up_Positive_Basic - unsigned int", - "Unit_Warp_Shfl_Up_Positive_Basic - long", - "Unit_Warp_Shfl_Up_Positive_Basic - unsigned long", - "Unit_Warp_Shfl_Up_Positive_Basic - long long", - "Unit_Warp_Shfl_Up_Positive_Basic - unsigned long long", - "Unit_Warp_Shfl_Up_Positive_Basic - float", - "Unit_Warp_Shfl_Up_Positive_Basic - double", - "Unit_Warp_Shfl_Up_Positive_Basic - __half", - "Unit_Warp_Shfl_Up_Positive_Basic - __half2", - "Unit_Warp_Shfl_Down_Positive_Basic - int", - "Unit_Warp_Shfl_Down_Positive_Basic - unsigned int", - "Unit_Warp_Shfl_Down_Positive_Basic - long", - "Unit_Warp_Shfl_Down_Positive_Basic - unsigned long", - "Unit_Warp_Shfl_Down_Positive_Basic - long long", - "Unit_Warp_Shfl_Down_Positive_Basic - unsigned long long", - "Unit_Warp_Shfl_Down_Positive_Basic - float", - "Unit_Warp_Shfl_Down_Positive_Basic - double", - "Unit_Warp_Shfl_Down_Positive_Basic - __half", - "Unit_Warp_Shfl_Down_Positive_Basic - __half2", + "Unit_hipHostRegister_Negative", + "Unit_hipStreamAttachMemAsync_Negative", + "Unit_hipGetProcAddress_IPC_Event", + "Unit_hipGetProcAddress_IPC_Event", + "Unit_hipP2pLinkTypeAndHopFunc", + "ChildMalloc", + "Unit_hipMemGetInfo_Functional_scenario4", + "Unit_hipMemGetInfo_SetHiddenFreeMemFromChild", #endif #if defined gfx1200 || defined gfx1201 || defined amdgcnspirv "=== SWDEV-470751 : Fine Grain memory is MTYPE_NC due to HW bug.", diff --git a/catch/hipTestMain/config/config_amd_windows b/catch/hipTestMain/config/config_amd_windows index ff904294e..e49c440e5 100644 --- a/catch/hipTestMain/config/config_amd_windows +++ b/catch/hipTestMain/config/config_amd_windows @@ -25,21 +25,10 @@ "Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Functional", "Unit_hipMallocManaged_CoherentTstWthAdvise", "Unit_hipMallocManaged_Advanced", - "Unit_hipMemRangeGetAttribute_NegativeTests", "Unit_hipMemRangeGetAttribute_AccessedBy1", - "Unit_hipMemRangeGetAttribte_3", "Unit_hipMemRangeGetAttribute_4", - "Unit_hipMemRangeGetAttribute_PrefetchAndGtAttr", - "Unit_hipMemAdvise_TstFlags", - "Unit_hipMemAdvise_PrefrdLoc", - "Unit_hipMemAdvise_ReadMostly", - "Unit_hipMemAdvise_TstFlgOverrideEffect", - "Unit_hipMemAdvise_TstAccessedByFlg", "Unit_hipMemAdvise_TstAccessedByFlg4", - "Unit_hipMemAdvise_TstMemAdvisePrefrdLoc", - "Unit_hipMemAdvise_TstMemAdviseMultiFlag", "Unit_hipMemAdvise_ReadMosltyMgpuTst", - "Unit_hipMemAdvise_TstSetUnsetPrfrdLoc", "Unit_hipMallocManaged_DeviceContextChange - unsigned char", "Unit_hipMallocManaged_DeviceContextChange - int", "Unit_hipMallocManaged_DeviceContextChange - float", @@ -60,7 +49,6 @@ "Unit_hipStreamPerThread_DeviceReset_1", "Unit_hipStreamCreateWithPriority_ValidateWithEvents", "Unit_hipStreamPerThread_StrmWaitEvt", - "Unit_hipGraphMemcpyNodeSetParamsToSymbol_Functional", "Unit_hipStreamWaitEvent_DifferentStreams", "Unit_hipStreamQuery_WithFinishedWork", "SWDEV-347670 - blocking tests have TDR, causing hangs", @@ -85,9 +73,6 @@ "Unit_hipDeviceGetSharedMemConfig_Positive_Basic", "Unit_hipDeviceGetSharedMemConfig_Positive_Threaded", "Unit_hipInit_Negative", - "Unit_hipGraphMemcpyNodeSetParams_Functional", - "Unit_hipGraphNodeGetDependentNodes_Functional", - "Unit_hipGraphNodeGetDependencies_Functional", "Unit_hipGraphExecChildGraphNodeSetParams_ChildTopology", "Unit_hipGraphAddEventRecordNode_MultipleRun", "Unit_hipGraphAddEventRecordNode_Functional_ElapsedTime", @@ -177,7 +162,6 @@ "Unit_hipStreamCreateWithPriority_MulthreadNonblockingflag", "SWDEV-396617 ExecMemcpyNodeSetParamsFromSymbol fails in direction", "SWDEV-396616 hipMemMap returns invalid error", - "Unit_hipMemVmm_Basic", "SWDEV-396615 mGPUs not considered correctly", "Unit_hipManagedKeyword_MultiGpu", "Disabling test tracked SWDEV-391555", @@ -341,18 +325,18 @@ "Unit_hipModuleGetTexRef_Positive_Basic", "Unit_Kernel_Launch_bounds_Negative_OutOfBounds", "Unit_Kernel_Launch_bounds_Negative_Parameters_RTC", - "Unit_hipMemcpy2D_H2D-D2D-D2H - int", - "Unit_hipMemcpy2D_H2D-D2D-D2H - float", - "Unit_hipMemcpy2D_H2D-D2D-D2H - double", - "Unit_hipMemcpy2D_H2D-D2D-D2H_WithOffset - int", - "Unit_hipMemcpy2D_H2D-D2D-D2H_WithOffset - float", - "Unit_hipMemcpy2D_H2D-D2D-D2H_WithOffset - double", - "Unit_hipMemcpy2D_H2D-D2D-D2H_Managed_WithOffset - int", - "Unit_hipMemcpy2D_H2D-D2D-D2H_Managed_WithOffset - float", - "Unit_hipMemcpy2D_H2D-D2D-D2H_Managed_WithOffset - double", - "Unit_hipMemcpy2DAsync_Host&PinnedMem - int", - "Unit_hipMemcpy2DAsync_Host&PinnedMem - float", - "Unit_hipMemcpy2DAsync_Host&PinnedMem - double", + "Unit_hipMemcpy2D_H2D_D2D_D2H - int", + "Unit_hipMemcpy2D_H2D_D2D_D2H - float", + "Unit_hipMemcpy2D_H2D_D2D_D2H - double", + "Unit_hipMemcpy2D_H2D_D2D_D2H_WithOffset - int", + "Unit_hipMemcpy2D_H2D_D2D_D2H_WithOffset - float", + "Unit_hipMemcpy2D_H2D_D2D_D2H_WithOffset - double", + "Unit_hipMemcpy2D_H2D_D2D_D2H_Managed_WithOffset - int", + "Unit_hipMemcpy2D_H2D_D2D_D2H_Managed_WithOffset - float", + "Unit_hipMemcpy2D_H2D_D2D_D2H_Managed_WithOffset - double", + "Unit_hipMemcpy2DAsync_Host_N_PinnedMem - int", + "Unit_hipMemcpy2DAsync_Host_N_PinnedMem - float", + "Unit_hipMemcpy2DAsync_Host_N_PinnedMem - double", "Unit_hipMemPoolGetAccess_Negative_Parameters", "Unit_hipMemPoolSetAttribute_Negative_Parameters", "Unit_hipMemPoolGetAttribute_Negative_Parameters", @@ -699,7 +683,6 @@ "====================================================", "Unit_hipEventRecord", "========Rock_Window_Failures_on_gfx1151===========================================", - "Unit_hipMemVmm_Uncached", "Unit_Uuid_FntlTstsFor_SetEnv_HIP_VISIBLE_DEVICES", "Unit_UUID_setEnv_Thread", "Unit_hipTexRefSetArray_Positive", diff --git a/catch/hipTestMain/config/config_amd_wsl.json b/catch/hipTestMain/config/config_amd_wsl.json index b91bad5e9..69871ce77 100644 --- a/catch/hipTestMain/config/config_amd_wsl.json +++ b/catch/hipTestMain/config/config_amd_wsl.json @@ -16,21 +16,10 @@ "Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Functional", "Unit_hipMallocManaged_CoherentTstWthAdvise", "Unit_hipMallocManaged_Advanced", - "Unit_hipMemRangeGetAttribute_NegativeTests", "Unit_hipMemRangeGetAttribute_AccessedBy1", - "Unit_hipMemRangeGetAttribte_3", "Unit_hipMemRangeGetAttribute_4", - "Unit_hipMemRangeGetAttribute_PrefetchAndGtAttr", - "Unit_hipMemAdvise_TstFlags", - "Unit_hipMemAdvise_PrefrdLoc", - "Unit_hipMemAdvise_ReadMostly", - "Unit_hipMemAdvise_TstFlgOverrideEffect", - "Unit_hipMemAdvise_TstAccessedByFlg", "Unit_hipMemAdvise_TstAccessedByFlg4", - "Unit_hipMemAdvise_TstMemAdvisePrefrdLoc", - "Unit_hipMemAdvise_TstMemAdviseMultiFlag", "Unit_hipMemAdvise_ReadMosltyMgpuTst", - "Unit_hipMemAdvise_TstSetUnsetPrfrdLoc", "Unit_hipMallocManaged_DeviceContextChange - unsigned char", "Unit_hipMallocManaged_DeviceContextChange - int", "Unit_hipMallocManaged_DeviceContextChange - float", @@ -51,7 +40,6 @@ "Unit_hipStreamPerThread_DeviceReset_1", "Unit_hipStreamCreateWithPriority_ValidateWithEvents", "Unit_hipStreamPerThread_StrmWaitEvt", - "Unit_hipGraphMemcpyNodeSetParamsToSymbol_Functional", "Unit_hipStreamWaitEvent_DifferentStreams", "Unit_hipStreamQuery_WithFinishedWork", "Unit_hipStreamValue_Wait32_Blocking_Mask_Gte", @@ -77,9 +65,6 @@ "Unit_hipDeviceReset_Positive_Basic", "Unit_hipDeviceReset_Positive_Threaded", "Unit_hipInit_Negative", - "Unit_hipGraphMemcpyNodeSetParams_Functional", - "Unit_hipGraphNodeGetDependentNodes_Functional", - "Unit_hipGraphNodeGetDependencies_Functional", "Unit_hipGraphExecChildGraphNodeSetParams_ChildTopology", "Unit_hipGraphAddEventRecordNode_MultipleRun", "Unit_hipGraphAddEventRecordNode_Functional_ElapsedTime", @@ -384,7 +369,6 @@ "Unit_hipGraphAddMemcpyNode1D_Negative_Basic", "Unit_ChannelDescriptor_Positive_16BitFloatingPoint", "intermittent issue: failure expected but success returned", - "Unit_hipMemAdvise_NegtveTsts", "Note: Following four tests disabled due to defect - EXSWHTEC-203", "Unit_hipStreamSetCaptureDependencies_Positive_Functional", "Note: Test disabled due to defect - EXSWHTEC-207", diff --git a/catch/hipTestMain/config/config_nvidia_linux.json b/catch/hipTestMain/config/config_nvidia_linux.json index 0b4ccb502..3669b817f 100644 --- a/catch/hipTestMain/config/config_nvidia_linux.json +++ b/catch/hipTestMain/config/config_nvidia_linux.json @@ -14,7 +14,7 @@ "=== special values test, fix: comment out [HEX_DBL(-, 1, fffffffffffff, +, 31), HEX_DBL(+, 1, fffffffffffff, +, 31)]", "Unit_Device_sinpi_Accuracy_Positive - double", "Unit_Device_cospi_Accuracy_Positive - double", - "Unit_Device_sincospi_Accuracy_Positive - double", + "Unit_Device_sincospi_Accuracy_Positive_double", "=== special values test, fix: comment out [-3.0f, -1.5f, HEX_FLT(-, 0, 00000c, -, 126), HEX_FLT(-, 0, 000006, -, 126), +3.0f, 1.5f, HEX_FLT(+, 0, 00000c, -, 126), HEX_FLT(+, 0, 000006, -, 126),]", "Unit_Device_fma_Accuracy_Positive - float", "=== special values test, fix: comment out [HEX_DBL(-, 1, fffffffffffff, +, 31), HEX_DBL(-, 1, fffffffffffff, +, 30), HEX_DBL(+, 1, fffffffffffff, +, 31), HEX_DBL(+, 1, fffffffffffff, +, 30)]", diff --git a/catch/hipTestMain/hip_test_context.cc b/catch/hipTestMain/hip_test_context.cc index 632524f8f..494369057 100644 --- a/catch/hipTestMain/hip_test_context.cc +++ b/catch/hipTestMain/hip_test_context.cc @@ -1,22 +1,7 @@ /* - * Copyright (C) Advanced Micro Devices, Inc. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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 COPYRIGHT HOLDER(S) 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. + * SPDX-License-Identifier: MIT */ #include diff --git a/catch/hipTestMain/hip_test_features.cc b/catch/hipTestMain/hip_test_features.cc index bb6d23cee..e37f8a529 100644 --- a/catch/hipTestMain/hip_test_features.cc +++ b/catch/hipTestMain/hip_test_features.cc @@ -1,22 +1,7 @@ /* - * Copyright (C) Advanced Micro Devices, Inc. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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 COPYRIGHT HOLDER(S) 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. + * SPDX-License-Identifier: MIT */ #include "hip_test_features.hh" diff --git a/catch/hipTestMain/main.cc b/catch/hipTestMain/main.cc index d1042404d..10af20811 100755 --- a/catch/hipTestMain/main.cc +++ b/catch/hipTestMain/main.cc @@ -1,22 +1,7 @@ /* - * Copyright (C) Advanced Micro Devices, Inc. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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 COPYRIGHT HOLDER(S) 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. + * SPDX-License-Identifier: MIT */ #define CATCH_CONFIG_RUNNER @@ -56,7 +41,10 @@ int main(int argc, char** argv) { ("Number of iterations used for cooperative groups sync tests (default: 5)") | Opt(cmd_options.cg_reduction_factor, "cg_reduction_factor") ["-C"]["--cg-reduction-factor"] - ("Percentage of warp sizes for shuffle tests to be actually tested (default: 10)") // TODO + ("Percentage of warp sizes for shuffle tests to be actually tested (default: 10)") + | Opt(cmd_options.warp_reduction_factor, "warp_reduction_factor") + ["-F"]["--warp-reduction-factor"] + ("Percentage of lane mask iterations for warp shuffle tests to be tested (default: 6.25)") | Opt(cmd_options.accuracy_iterations, "accuracy_iterations") ["-A"]["--accuracy-iterations"] ("Number of iterations used for math accuracy tests with randomly generated inputs (default: 2^32)") diff --git a/catch/include/cmd_options.hh b/catch/include/cmd_options.hh index 0c17e1261..ab5d0579d 100644 --- a/catch/include/cmd_options.hh +++ b/catch/include/cmd_options.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once @@ -30,6 +14,7 @@ struct CmdOptions { int warmups = 5; int cg_iterations = 1; double cg_reduction_factor = 6.25; + double warp_reduction_factor = 6.25; bool no_display = false; bool progress = false; uint64_t accuracy_iterations = std::numeric_limits::max() + 1ull; diff --git a/catch/include/cpu_grid.h b/catch/include/cpu_grid.h index 1afcfdfb5..d60b50a7a 100644 --- a/catch/include/cpu_grid.h +++ b/catch/include/cpu_grid.h @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once @@ -143,6 +130,11 @@ inline dim3 GenerateThreadDimensionsForShuffle() { return GenerateThreadDimensionsImpl(multipliers); } +inline dim3 GenerateThreadDimensionsForShuffleWarp() { + const auto multipliers = {1.0}; + return GenerateThreadDimensionsImpl(multipliers); +} + /* Generate dimensions for 1D, 2D and 3D grids of blocks */ inline dim3 GenerateBlockDimensionsImpl(const std::initializer_list& multipliers) { hipDeviceProp_t props; @@ -168,4 +160,9 @@ inline dim3 GenerateBlockDimensions() { inline dim3 GenerateBlockDimensionsForShuffle() { const auto multipliers = {0.5, 1.0}; return GenerateBlockDimensionsImpl(multipliers); -} \ No newline at end of file +} + +inline dim3 GenerateBlockDimensionsForShuffleWarp() { + const auto multipliers = {1.0}; + return GenerateBlockDimensionsImpl(multipliers); +} diff --git a/catch/include/hipMallocManagedCommon.hh b/catch/include/hipMallocManagedCommon.hh index dedba7f04..33d1ea10e 100644 --- a/catch/include/hipMallocManagedCommon.hh +++ b/catch/include/hipMallocManagedCommon.hh @@ -1,22 +1,7 @@ /* - * Copyright (C) Advanced Micro Devices, Inc. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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 COPYRIGHT HOLDER(S) 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. + * SPDX-License-Identifier: MIT */ #include diff --git a/catch/include/hip_array_common.hh b/catch/include/hip_array_common.hh index 10dc7cb88..fc1d10343 100644 --- a/catch/include/hip_array_common.hh +++ b/catch/include/hip_array_common.hh @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/hip_test_checkers.hh b/catch/include/hip_test_checkers.hh index 1a6df666c..fe2c9deda 100644 --- a/catch/include/hip_test_checkers.hh +++ b/catch/include/hip_test_checkers.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #include "hip_test_common.hh" diff --git a/catch/include/hip_test_common.hh b/catch/include/hip_test_common.hh index 8452e86a8..c2e67464e 100644 --- a/catch/include/hip_test_common.hh +++ b/catch/include/hip_test_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #pragma clang diagnostic ignored "-Wsign-compare" @@ -36,6 +20,8 @@ THE SOFTWARE. #include #include "hip_test_features.hh" +#include "hip_tests_config.hh" + #if HT_LINUX #include #endif diff --git a/catch/include/hip_test_context.hh b/catch/include/hip_test_context.hh index 8e06c3fbb..9fffb2f31 100644 --- a/catch/include/hip_test_context.hh +++ b/catch/include/hip_test_context.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #include @@ -56,8 +40,8 @@ THE SOFTWARE. typedef struct Config_ { std::vector json_files; // Json files - std::string platform; // amd/nvidia - std::string os; // windows/linux + std::string platform; // amd/nvidia + std::string os; // windows/linux } Config; // Store Multi threaded results @@ -117,22 +101,22 @@ class TestContext { return instance; } - static std::string getEnvVar(std::string var) { - #if defined(_WIN32) - constexpr rsize_t MAX_LEN = 4096; - char dstBuf[MAX_LEN]; - size_t dstSize; - if (!::getenv_s(&dstSize, dstBuf, MAX_LEN, var.c_str())) { - return std::string(dstBuf); + static std::string getEnvVar(const std::string& var) { +#if defined(_WIN32) + char* val = nullptr; + size_t len = 0; + if (_dupenv_s(&val, &len, var.c_str()) == 0 && val != nullptr) { + std::string result(val); + free(val); + return result; } - #elif defined(__linux__) - char* val = std::getenv(var.c_str()); - if (val != NULL) { +#elif defined(__linux__) + if (const char* val = std::getenv(var.c_str())) { return std::string(val); } - #else - #error "OS not recognized" - #endif +#else +#error "OS not recognized" +#endif return std::string(""); } @@ -188,10 +172,10 @@ class TestContext { static bool _log_enable = (!TestContext::getEnvVar("HT_LOG_ENABLE").empty() ? true : false); // printing logs -#define LogPrintf(format, ...) \ -{ \ - if(_log_enable) { \ - printf(format, __VA_ARGS__); \ - printf("%c", '\n'); \ - } \ -} +#define LogPrintf(format, ...) \ + { \ + if (_log_enable) { \ + printf(format, __VA_ARGS__); \ + printf("%c", '\n'); \ + } \ + } diff --git a/catch/include/hip_test_defgroups.hh b/catch/include/hip_test_defgroups.hh index a55a12a20..6618b6606 100644 --- a/catch/include/hip_test_defgroups.hh +++ b/catch/include/hip_test_defgroups.hh @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/include/hip_test_features.hh b/catch/include/hip_test_features.hh index 0534e9b95..f1c652bc2 100644 --- a/catch/include/hip_test_features.hh +++ b/catch/include/hip_test_features.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/hip_test_filesystem.hh b/catch/include/hip_test_filesystem.hh index fffda4146..10ebe6bfe 100644 --- a/catch/include/hip_test_filesystem.hh +++ b/catch/include/hip_test_filesystem.hh @@ -1,25 +1,8 @@ - /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once // We haven't checked which filesystem to include yet diff --git a/catch/include/hip_test_helper.hh b/catch/include/hip_test_helper.hh index 6a8ff5cc1..bd6defd21 100644 --- a/catch/include/hip_test_helper.hh +++ b/catch/include/hip_test_helper.hh @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #include "hip_test_common.hh" diff --git a/catch/include/hip_test_kernels.hh b/catch/include/hip_test_kernels.hh index 4d2174a5d..837803af3 100644 --- a/catch/include/hip_test_kernels.hh +++ b/catch/include/hip_test_kernels.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/hip_test_process.hh b/catch/include/hip_test_process.hh index ee5facd70..5045689ee 100644 --- a/catch/include/hip_test_process.hh +++ b/catch/include/hip_test_process.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/hip_test_rtc.hh b/catch/include/hip_test_rtc.hh index 4b800b439..f78b33790 100644 --- a/catch/include/hip_test_rtc.hh +++ b/catch/include/hip_test_rtc.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #include diff --git a/catch/include/hip_test_smi.hh b/catch/include/hip_test_smi.hh index 8962d4f23..7767e9791 100644 --- a/catch/include/hip_test_smi.hh +++ b/catch/include/hip_test_smi.hh @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/hip_texture_helper.hh b/catch/include/hip_texture_helper.hh index cfdf93e57..0e519bc23 100644 --- a/catch/include/hip_texture_helper.hh +++ b/catch/include/hip_texture_helper.hh @@ -1,22 +1,7 @@ /* - * Copyright (C) Advanced Micro Devices, Inc. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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 COPYRIGHT HOLDER(S) 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. + * SPDX-License-Identifier: MIT */ #pragma once diff --git a/catch/include/kernel_mapping.hh b/catch/include/kernel_mapping.hh index 32ca93b5e..b5a3c0852 100644 --- a/catch/include/kernel_mapping.hh +++ b/catch/include/kernel_mapping.hh @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/kernels.hh b/catch/include/kernels.hh index ab2a92bfd..91b3fdd4f 100644 --- a/catch/include/kernels.hh +++ b/catch/include/kernels.hh @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/memcpy1d_tests_common.hh b/catch/include/memcpy1d_tests_common.hh index c0b4d9979..ab566f974 100644 --- a/catch/include/memcpy1d_tests_common.hh +++ b/catch/include/memcpy1d_tests_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/memcpy3d_tests_common.hh b/catch/include/memcpy3d_tests_common.hh index 70974c139..40f2e7fd6 100644 --- a/catch/include/memcpy3d_tests_common.hh +++ b/catch/include/memcpy3d_tests_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #pragma clang diagnostic ignored "-Wmissing-field-initializers" diff --git a/catch/include/performance_common.hh b/catch/include/performance_common.hh index af6ba7609..dc813ddac 100644 --- a/catch/include/performance_common.hh +++ b/catch/include/performance_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/resource_guards.hh b/catch/include/resource_guards.hh index c2f0864d1..6d925eb33 100644 --- a/catch/include/resource_guards.hh +++ b/catch/include/resource_guards.hh @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/threaded_zig_zag_test.hh b/catch/include/threaded_zig_zag_test.hh index 96fe25086..b11abb349 100644 --- a/catch/include/threaded_zig_zag_test.hh +++ b/catch/include/threaded_zig_zag_test.hh @@ -1,23 +1,9 @@ /* -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: + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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. -*/ #pragma once diff --git a/catch/include/utils.hh b/catch/include/utils.hh index 89ad91717..c1aeb10ca 100644 --- a/catch/include/utils.hh +++ b/catch/include/utils.hh @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/include/warp_common.hh b/catch/include/warp_common.hh index f13fb64b1..b01e3ba63 100644 --- a/catch/include/warp_common.hh +++ b/catch/include/warp_common.hh @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #pragma once @@ -31,6 +19,8 @@ THE SOFTWARE. #include #include +#include + #define MASK_SHIFT(x, n) \ (x & (static_cast(1) << n)) >> n @@ -560,3 +550,5 @@ void runTestReduce(int iteration, Reduce reduce) numReduce++; } } + +inline double GetTestReductionFactor() { return cmd_options.warp_reduction_factor * 0.01; } diff --git a/catch/kernels/CMakeLists.txt b/catch/kernels/CMakeLists.txt index 94ca196bb..d251945c4 100644 --- a/catch/kernels/CMakeLists.txt +++ b/catch/kernels/CMakeLists.txt @@ -1,10 +1,14 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + if(NOT RTC_TESTING) - set(TEST_SRC + set(TEST_SRC Set.cpp ) - add_library(KERNELS EXCLUDE_FROM_ALL OBJECT ${TEST_SRC}) - set_source_files_properties(${TEST_SRC} PROPERTIES LANGUAGE HIP) - #set_property(TARGET KERNELS PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded") - target_link_libraries(KERNELS PRIVATE Catch2::Catch2) + add_library(KERNELS EXCLUDE_FROM_ALL OBJECT ${TEST_SRC}) + set_source_files_properties(${TEST_SRC} PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) + target_link_libraries(KERNELS PRIVATE Catch2::Catch2 hip::host hip::device) + add_dependencies(KERNELS hip_tests_config) endif() diff --git a/catch/kernels/Set.cpp b/catch/kernels/Set.cpp index c7fa7fa26..8ae4d4310 100644 --- a/catch/kernels/Set.cpp +++ b/catch/kernels/Set.cpp @@ -1,22 +1,7 @@ /* - * Copyright (C) Advanced Micro Devices, Inc. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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 COPYRIGHT HOLDER(S) 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. + * SPDX-License-Identifier: MIT */ #include diff --git a/catch/kernels/vectorADD.inl b/catch/kernels/vectorADD.inl index b2b096b97..46dc5fc1d 100644 --- a/catch/kernels/vectorADD.inl +++ b/catch/kernels/vectorADD.inl @@ -1,22 +1,7 @@ /* - * Copyright (C) Advanced Micro Devices, Inc. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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 COPYRIGHT HOLDER(S) 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. + * SPDX-License-Identifier: MIT */ namespace HipTest { diff --git a/catch/multiproc/CMakeLists.txt b/catch/multiproc/CMakeLists.txt index 1164601c7..c376325e0 100644 --- a/catch/multiproc/CMakeLists.txt +++ b/catch/multiproc/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests set(TEST_SRC childMalloc.cc @@ -18,15 +22,25 @@ set(TEST_SRC ) if(UNIX) - add_custom_target(dummy_kernel.code - COMMAND ${CMAKE_HIP_COMPILER} + if (HIP_PLATFORM MATCHES "amd") + add_custom_target(dummy_kernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/dummy_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../multiproc/dummy_kernel.code -I${HIP_INCLUDE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) - set_property(GLOBAL APPEND PROPERTY - G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/dummy_kernel.code) + else() + add_custom_target(dummy_kernel.code + COMMAND ${CMAKE_HIP_COMPILER} + --fatbin -x cu ${CMAKE_CURRENT_SOURCE_DIR}/dummy_kernel.cpp + -o ${CMAKE_CURRENT_BINARY_DIR}/../multiproc/dummy_kernel.code + -I${HIP_INCLUDE_DIR} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) + + endif() endif() +set_property(GLOBAL APPEND PROPERTY + G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/dummy_kernel.code) # the last argument linker libraries is required for this test but optional to the function if(HIP_PLATFORM MATCHES "nvidia") @@ -34,7 +48,7 @@ if(HIP_PLATFORM MATCHES "nvidia") TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests LINKER_LIBS nvrtc) - set_target_properties(MultiProc PROPERTIES COMPILE_FLAGS -arch=sm_70) + set_target_properties(MultiProc PROPERTIES COMPILE_FLAGS -arch=compute_75) elseif(HIP_PLATFORM MATCHES "amd") hip_add_exe_to_target(NAME MultiProc TEST_SRC ${TEST_SRC} diff --git a/catch/multiproc/childMalloc.cc b/catch/multiproc/childMalloc.cc index d351f9c21..671c2ab0d 100644 --- a/catch/multiproc/childMalloc.cc +++ b/catch/multiproc/childMalloc.cc @@ -1,22 +1,7 @@ /* - * Copyright (C) Advanced Micro Devices, Inc. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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 COPYRIGHT HOLDER(S) 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. + * SPDX-License-Identifier: MIT */ #include @@ -75,7 +60,7 @@ bool testMallocFromChild() { } -TEST_CASE("ChildMalloc") { +TEST_CASE(ChildMalloc) { auto res = testMallocFromChild(); REQUIRE(res == true); } diff --git a/catch/multiproc/deviceAllocationMproc.cc b/catch/multiproc/deviceAllocationMproc.cc index 93d40ac56..83e12dea3 100644 --- a/catch/multiproc/deviceAllocationMproc.cc +++ b/catch/multiproc/deviceAllocationMproc.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -311,7 +298,7 @@ static bool testDeviceMemMulProc(bool testmalloc) { /** * Multiprocess device side malloc test. */ -TEST_CASE("Unit_deviceAllocation_Malloc_MultProcess") { +TEST_CASE(Unit_deviceAllocation_Malloc_MultProcess) { auto res = testDeviceAllocMulProc(true); REQUIRE(res == true); } @@ -319,7 +306,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_MultProcess") { /** * Multiprocess device side new test. */ -TEST_CASE("Unit_deviceAllocation_New_MultProcess") { +TEST_CASE(Unit_deviceAllocation_New_MultProcess) { auto res = testDeviceAllocMulProc(false); REQUIRE(res == true); } @@ -327,7 +314,7 @@ TEST_CASE("Unit_deviceAllocation_New_MultProcess") { /** * Multiprocess device side malloc, write and free test. */ -TEST_CASE("Unit_deviceAllocation_MallocFree_MultProcess") { +TEST_CASE(Unit_deviceAllocation_MallocFree_MultProcess) { auto res = testDeviceMemMulProc(true); REQUIRE(res == true); } @@ -335,7 +322,7 @@ TEST_CASE("Unit_deviceAllocation_MallocFree_MultProcess") { /** * Multiprocess device side new, write and delete test. */ -TEST_CASE("Unit_deviceAllocation_NewDelete_MultProcess") { +TEST_CASE(Unit_deviceAllocation_NewDelete_MultProcess) { auto res = testDeviceMemMulProc(false); REQUIRE(res == true); } diff --git a/catch/multiproc/dummy_kernel.cpp b/catch/multiproc/dummy_kernel.cpp index 5539e6651..980df0882 100644 --- a/catch/multiproc/dummy_kernel.cpp +++ b/catch/multiproc/dummy_kernel.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/multiproc/hipDeviceComputeCapabilityMproc.cc b/catch/multiproc/hipDeviceComputeCapabilityMproc.cc index 64cc9ecac..1f3ed9f10 100644 --- a/catch/multiproc/hipDeviceComputeCapabilityMproc.cc +++ b/catch/multiproc/hipDeviceComputeCapabilityMproc.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * hipDeviceComputeCapability tests @@ -140,7 +127,7 @@ bool runMaskedDeviceTest(int actualNumGPUs) { /** * Validate behavior of hipDeviceComputeCapability for masked devices. */ -TEST_CASE("Unit_hipDeviceGet_MaskedDevices") { +TEST_CASE(Unit_hipDeviceGet_MaskedDevices) { int count = -1; constexpr int ReqGPUs = 2; bool ret; diff --git a/catch/multiproc/hipDeviceGetPCIBusIdMproc.cc b/catch/multiproc/hipDeviceGetPCIBusIdMproc.cc index 0143ae572..aef7eefe7 100644 --- a/catch/multiproc/hipDeviceGetPCIBusIdMproc.cc +++ b/catch/multiproc/hipDeviceGetPCIBusIdMproc.cc @@ -1,20 +1,7 @@ /* - * Copyright (c) 2020-2021 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* @@ -154,7 +141,7 @@ bool getPciBusId(int deviceCount, char** hipDeviceList) { /** * Scenario: Validate behavior of hipDeviceGetPCIBusId for masked devices. */ -TEST_CASE("Unit_hipDeviceGetPCIBusId_MaskedDevices") { +TEST_CASE(Unit_hipDeviceGetPCIBusId_MaskedDevices) { int count = -1; constexpr int ReqGPUs = 2; bool ret; @@ -173,7 +160,7 @@ TEST_CASE("Unit_hipDeviceGetPCIBusId_MaskedDevices") { * hipDeviceGetPCIBusId vs lspci */ -TEST_CASE("Unit_hipDeviceGetPCIBusId_CheckPciBusIDWithLspci") { +TEST_CASE(Unit_hipDeviceGetPCIBusId_CheckPciBusIDWithLspci) { auto are_devices_hidden = []() -> bool { #if HT_AMD auto env_res = std::getenv("HIP_VISIBLE_DEVICES"); diff --git a/catch/multiproc/hipDeviceTotalMemMproc.cc b/catch/multiproc/hipDeviceTotalMemMproc.cc index 2ae79b7db..1960b5efe 100644 --- a/catch/multiproc/hipDeviceTotalMemMproc.cc +++ b/catch/multiproc/hipDeviceTotalMemMproc.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2020-2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #ifdef __linux__ @@ -152,7 +139,7 @@ static bool getTotalMemoryOfMaskedDevices(int actualNumGPUs) { * - Multi-device test * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceTotalMem_MaskedDevices") { +TEST_CASE(Unit_hipDeviceTotalMem_MaskedDevices) { int count = -1; constexpr int ReqGPUs = 2; bool ret; diff --git a/catch/multiproc/hipGetDeviceAttributeMproc.cc b/catch/multiproc/hipGetDeviceAttributeMproc.cc index 933d88ceb..9c56b41a3 100644 --- a/catch/multiproc/hipGetDeviceAttributeMproc.cc +++ b/catch/multiproc/hipGetDeviceAttributeMproc.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2020-2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * hipGetDeviceAttribute tests @@ -146,7 +130,7 @@ static bool validateGetAttributeOfMaskedDevices(int actualNumGPUs) { /** * Scenario: Validate behavior of hipDeviceGetAttribute for masked devices. */ -TEST_CASE("Unit_hipDeviceGetAttribute_MaskedDevices") { +TEST_CASE(Unit_hipDeviceGetAttribute_MaskedDevices) { int count = -1; constexpr int ReqGPUs = 2; bool ret; diff --git a/catch/multiproc/hipGetDeviceCountMproc.cc b/catch/multiproc/hipGetDeviceCountMproc.cc index 3d2830f59..cfc6e26d4 100644 --- a/catch/multiproc/hipGetDeviceCountMproc.cc +++ b/catch/multiproc/hipGetDeviceCountMproc.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2020-2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * hipGetDeviceCount tests @@ -33,7 +20,7 @@ THE SOFTWARE. /** * Validate behavior of hipGetDeviceCount for masked devices. */ -TEST_CASE("Unit_hipGetDeviceCount_MaskedDevices") { +TEST_CASE(Unit_hipGetDeviceCount_MaskedDevices) { int numDevices = 0; char visibleDeviceString[MAX_SIZE] = {}; snprintf(visibleDeviceString, MAX_SIZE, "%d", VISIBLE_DEVICE); diff --git a/catch/multiproc/hipGetDevicePropertiesMproc.cc b/catch/multiproc/hipGetDevicePropertiesMproc.cc index 56b5f4def..a866c9aaf 100644 --- a/catch/multiproc/hipGetDevicePropertiesMproc.cc +++ b/catch/multiproc/hipGetDevicePropertiesMproc.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * Scenario: Validate behavior of hipGetDeviceProperties for masked devices. @@ -145,7 +129,7 @@ static bool validateGetPropsOfMaskedDevices(int actualNumGPUs) { /** * Scenario: Validate behavior of hipGetDeviceProperties for masked devices. */ -TEST_CASE("Unit_hipGetDeviceProperties_MaskedDevices") { +TEST_CASE(Unit_hipGetDeviceProperties_MaskedDevices) { int count = -1; constexpr int ReqGPUs = 2; bool ret; diff --git a/catch/multiproc/hipIpcEventHandle.cc b/catch/multiproc/hipIpcEventHandle.cc index e86f78759..14d4c6f82 100644 --- a/catch/multiproc/hipIpcEventHandle.cc +++ b/catch/multiproc/hipIpcEventHandle.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -238,7 +225,7 @@ void runMultiProcKernel(ipcEventInfo_t* shmEventInfo, int index) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcEventHandle_Functional") { +TEST_CASE(Unit_hipIpcEventHandle_Functional) { ipcDevices_t* shmDevices; ipcEventInfo_t* shmEventInfo; shmDevices = reinterpret_cast( @@ -333,7 +320,7 @@ TEST_CASE("Unit_hipIpcEventHandle_Functional") { * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcEventHandle_ParameterValidation") { +TEST_CASE(Unit_hipIpcEventHandle_ParameterValidation) { hipEvent_t event; hipIpcEventHandle_t eventHandle; hipError_t ret; diff --git a/catch/multiproc/hipIpcMemAccessTest.cc b/catch/multiproc/hipIpcMemAccessTest.cc index 032e3a619..83c6a41f2 100644 --- a/catch/multiproc/hipIpcMemAccessTest.cc +++ b/catch/multiproc/hipIpcMemAccessTest.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -76,7 +63,7 @@ typedef struct mem_handle { * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcMemAccess_Semaphores") { +TEST_CASE(Unit_hipIpcMemAccess_Semaphores) { hip_ipc_t* shrd_mem = NULL; pid_t pid; size_t N = 1024; @@ -210,7 +197,7 @@ TEST_CASE("Unit_hipIpcMemAccess_Semaphores") { * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcMemAccess_ParameterValidation") { +TEST_CASE(Unit_hipIpcMemAccess_ParameterValidation) { hipIpcMemHandle_t MemHandle; hipIpcMemHandle_t MemHandleUninit; void *Ad{}, *Ad2{}; diff --git a/catch/multiproc/hipMallocConcurrencyMproc.cc b/catch/multiproc/hipMallocConcurrencyMproc.cc index 7c5fe2368..09fb074ca 100644 --- a/catch/multiproc/hipMallocConcurrencyMproc.cc +++ b/catch/multiproc/hipMallocConcurrencyMproc.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -157,7 +144,7 @@ static bool validateMemoryOnGPU(int gpu, bool concurOnOneGPU = false) { /** * Parallel execution of parent and child on gpu0 */ -TEST_CASE("Unit_hipMalloc_ChildConcurrencyDefaultGpu") { +TEST_CASE(Unit_hipMalloc_ChildConcurrencyDefaultGpu) { int devCnt = 0, pid = 0; constexpr auto resSuccess = 1, resFailure = 2; bool TestPassed = true; @@ -200,7 +187,7 @@ TEST_CASE("Unit_hipMalloc_ChildConcurrencyDefaultGpu") { * Parallel execution of api on multiple gpus from * different child processes. */ -TEST_CASE("Unit_hipMalloc_ChildConcurrencyMultiGpu") { +TEST_CASE(Unit_hipMalloc_ChildConcurrencyMultiGpu) { int devCnt = 0, pid = 0; constexpr auto resSuccess = 1, resFailure = 2; diff --git a/catch/multiproc/hipMemCoherencyTstMProc.cc b/catch/multiproc/hipMemCoherencyTstMProc.cc index 83a58729f..f85956db2 100644 --- a/catch/multiproc/hipMemCoherencyTstMProc.cc +++ b/catch/multiproc/hipMemCoherencyTstMProc.cc @@ -1,20 +1,7 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* Test Case Description: @@ -101,7 +88,7 @@ bool static TstCoherency(int* Ptr, bool HmmMem) { behavior is observed or not with memory allocated using malloc()*/ // The following test is failing on Nvidia platform hence disabled it for now #if HT_AMD -TEST_CASE("Unit_malloc_CoherentTst") { +TEST_CASE(Unit_malloc_CoherentTst) { CHECK_PCIE_ATOMIC_SUPPORT hipDeviceProp_t prop; HIPCHECK(hipGetDeviceProperties(&prop, 0)); @@ -132,7 +119,7 @@ TEST_CASE("Unit_malloc_CoherentTst") { behavior is observed or not with memory allocated using malloc()*/ // The following test is failing on Nvidia platform hence disabling it for now #if HT_AMD -TEST_CASE("Unit_malloc_CoherentTstWthAdvise") { +TEST_CASE(Unit_malloc_CoherentTstWthAdvise) { hipDeviceProp_t prop; HIPCHECK(hipGetDeviceProperties(&prop, 0)); char* p = NULL; @@ -164,7 +151,7 @@ TEST_CASE("Unit_malloc_CoherentTstWthAdvise") { behavior is observed or not with memory allocated using mmap()*/ // The following test is failing on Nvidia platform hence disabling it for now #if HT_AMD -TEST_CASE("Unit_mmap_CoherentTst") { +TEST_CASE(Unit_mmap_CoherentTst) { CHECK_PCIE_ATOMIC_SUPPORT hipDeviceProp_t prop; HIPCHECK(hipGetDeviceProperties(&prop, 0)); @@ -198,7 +185,7 @@ TEST_CASE("Unit_mmap_CoherentTst") { behavior is observed or not with memory allocated using mmap()*/ // The following test is failing on Nvidia platform hence disabling it for now #if HT_AMD -TEST_CASE("Unit_mmap_CoherentTstWthAdvise") { +TEST_CASE(Unit_mmap_CoherentTstWthAdvise) { hipDeviceProp_t prop; HIPCHECK(hipGetDeviceProperties(&prop, 0)); char* p = NULL; @@ -242,7 +229,7 @@ TEST_CASE("Unit_mmap_CoherentTstWthAdvise") { accessible when HIP_HOST_COHERENT is set to 0*/ // The following test is AMD specific test hence skipping for Nvidia #if HT_AMD -TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg1") { +TEST_CASE(Unit_hipHostMalloc_WthEnv0Flg1) { if ((setenv("HIP_HOST_COHERENT", "0", 1)) != 0) { WARN("Unable to turn on HIP_HOST_COHERENT, hence terminating the Test case!"); REQUIRE(false); @@ -282,7 +269,7 @@ TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg1") { accessible when HIP_HOST_COHERENT is set to 0*/ // The following test is AMD specific test hence skipping for Nvidia #if HT_AMD -TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg2") { +TEST_CASE(Unit_hipHostMalloc_WthEnv0Flg2) { if ((setenv("HIP_HOST_COHERENT", "0", 1)) != 0) { WARN("Unable to turn on HIP_HOST_COHERENT, hence terminating the Test case!"); REQUIRE(false); @@ -322,7 +309,7 @@ TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg2") { accessible when HIP_HOST_COHERENT is set to 0*/ // The following test is AMD specific test hence skipping for Nvidia #if HT_AMD -TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg3") { +TEST_CASE(Unit_hipHostMalloc_WthEnv0Flg3) { if ((setenv("HIP_HOST_COHERENT", "0", 1)) != 0) { WARN("Unable to turn on HIP_HOST_COHERENT, hence terminating the Test case!"); REQUIRE(false); @@ -362,7 +349,7 @@ TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg3") { accessible when HIP_HOST_COHERENT is set to 0*/ // The following test is AMD specific test hence skipping for Nvidia #if HT_AMD -TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg4") { +TEST_CASE(Unit_hipHostMalloc_WthEnv0Flg4) { if ((setenv("HIP_HOST_COHERENT", "0", 1)) != 0) { WARN("Unable to turn on HIP_HOST_COHERENT, hence terminating the Test case!"); REQUIRE(false); @@ -403,7 +390,7 @@ TEST_CASE("Unit_hipHostMalloc_WthEnv0Flg4") { fine grain behavior when HIP_HOST_COHERENT is set to 1*/ // The following test is AMD specific test hence skipping for Nvidia #if HT_AMD -TEST_CASE("Unit_hipHostMalloc_WthEnv1") { +TEST_CASE(Unit_hipHostMalloc_WthEnv1) { if ((setenv("HIP_HOST_COHERENT", "1", 1)) != 0) { WARN("Unable to turn on HIP_HOST_COHERENT, hence terminating the Test case!"); REQUIRE(false); @@ -432,7 +419,7 @@ TEST_CASE("Unit_hipHostMalloc_WthEnv1") { fine grain behavior when HIP_HOST_COHERENT is set to 1*/ // The following test is AMD specific test hence skipping for Nvidia #if HT_AMD -TEST_CASE("Unit_hipHostMalloc_WthEnv1Flg1") { +TEST_CASE(Unit_hipHostMalloc_WthEnv1Flg1) { if ((setenv("HIP_HOST_COHERENT", "1", 1)) != 0) { WARN("Unable to turn on HIP_HOST_COHERENT, hence terminating the Test case!"); REQUIRE(false); @@ -460,7 +447,7 @@ TEST_CASE("Unit_hipHostMalloc_WthEnv1Flg1") { fine grain behavior when HIP_HOST_COHERENT is set to 1*/ // The following test is AMD specific test hence skipping for Nvidia #if HT_AMD -TEST_CASE("Unit_hipHostMalloc_WthEnv1Flg2") { +TEST_CASE(Unit_hipHostMalloc_WthEnv1Flg2) { if ((setenv("HIP_HOST_COHERENT", "1", 1)) != 0) { WARN("Unable to turn on HIP_HOST_COHERENT, hence terminating the Test case!"); REQUIRE(false); @@ -488,7 +475,7 @@ TEST_CASE("Unit_hipHostMalloc_WthEnv1Flg2") { fine grain behavior when HIP_HOST_COHERENT is set to 1*/ // The following test is AMD specific test hence skipping for Nvidia #if HT_AMD -TEST_CASE("Unit_hipHostMalloc_WthEnv1Flg3") { +TEST_CASE(Unit_hipHostMalloc_WthEnv1Flg3) { if ((setenv("HIP_HOST_COHERENT", "1", 1)) != 0) { WARN("Unable to turn on HIP_HOST_COHERENT, hence terminating the Test case!"); REQUIRE(false); diff --git a/catch/multiproc/hipMemGetInfoMProc.cc b/catch/multiproc/hipMemGetInfoMProc.cc index 7b7c6ffd9..541367018 100644 --- a/catch/multiproc/hipMemGetInfoMProc.cc +++ b/catch/multiproc/hipMemGetInfoMProc.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -34,7 +22,7 @@ THE SOFTWARE. * Fork() a child process and verify that 2 GB has been * allocated in parent process. */ -TEST_CASE("Unit_hipMemGetInfo_Functional_Scenario1") { +TEST_CASE(Unit_hipMemGetInfo_Functional_Scenario1) { constexpr size_t size = 2147483648; // 2GB int fd[2], fd1[2], status; status = pipe(fd); @@ -94,7 +82,7 @@ TEST_CASE("Unit_hipMemGetInfo_Functional_Scenario1") { * 2 GB of device memory. Signal the parent process. Verify from the parent * process that 2 GB is allocated in the child process. */ -TEST_CASE("Unit_hipMemGetInfo_Functional_Scenario2") { +TEST_CASE(Unit_hipMemGetInfo_Functional_Scenario2) { constexpr size_t size = 2147483648; // 2GB int fd[2], fd2[2], status; status = pipe(fd); @@ -151,7 +139,7 @@ TEST_CASE("Unit_hipMemGetInfo_Functional_Scenario2") { * child process. Verify from the parent process that 2 GB is * freed in the child process. */ -TEST_CASE("Unit_hipMemGetInfo_Functional_Scenario3") { +TEST_CASE(Unit_hipMemGetInfo_Functional_Scenario3) { constexpr size_t size = 2147483648; // 2GB int fd[2], status; status = pipe(fd); @@ -193,7 +181,7 @@ TEST_CASE("Unit_hipMemGetInfo_Functional_Scenario3") { * 2 GB of device memory. Exit from child process. Verify from the parent * process that 2 GB is freed in the child process. */ -TEST_CASE("Unit_hipMemGetInfo_Functional_scenario4") { +TEST_CASE(Unit_hipMemGetInfo_Functional_scenario4) { constexpr size_t size = 2147483648; // 2GB pid_t child_pid; child_pid = fork(); // Create a new child process @@ -219,7 +207,7 @@ TEST_CASE("Unit_hipMemGetInfo_Functional_scenario4") { * Fork() a child process and verify that 2 GB has been allocated from * parent process in every device. */ -TEST_CASE("Unit_hipMemGetInfo_Functional_MultiDevice_Scenario5") { +TEST_CASE(Unit_hipMemGetInfo_Functional_MultiDevice_Scenario5) { constexpr size_t size = 2147483648; // 2GB size_t free = 0, total = 0; int fd1[2], fd2[2], status; @@ -367,7 +355,7 @@ static bool testHiddenFreeMemFromChild() { * in parent. Get free and total memory. Free memory available should be * actual (actual free - 4 GB). */ -TEST_CASE("Unit_hipMemGetInfo_SetHiddenFreeMemFromChild") { +TEST_CASE(Unit_hipMemGetInfo_SetHiddenFreeMemFromChild) { REQUIRE(true == testHiddenFreeMemFromChild()); } @@ -375,7 +363,7 @@ TEST_CASE("Unit_hipMemGetInfo_SetHiddenFreeMemFromChild") { * Scenario: Set the HIP_HIDDEN_FREE_MEM to 4GB. Invoke hipMemGetInfo to * verify that 4GB free memory is hidden for all available GPUs. */ -TEST_CASE("Unit_hipMemGetInfo_VerifyHiddenFreeMemForAllGpu") { +TEST_CASE(Unit_hipMemGetInfo_VerifyHiddenFreeMemForAllGpu) { int numDevices = 0; int64_t size_tohide = (FREE_MEM_TO_HIDE / (1024 * 1024)); // in MB // set environment variable from shell diff --git a/catch/multiproc/hipNoGpuTsts.cc b/catch/multiproc/hipNoGpuTsts.cc index 92eb2ce14..49ed36d55 100644 --- a/catch/multiproc/hipNoGpuTsts.cc +++ b/catch/multiproc/hipNoGpuTsts.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -989,6 +976,7 @@ static bool NoGpuTst_hipLaunchCooperativeKernel() { return passed; } +#if HT_AMD // No GPU test for hipLaunchCooperativeKernelMultiDevice() API static bool NoGpuTst_hipLaunchCooperativeKernelMultiDevice() { bool passed = false; @@ -1021,7 +1009,6 @@ static bool NoGpuTst_hipLaunchCooperativeKernelMultiDevice() { } // No GPU test for hipExtLaunchMultiKernelMultiDevice() API -#if HT_AMD static bool NoGpuTst_hipExtLaunchMultiKernelMultiDevice() { bool passed = false; hipError_t err; @@ -1321,256 +1308,256 @@ static bool NoGpuTst_Common(bool (*test_fn)()) { } // Tests -TEST_CASE("Unit_NoGpuTst_hipGetDeviceCount") { +TEST_CASE(Unit_NoGpuTst_hipGetDeviceCount) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipGetDeviceCount)); } -TEST_CASE("Unit_NoGpuTst_hipSetDevice") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipSetDevice)); } +TEST_CASE(Unit_NoGpuTst_hipSetDevice) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipSetDevice)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGetAttribute") { +TEST_CASE(Unit_NoGpuTst_hipDeviceGetAttribute) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetAttribute)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGetP2PAttribute") { +TEST_CASE(Unit_NoGpuTst_hipDeviceGetP2PAttribute) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetP2PAttribute)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGetPCIBusId") { +TEST_CASE(Unit_NoGpuTst_hipDeviceGetPCIBusId) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetPCIBusId)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGetByPCIBusId") { +TEST_CASE(Unit_NoGpuTst_hipDeviceGetByPCIBusId) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetByPCIBusId)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceTotalMem") { +TEST_CASE(Unit_NoGpuTst_hipDeviceTotalMem) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceTotalMem)); } -TEST_CASE("Unit_NoGpuTst_hipFuncSetSharedMemConfig") { +TEST_CASE(Unit_NoGpuTst_hipFuncSetSharedMemConfig) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipFuncSetSharedMemConfig)); } -TEST_CASE("Unit_NoGpuTst_hipStreamCreate") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamCreate)); } +TEST_CASE(Unit_NoGpuTst_hipStreamCreate) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamCreate)); } -TEST_CASE("Unit_NoGpuTst_hipStreamCreateWithPriority") { +TEST_CASE(Unit_NoGpuTst_hipStreamCreateWithPriority) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamCreateWithPriority)); } -TEST_CASE("Unit_NoGpuTst_hipStreamSynchronize") { +TEST_CASE(Unit_NoGpuTst_hipStreamSynchronize) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamSynchronize)); } -TEST_CASE("Unit_NoGpuTst_hipStreamGetFlags") { +TEST_CASE(Unit_NoGpuTst_hipStreamGetFlags) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamGetFlags)); } #if HT_AMD -TEST_CASE("Unit_NoGpuTst_hipExtStreamCreateWithCUMask") { +TEST_CASE(Unit_NoGpuTst_hipExtStreamCreateWithCUMask) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipExtStreamCreateWithCUMask)); } #endif -TEST_CASE("Unit_NoGpuTst_hipStreamAddCallback") { +TEST_CASE(Unit_NoGpuTst_hipStreamAddCallback) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamAddCallback)); } -TEST_CASE("Unit_NoGpuTst_hipEventCreateWithFlags") { +TEST_CASE(Unit_NoGpuTst_hipEventCreateWithFlags) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipEventCreateWithFlags)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceSynchronize") { +TEST_CASE(Unit_NoGpuTst_hipDeviceSynchronize) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceSynchronize)); } -TEST_CASE("Unit_NoGpuTst_hipGetDevice") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipGetDevice)); } +TEST_CASE(Unit_NoGpuTst_hipGetDevice) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipGetDevice)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGetCacheConfig") { +TEST_CASE(Unit_NoGpuTst_hipDeviceGetCacheConfig) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetCacheConfig)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGetSharedMemConfig") { +TEST_CASE(Unit_NoGpuTst_hipDeviceGetSharedMemConfig) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetSharedMemConfig)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceSetSharedMemConfig") { +TEST_CASE(Unit_NoGpuTst_hipDeviceSetSharedMemConfig) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceSetSharedMemConfig)); } -TEST_CASE("Unit_NoGpuTst_hipPointerGetAttributes") { +TEST_CASE(Unit_NoGpuTst_hipPointerGetAttributes) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipPointerGetAttributes)); } #if HT_AMD -TEST_CASE("Unit_NoGpuTst_hipExtMallocWithFlags") { +TEST_CASE(Unit_NoGpuTst_hipExtMallocWithFlags) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipExtMallocWithFlags)); } #endif -TEST_CASE("Unit_NoGpuTst_hipMallocManaged") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMallocManaged)); } +TEST_CASE(Unit_NoGpuTst_hipMallocManaged) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMallocManaged)); } -TEST_CASE("Unit_NoGpuTst_hipHostFree") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipHostFree)); } +TEST_CASE(Unit_NoGpuTst_hipHostFree) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipHostFree)); } -TEST_CASE("Unit_NoGpuTst_hipMemcpyWithStream") { +TEST_CASE(Unit_NoGpuTst_hipMemcpyWithStream) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMemcpyWithStream)); } -TEST_CASE("Unit_NoGpuTst_hipMallocArray") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMallocArray)); } +TEST_CASE(Unit_NoGpuTst_hipMallocArray) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMallocArray)); } #if HT_AMD -TEST_CASE("Unit_NoGpuTst_hipMallocMipmappedArray") { +TEST_CASE(Unit_NoGpuTst_hipMallocMipmappedArray) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMallocMipmappedArray)); } #endif -TEST_CASE("Unit_NoGpuTst_hipDeviceEnablePeerAccess") { +TEST_CASE(Unit_NoGpuTst_hipDeviceEnablePeerAccess) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceEnablePeerAccess)); } -TEST_CASE("Unit_NoGpuTst_hipHostMalloc") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipHostMalloc)); } +TEST_CASE(Unit_NoGpuTst_hipHostMalloc) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipHostMalloc)); } -TEST_CASE("Unit_NoGpuTst_hipMalloc") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMalloc)); } +TEST_CASE(Unit_NoGpuTst_hipMalloc) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMalloc)); } -TEST_CASE("Unit_NoGpuTst_hipHostRegister") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipHostRegister)); } +TEST_CASE(Unit_NoGpuTst_hipHostRegister) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipHostRegister)); } -TEST_CASE("Unit_NoGpuTst_hipMemcpy") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMemcpy)); } +TEST_CASE(Unit_NoGpuTst_hipMemcpy) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMemcpy)); } -TEST_CASE("Unit_NoGpuTst_hipMemAllocPitch") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMemAllocPitch)); } +TEST_CASE(Unit_NoGpuTst_hipMemAllocPitch) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMemAllocPitch)); } -TEST_CASE("Unit_NoGpuTst_hipMemGetInfo") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMemGetInfo)); } +TEST_CASE(Unit_NoGpuTst_hipMemGetInfo) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMemGetInfo)); } -TEST_CASE("Unit_NoGpuTst_hipMalloc3DArray") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMalloc3DArray)); } +TEST_CASE(Unit_NoGpuTst_hipMalloc3DArray) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMalloc3DArray)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceCanAccessPeer") { +TEST_CASE(Unit_NoGpuTst_hipDeviceCanAccessPeer) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceCanAccessPeer)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceDisablePeerAccess") { +TEST_CASE(Unit_NoGpuTst_hipDeviceDisablePeerAccess) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceDisablePeerAccess)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGet") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGet)); } +TEST_CASE(Unit_NoGpuTst_hipDeviceGet) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGet)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceComputeCapability") { +TEST_CASE(Unit_NoGpuTst_hipDeviceComputeCapability) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceComputeCapability)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGetName") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetName)); } +TEST_CASE(Unit_NoGpuTst_hipDeviceGetName) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetName)); } -TEST_CASE("Unit_NoGpuTst_hipGetDeviceProperties") { +TEST_CASE(Unit_NoGpuTst_hipGetDeviceProperties) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipGetDeviceProperties)); } -TEST_CASE("Unit_NoGpuTst_hipChooseDevice") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipChooseDevice)); } +TEST_CASE(Unit_NoGpuTst_hipChooseDevice) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipChooseDevice)); } #if HT_AMD -TEST_CASE("Unit_NoGpuTst_hipExtGetLinkTypeAndHopCount") { +TEST_CASE(Unit_NoGpuTst_hipExtGetLinkTypeAndHopCount) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipExtGetLinkTypeAndHopCount)); } -TEST_CASE("Unit_NoGpuTst_hipExtStreamGetCUMask") { +TEST_CASE(Unit_NoGpuTst_hipExtStreamGetCUMask) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipExtStreamGetCUMask)); } #endif -TEST_CASE("Unit_NoGpuTst_hipFuncSetAttribute") { +TEST_CASE(Unit_NoGpuTst_hipFuncSetAttribute) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipFuncSetAttribute)); } -TEST_CASE("Unit_NoGpuTst_hipFuncSetCacheConfig") { +TEST_CASE(Unit_NoGpuTst_hipFuncSetCacheConfig) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipFuncSetCacheConfig)); } -TEST_CASE("Unit_NoGpuTst_hipStreamCreateWithFlags") { +TEST_CASE(Unit_NoGpuTst_hipStreamCreateWithFlags) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamCreateWithFlags)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGetStreamPriorityRange") { +TEST_CASE(Unit_NoGpuTst_hipDeviceGetStreamPriorityRange) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetStreamPriorityRange)); } -TEST_CASE("Unit_NoGpuTst_hipEventCreate") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipEventCreate)); } +TEST_CASE(Unit_NoGpuTst_hipEventCreate) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipEventCreate)); } -TEST_CASE("Unit_NoGpuTst_hipStreamGetPriority") { +TEST_CASE(Unit_NoGpuTst_hipStreamGetPriority) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamGetPriority)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceReset") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceReset)); } +TEST_CASE(Unit_NoGpuTst_hipDeviceReset) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceReset)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceSetCacheConfig") { +TEST_CASE(Unit_NoGpuTst_hipDeviceSetCacheConfig) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceSetCacheConfig)); } -TEST_CASE("Unit_NoGpuTst_hipDeviceGetLimit") { +TEST_CASE(Unit_NoGpuTst_hipDeviceGetLimit) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipDeviceGetLimit)); } -TEST_CASE("Unit_NoGpuTst_hipGetDeviceFlags") { +TEST_CASE(Unit_NoGpuTst_hipGetDeviceFlags) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipGetDeviceFlags)); } -TEST_CASE("Unit_NoGpuTst_hipSetDeviceFlags") { +TEST_CASE(Unit_NoGpuTst_hipSetDeviceFlags) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipSetDeviceFlags)); } -TEST_CASE("Unit_NoGpuTst_hipModuleLoad") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipModuleLoad)); } +TEST_CASE(Unit_NoGpuTst_hipModuleLoad) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipModuleLoad)); } -TEST_CASE("Unit_NoGpuTst_hipFuncGetAttributes") { +TEST_CASE(Unit_NoGpuTst_hipFuncGetAttributes) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipFuncGetAttributes)); } -TEST_CASE("Unit_NoGpuTst_hipModuleLoadData") { +TEST_CASE(Unit_NoGpuTst_hipModuleLoadData) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipModuleLoadData)); } -TEST_CASE("Unit_NoGpuTst_hipModuleLoadDataEx") { +TEST_CASE(Unit_NoGpuTst_hipModuleLoadDataEx) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipModuleLoadDataEx)); } -TEST_CASE("Unit_NoGpuTst_hipLaunchCooperativeKernel") { +TEST_CASE(Unit_NoGpuTst_hipLaunchCooperativeKernel) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipLaunchCooperativeKernel)); } -TEST_CASE("Unit_NoGpuTst_hipLaunchCooperativeKernelMultiDevice") { +#if HT_AMD +TEST_CASE(Unit_NoGpuTst_hipLaunchCooperativeKernelMultiDevice) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipLaunchCooperativeKernelMultiDevice)); } -#if HT_AMD -TEST_CASE("Unit_NoGpuTst_hipExtLaunchMultiKernelMultiDevice") { +TEST_CASE(Unit_NoGpuTst_hipExtLaunchMultiKernelMultiDevice) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipExtLaunchMultiKernelMultiDevice)); } #endif -TEST_CASE("Unit_NoGpuTst_hipOccupancyMaxActiveBlocksPerMultiprocessor") { +TEST_CASE(Unit_NoGpuTst_hipOccupancyMaxActiveBlocksPerMultiprocessor) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipOccupancyMaxActiveBlocksPerMultiprocessor)); } -TEST_CASE("Unit_NoGpuTst_hipOccupancyMaxActiveBlocksPerMultiprocessorFlags") { +TEST_CASE(Unit_NoGpuTst_hipOccupancyMaxActiveBlocksPerMultiprocessorFlags) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipOccupancyMaxActiveBlocksPerMultiprocessorFlags)); } -TEST_CASE("Unit_NoGpuTst_hipOccupancyMaxPotentialBlockSize") { +TEST_CASE(Unit_NoGpuTst_hipOccupancyMaxPotentialBlockSize) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipOccupancyMaxPotentialBlockSize)); } -TEST_CASE("Unit_NoGpuTst_hiprtcVersion") { REQUIRE(NoGpuTst_Common(NoGpuTst_hiprtcVersion)); } +TEST_CASE(Unit_NoGpuTst_hiprtcVersion) { REQUIRE(NoGpuTst_Common(NoGpuTst_hiprtcVersion)); } -TEST_CASE("Unit_NoGpuTst_hiprtcCreateProgram_DestroyProg") { +TEST_CASE(Unit_NoGpuTst_hiprtcCreateProgram_DestroyProg) { REQUIRE(NoGpuTst_Common(NoGpuTst_hiprtcCreateProgram_DestroyProg)); } -TEST_CASE("Unit_NoGpuTst_hiprtcAddNameExpression") { +TEST_CASE(Unit_NoGpuTst_hiprtcAddNameExpression) { REQUIRE(NoGpuTst_Common(NoGpuTst_hiprtcAddNameExpression)); } -TEST_CASE("Unit_NoGpuTst_hipMallocPitch") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMallocPitch)); } +TEST_CASE(Unit_NoGpuTst_hipMallocPitch) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMallocPitch)); } #if HT_AMD -TEST_CASE("Unit_NoGpuTst_hipMipmappedArrayCreate") { +TEST_CASE(Unit_NoGpuTst_hipMipmappedArrayCreate) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMipmappedArrayCreate)); } #endif -TEST_CASE("Unit_NoGpuTst_hipMalloc3D") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMalloc3D)); } +TEST_CASE(Unit_NoGpuTst_hipMalloc3D) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipMalloc3D)); } -TEST_CASE("Unit_NoGpuTst_hipGraphCreate") { REQUIRE(NoGpuTst_Common(NoGpuTst_hipGraphCreate)); } +TEST_CASE(Unit_NoGpuTst_hipGraphCreate) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipGraphCreate)); } -TEST_CASE("Unit_NoGpuTst_hipStreamBeginCapture") { +TEST_CASE(Unit_NoGpuTst_hipStreamBeginCapture) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamBeginCapture)); } -TEST_CASE("Unit_NoGpuTst_hipStreamIsCapturing") { +TEST_CASE(Unit_NoGpuTst_hipStreamIsCapturing) { REQUIRE(NoGpuTst_Common(NoGpuTst_hipStreamIsCapturing)); } #endif // #ifdef __linux__ diff --git a/catch/multiproc/hipSetGetDeviceMproc.cc b/catch/multiproc/hipSetGetDeviceMproc.cc index 3f6cf82bd..3029cbcb8 100644 --- a/catch/multiproc/hipSetGetDeviceMproc.cc +++ b/catch/multiproc/hipSetGetDeviceMproc.cc @@ -1,20 +1,7 @@ /* - * Copyright (c) 2021 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* @@ -397,7 +384,7 @@ static void testMinRvdMaxHvd(int numDevices, int* deviceList, int count) { /** * Scenario sets Invalid visible device list and checks behavior. */ -TEST_CASE("Unit_hipSetDevice_InvalidVisibleDeviceList") { +TEST_CASE(Unit_hipSetDevice_InvalidVisibleDeviceList) { int numDevices = 0; getDeviceCount(&numDevices); @@ -420,7 +407,7 @@ TEST_CASE("Unit_hipSetDevice_InvalidVisibleDeviceList") { /** * Scenario sets valid visible device list and checks behavior. */ -TEST_CASE("Unit_hipSetDevice_ValidVisibleDeviceList") { +TEST_CASE(Unit_hipSetDevice_ValidVisibleDeviceList) { int numDevices = 0; std::vector deviceList; @@ -445,7 +432,7 @@ TEST_CASE("Unit_hipSetDevice_ValidVisibleDeviceList") { /** * Scenario sets subset of available devices and checks behavior. */ -TEST_CASE("Unit_hipSetDevice_SubsetOfAvailableDevices") { +TEST_CASE(Unit_hipSetDevice_SubsetOfAvailableDevices) { int numDevices = 0; int deviceList[MAX_SIZE]; int deviceListLength = 1; @@ -471,7 +458,7 @@ TEST_CASE("Unit_hipSetDevice_SubsetOfAvailableDevices") { * Scenario tests getDevice behavior with Minimal Len of RVD * and Maximal Len of HVD */ -TEST_CASE("Unit_hipSetDevice_MinRvdMaxHvdDevicesList") { +TEST_CASE(Unit_hipSetDevice_MinRvdMaxHvdDevicesList) { int numDevices = 0; std::vector deviceList; int count = 0; @@ -499,7 +486,7 @@ TEST_CASE("Unit_hipSetDevice_MinRvdMaxHvdDevicesList") { * Scenario tests getDevice behavior with Maximal Len of RVD * and Minimal Len of HVD */ -TEST_CASE("Unit_hipSetDevice_MaxRvdMinHvdDevicesList") { +TEST_CASE(Unit_hipSetDevice_MaxRvdMinHvdDevicesList) { int numDevices = 0; std::vector deviceList; @@ -523,7 +510,7 @@ TEST_CASE("Unit_hipSetDevice_MaxRvdMinHvdDevicesList") { /** * Scenario tests getDevice behavior with combination of RVD and CVD */ -TEST_CASE("Unit_hipSetDevice_RvdCvdDevicesList") { +TEST_CASE(Unit_hipSetDevice_RvdCvdDevicesList) { int numDevices = 0; int deviceList[MAX_SIZE]; int count = 0; diff --git a/catch/packaging/CMakeLists.txt b/catch/packaging/CMakeLists.txt index f6c72b599..d5746648a 100644 --- a/catch/packaging/CMakeLists.txt +++ b/catch/packaging/CMakeLists.txt @@ -1,23 +1,8 @@ -# Copyright (c) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT + cmake_minimum_required(VERSION 3.16.8) # vc 19.31.31107.0 gives issue while packaging using makefile # To avoid error NMAKE : fatal error U1065: invalid option 'w' diff --git a/catch/performance/CMakeLists.txt b/catch/performance/CMakeLists.txt index 72dffe211..cf0d97e16 100644 --- a/catch/performance/CMakeLists.txt +++ b/catch/performance/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT add_subdirectory(memset) add_subdirectory(memcpy) diff --git a/catch/performance/event/CMakeLists.txt b/catch/performance/event/CMakeLists.txt index 6d8d25fec..edd8209d8 100644 --- a/catch/performance/event/CMakeLists.txt +++ b/catch/performance/event/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC hipEventCreate.cc diff --git a/catch/performance/event/hipEventCreate.cc b/catch/performance/event/hipEventCreate.cc index 876408791..6262b2208 100644 --- a/catch/performance/event/hipEventCreate.cc +++ b/catch/performance/event/hipEventCreate.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -50,7 +37,7 @@ class HipEventCreateBenchmark : public Benchmark { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipEventCreate") { +TEST_CASE(Performance_hipEventCreate) { HipEventCreateBenchmark benchmark; benchmark.Run(); } diff --git a/catch/performance/event/hipEventCreateWithFlags.cc b/catch/performance/event/hipEventCreateWithFlags.cc index 4eaf6abef..befbc6836 100644 --- a/catch/performance/event/hipEventCreateWithFlags.cc +++ b/catch/performance/event/hipEventCreateWithFlags.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -75,7 +62,7 @@ static void RunBenchmark(unsigned flag) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipEventCreateWithFlags") { +TEST_CASE(Performance_hipEventCreateWithFlags) { const auto flag = GENERATE( hipEventDefault, hipEventBlockingSync, hipEventDisableTiming /*, hipEventInterprocess disabled until fixed (EXSWHTEC-25) */); diff --git a/catch/performance/event/hipEventDestroy.cc b/catch/performance/event/hipEventDestroy.cc index 6db4a94d8..c5fe37d54 100644 --- a/catch/performance/event/hipEventDestroy.cc +++ b/catch/performance/event/hipEventDestroy.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -48,7 +35,7 @@ class HipEventDestroyBenchmark : public Benchmark { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipEventDestroy") { +TEST_CASE(Performance_hipEventDestroy) { HipEventDestroyBenchmark benchmark; benchmark.Run(); } diff --git a/catch/performance/event/hipEventElapsedTime.cc b/catch/performance/event/hipEventElapsedTime.cc index 94ab03a88..6b06af7c8 100644 --- a/catch/performance/event/hipEventElapsedTime.cc +++ b/catch/performance/event/hipEventElapsedTime.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -62,7 +49,7 @@ class HipEventElapsedTimeBenchmark : public Benchmark= 5.2 */ -TEST_CASE("Performance_hipEventElapsedTime") { +TEST_CASE(Performance_hipEventElapsedTime) { HipEventElapsedTimeBenchmark benchmark; benchmark.Run(); } diff --git a/catch/performance/event/hipEventQuery.cc b/catch/performance/event/hipEventQuery.cc index 3622afa3f..3fa1831f4 100644 --- a/catch/performance/event/hipEventQuery.cc +++ b/catch/performance/event/hipEventQuery.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -52,7 +39,7 @@ class HipEventQueryBenchmark : public Benchmark { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipEventQuery") { +TEST_CASE(Performance_hipEventQuery) { HipEventQueryBenchmark benchmark; benchmark.Run(); } diff --git a/catch/performance/event/hipEventRecord.cc b/catch/performance/event/hipEventRecord.cc index face51703..24f648202 100644 --- a/catch/performance/event/hipEventRecord.cc +++ b/catch/performance/event/hipEventRecord.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -63,7 +50,7 @@ static void RunBenchmark(hipStream_t stream) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipEventRecord") { +TEST_CASE(Performance_hipEventRecord) { SECTION("default stream") { RunBenchmark(nullptr); } SECTION("created stream") { diff --git a/catch/performance/event/hipEventSynchronize.cc b/catch/performance/event/hipEventSynchronize.cc index bc389a590..06324abe0 100644 --- a/catch/performance/event/hipEventSynchronize.cc +++ b/catch/performance/event/hipEventSynchronize.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -64,7 +51,7 @@ static void RunBenchmark(unsigned flag) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipEventSynchronize") { +TEST_CASE(Performance_hipEventSynchronize) { const auto flag = GENERATE(hipEventDefault, hipEventBlockingSync); RunBenchmark(flag); } diff --git a/catch/performance/example/CMakeLists.txt b/catch/performance/example/CMakeLists.txt index 47e8bbb96..28408f432 100644 --- a/catch/performance/example/CMakeLists.txt +++ b/catch/performance/example/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC example.cc diff --git a/catch/performance/example/example.cc b/catch/performance/example/example.cc index 2ced78b02..c797ed670 100644 --- a/catch/performance/example/example.cc +++ b/catch/performance/example/example.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -48,7 +32,7 @@ class ExampleBenchmark : public Benchmark { } }; -TEST_CASE("Performance_Example") { +TEST_CASE(Performance_Example) { ExampleBenchmark benchmark; // to override cmd options diff --git a/catch/performance/kernelLaunch/CMakeLists.txt b/catch/performance/kernelLaunch/CMakeLists.txt index 9505cf133..fddaf6e41 100644 --- a/catch/performance/kernelLaunch/CMakeLists.txt +++ b/catch/performance/kernelLaunch/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC kernel_launch_common.cc diff --git a/catch/performance/kernelLaunch/hipExtLaunchKernel.cc b/catch/performance/kernelLaunch/hipExtLaunchKernel.cc index dde41c5cb..a3110bab2 100644 --- a/catch/performance/kernelLaunch/hipExtLaunchKernel.cc +++ b/catch/performance/kernelLaunch/hipExtLaunchKernel.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "kernel_launch_common.hh" @@ -90,7 +74,7 @@ template static void RunBenchmark(bool * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipExtLaunchKernel") { +TEST_CASE(Performance_hipExtLaunchKernel) { bool sync = GENERATE(true, false); SECTION("null kernel") { diff --git a/catch/performance/kernelLaunch/hipExtLaunchKernelGGL.cc b/catch/performance/kernelLaunch/hipExtLaunchKernelGGL.cc index f24532b6f..f1fcb78f4 100644 --- a/catch/performance/kernelLaunch/hipExtLaunchKernelGGL.cc +++ b/catch/performance/kernelLaunch/hipExtLaunchKernelGGL.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -170,7 +157,7 @@ static bool query_gpu_frequency(void (*kernel)(uint64_t* out, size_t maxIter, ui * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipExtLaunchKernelGGL_QueryGPUFrequency") { +TEST_CASE(Performance_hipExtLaunchKernelGGL_QueryGPUFrequency) { HIP_CHECK(hipSetDevice(0)); int clock_rate = 0; // in kHz int wall_clock_rate = 0; // in kHz diff --git a/catch/performance/kernelLaunch/hipLaunchCooperativeKernel.cc b/catch/performance/kernelLaunch/hipLaunchCooperativeKernel.cc index 4607b497e..488e72413 100644 --- a/catch/performance/kernelLaunch/hipLaunchCooperativeKernel.cc +++ b/catch/performance/kernelLaunch/hipLaunchCooperativeKernel.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "kernel_launch_common.hh" @@ -95,7 +79,7 @@ template static void RunBenchmark(bool * - Device supports CooperativeLaunch * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipLaunchCooperativeKernel") { +TEST_CASE(Performance_hipLaunchCooperativeKernel) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; diff --git a/catch/performance/kernelLaunch/hipLaunchKernel.cc b/catch/performance/kernelLaunch/hipLaunchKernel.cc index 0d8ceb7f0..4de4928a6 100644 --- a/catch/performance/kernelLaunch/hipLaunchKernel.cc +++ b/catch/performance/kernelLaunch/hipLaunchKernel.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "kernel_launch_common.hh" @@ -88,7 +72,7 @@ template static void RunBenchmark(bool * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipLaunchKernel") { +TEST_CASE(Performance_hipLaunchKernel) { bool sync = GENERATE(true, false); SECTION("null kernel") { diff --git a/catch/performance/kernelLaunch/kernel_launch_common.cc b/catch/performance/kernelLaunch/kernel_launch_common.cc index 28b6c29b8..e75606c2b 100644 --- a/catch/performance/kernelLaunch/kernel_launch_common.cc +++ b/catch/performance/kernelLaunch/kernel_launch_common.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "kernel_launch_common.hh" diff --git a/catch/performance/kernelLaunch/kernel_launch_common.hh b/catch/performance/kernelLaunch/kernel_launch_common.hh index 1f6194868..05909e924 100644 --- a/catch/performance/kernelLaunch/kernel_launch_common.hh +++ b/catch/performance/kernelLaunch/kernel_launch_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/performance/kernelLaunch/triple_chevron.cc b/catch/performance/kernelLaunch/triple_chevron.cc index 1d00d22f3..3040fde24 100644 --- a/catch/performance/kernelLaunch/triple_chevron.cc +++ b/catch/performance/kernelLaunch/triple_chevron.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "kernel_launch_common.hh" @@ -75,7 +59,7 @@ template static void RunBenchmark(bool * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_Triple_Chevron") { +TEST_CASE(Performance_Triple_Chevron) { bool sync = GENERATE(true, false); SECTION("null kernel") { diff --git a/catch/performance/memcpy/CMakeLists.txt b/catch/performance/memcpy/CMakeLists.txt index 75c9aaf8f..3035ca549 100644 --- a/catch/performance/memcpy/CMakeLists.txt +++ b/catch/performance/memcpy/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC hipMemcpy.cc diff --git a/catch/performance/memcpy/hipMemcpy.cc b/catch/performance/memcpy/hipMemcpy.cc index f308d4916..277b6f466 100644 --- a/catch/performance/memcpy/hipMemcpy.cc +++ b/catch/performance/memcpy/hipMemcpy.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -77,7 +64,7 @@ static void RunBenchmark(LinearAllocs dst_allocation_type, LinearAllocs src_allo * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy_DeviceToHost") { +TEST_CASE(Performance_hipMemcpy_DeviceToHost) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = LinearAllocs::hipMalloc; const auto dst_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); @@ -102,7 +89,7 @@ TEST_CASE("Performance_hipMemcpy_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy_HostToDevice") { +TEST_CASE(Performance_hipMemcpy_HostToDevice) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); const auto dst_allocation_type = LinearAllocs::hipMalloc; @@ -127,7 +114,7 @@ TEST_CASE("Performance_hipMemcpy_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy_HostToHost") { +TEST_CASE(Performance_hipMemcpy_HostToHost) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); const auto dst_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); @@ -154,7 +141,7 @@ TEST_CASE("Performance_hipMemcpy_HostToHost") { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpy_DeviceToDevice_EnablePeerAccess) { if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); return; @@ -184,7 +171,7 @@ TEST_CASE("Performance_hipMemcpy_DeviceToDevice_EnablePeerAccess") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpy_DeviceToDevice_DisablePeerAccess) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = LinearAllocs::hipMalloc; const auto dst_allocation_type = LinearAllocs::hipMalloc; diff --git a/catch/performance/memcpy/hipMemcpy2D.cc b/catch/performance/memcpy/hipMemcpy2D.cc index 9210849b1..7aa0f8197 100644 --- a/catch/performance/memcpy/hipMemcpy2D.cc +++ b/catch/performance/memcpy/hipMemcpy2D.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -92,7 +79,7 @@ static void RunBenchmark(size_t width, size_t height, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2D_DeviceToHost") { +TEST_CASE(Performance_hipMemcpy2D_DeviceToHost) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyDeviceToHost); @@ -113,7 +100,7 @@ TEST_CASE("Performance_hipMemcpy2D_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2D_HostToDevice") { +TEST_CASE(Performance_hipMemcpy2D_HostToDevice) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyHostToDevice); @@ -134,7 +121,7 @@ TEST_CASE("Performance_hipMemcpy2D_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2D_HostToHost") { +TEST_CASE(Performance_hipMemcpy2D_HostToHost) { const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyHostToHost); } @@ -154,7 +141,7 @@ TEST_CASE("Performance_hipMemcpy2D_HostToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2D_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2D_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyDeviceToDevice); @@ -177,7 +164,7 @@ TEST_CASE("Performance_hipMemcpy2D_DeviceToDevice_DisablePeerAccess") { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2D_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2D_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); diff --git a/catch/performance/memcpy/hipMemcpy2DAsync.cc b/catch/performance/memcpy/hipMemcpy2DAsync.cc index a89f8be5e..9a63ef001 100644 --- a/catch/performance/memcpy/hipMemcpy2DAsync.cc +++ b/catch/performance/memcpy/hipMemcpy2DAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -97,7 +84,7 @@ static void RunBenchmark(size_t width, size_t height, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DAsync_DeviceToHost") { +TEST_CASE(Performance_hipMemcpy2DAsync_DeviceToHost) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyDeviceToHost); @@ -118,7 +105,7 @@ TEST_CASE("Performance_hipMemcpy2DAsync_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DAsync_HostToDevice") { +TEST_CASE(Performance_hipMemcpy2DAsync_HostToDevice) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyHostToDevice); @@ -139,7 +126,7 @@ TEST_CASE("Performance_hipMemcpy2DAsync_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DAsync_HostToHost") { +TEST_CASE(Performance_hipMemcpy2DAsync_HostToHost) { const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyHostToHost); } @@ -159,7 +146,7 @@ TEST_CASE("Performance_hipMemcpy2DAsync_HostToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DAsync_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DAsync_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyDeviceToDevice); @@ -182,7 +169,7 @@ TEST_CASE("Performance_hipMemcpy2DAsync_DeviceToDevice_DisablePeerAccess") { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DAsync_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DAsync_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); diff --git a/catch/performance/memcpy/hipMemcpy2DFromArray.cc b/catch/performance/memcpy/hipMemcpy2DFromArray.cc index e334d9bc2..d6790e647 100644 --- a/catch/performance/memcpy/hipMemcpy2DFromArray.cc +++ b/catch/performance/memcpy/hipMemcpy2DFromArray.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -78,7 +65,7 @@ static void RunBenchmark(size_t width, size_t height, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DFromArray_DeviceToHost") { +TEST_CASE(Performance_hipMemcpy2DFromArray_DeviceToHost) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 8_KB, 16_KB); @@ -100,7 +87,7 @@ TEST_CASE("Performance_hipMemcpy2DFromArray_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DFromArray_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DFromArray_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 8_KB, 16_KB); @@ -124,7 +111,7 @@ TEST_CASE("Performance_hipMemcpy2DFromArray_DeviceToDevice_DisablePeerAccess") { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DFromArray_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DFromArray_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { diff --git a/catch/performance/memcpy/hipMemcpy2DFromArrayAsync.cc b/catch/performance/memcpy/hipMemcpy2DFromArrayAsync.cc index ecd50e8d2..dd86bb78f 100644 --- a/catch/performance/memcpy/hipMemcpy2DFromArrayAsync.cc +++ b/catch/performance/memcpy/hipMemcpy2DFromArrayAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -83,7 +70,7 @@ static void RunBenchmark(size_t width, size_t height, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DFromArrayAsync_DeviceToHost") { +TEST_CASE(Performance_hipMemcpy2DFromArrayAsync_DeviceToHost) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 8_KB, 16_KB); @@ -105,7 +92,7 @@ TEST_CASE("Performance_hipMemcpy2DFromArrayAsync_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DFromArrayAsync_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DFromArrayAsync_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 8_KB, 16_KB); @@ -129,7 +116,7 @@ TEST_CASE("Performance_hipMemcpy2DFromArrayAsync_DeviceToDevice_DisablePeerAcces * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DFromArrayAsync_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DFromArrayAsync_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { diff --git a/catch/performance/memcpy/hipMemcpy2DToArray.cc b/catch/performance/memcpy/hipMemcpy2DToArray.cc index 21a4cab41..09d1a0baa 100644 --- a/catch/performance/memcpy/hipMemcpy2DToArray.cc +++ b/catch/performance/memcpy/hipMemcpy2DToArray.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -78,7 +65,7 @@ static void RunBenchmark(size_t width, size_t height, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DToArray_HostToDevice") { +TEST_CASE(Performance_hipMemcpy2DToArray_HostToDevice) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 8_KB, 16_KB); @@ -100,7 +87,7 @@ TEST_CASE("Performance_hipMemcpy2DToArray_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DToArray_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DToArray_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 8_KB, 16_KB); @@ -124,7 +111,7 @@ TEST_CASE("Performance_hipMemcpy2DToArray_DeviceToDevice_DisablePeerAccess") { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DToArray_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DToArray_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { diff --git a/catch/performance/memcpy/hipMemcpy2DToArrayAsync.cc b/catch/performance/memcpy/hipMemcpy2DToArrayAsync.cc index 79f4f424a..09d016128 100644 --- a/catch/performance/memcpy/hipMemcpy2DToArrayAsync.cc +++ b/catch/performance/memcpy/hipMemcpy2DToArrayAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -83,7 +70,7 @@ static void RunBenchmark(size_t width, size_t height, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DToArrayAsync_HostToDevice") { +TEST_CASE(Performance_hipMemcpy2DToArrayAsync_HostToDevice) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 8_KB, 16_KB); @@ -105,7 +92,7 @@ TEST_CASE("Performance_hipMemcpy2DToArrayAsync_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DToArrayAsync_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DToArrayAsync_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 8_KB, 16_KB); @@ -129,7 +116,7 @@ TEST_CASE("Performance_hipMemcpy2DToArrayAsync_DeviceToDevice_DisablePeerAccess" * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy2DToArrayAsync_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpy2DToArrayAsync_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { diff --git a/catch/performance/memcpy/hipMemcpy3D.cc b/catch/performance/memcpy/hipMemcpy3D.cc index 371ed8a32..321771b51 100644 --- a/catch/performance/memcpy/hipMemcpy3D.cc +++ b/catch/performance/memcpy/hipMemcpy3D.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -102,7 +89,7 @@ static void RunBenchmark(const hipExtent extent, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3D_DeviceToHost") { +TEST_CASE(Performance_hipMemcpy3D_DeviceToHost) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(make_hipExtent(width, 16, 4), hipMemcpyDeviceToHost); @@ -123,7 +110,7 @@ TEST_CASE("Performance_hipMemcpy3D_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3D_HostToDevice") { +TEST_CASE(Performance_hipMemcpy3D_HostToDevice) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(make_hipExtent(width, 16, 4), hipMemcpyHostToDevice); @@ -144,7 +131,7 @@ TEST_CASE("Performance_hipMemcpy3D_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3D_HostToHost") { +TEST_CASE(Performance_hipMemcpy3D_HostToHost) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(make_hipExtent(width, 16, 4), hipMemcpyHostToHost); @@ -165,7 +152,7 @@ TEST_CASE("Performance_hipMemcpy3D_HostToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3D_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpy3D_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(make_hipExtent(width, 16, 4), hipMemcpyDeviceToDevice); @@ -188,7 +175,7 @@ TEST_CASE("Performance_hipMemcpy3D_DeviceToDevice_DisablePeerAccess") { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3D_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpy3D_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); diff --git a/catch/performance/memcpy/hipMemcpy3DAsync.cc b/catch/performance/memcpy/hipMemcpy3DAsync.cc index b4d22d3b4..2fc178e6e 100644 --- a/catch/performance/memcpy/hipMemcpy3DAsync.cc +++ b/catch/performance/memcpy/hipMemcpy3DAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -105,7 +92,7 @@ static void RunBenchmark(const hipExtent extent, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3DAsync_DeviceToHost") { +TEST_CASE(Performance_hipMemcpy3DAsync_DeviceToHost) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(make_hipExtent(width, 16, 4), hipMemcpyDeviceToHost); @@ -126,7 +113,7 @@ TEST_CASE("Performance_hipMemcpy3DAsync_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3DAsync_HostToDevice") { +TEST_CASE(Performance_hipMemcpy3DAsync_HostToDevice) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(make_hipExtent(width, 16, 4), hipMemcpyHostToDevice); @@ -147,7 +134,7 @@ TEST_CASE("Performance_hipMemcpy3DAsync_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3DAsync_HostToHost") { +TEST_CASE(Performance_hipMemcpy3DAsync_HostToHost) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(make_hipExtent(width, 16, 4), hipMemcpyHostToHost); @@ -168,7 +155,7 @@ TEST_CASE("Performance_hipMemcpy3DAsync_HostToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3DAsync_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpy3DAsync_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(make_hipExtent(width, 16, 4), hipMemcpyDeviceToDevice); @@ -189,7 +176,7 @@ TEST_CASE("Performance_hipMemcpy3DAsync_DeviceToDevice_DisablePeerAccess") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpy3DAsync_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpy3DAsync_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); diff --git a/catch/performance/memcpy/hipMemcpyAsync.cc b/catch/performance/memcpy/hipMemcpyAsync.cc index b6193c7e3..ee49547c0 100644 --- a/catch/performance/memcpy/hipMemcpyAsync.cc +++ b/catch/performance/memcpy/hipMemcpyAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -82,7 +69,7 @@ static void RunBenchmark(LinearAllocs dst_allocation_type, LinearAllocs src_allo * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyAsync_DeviceToHost") { +TEST_CASE(Performance_hipMemcpyAsync_DeviceToHost) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = LinearAllocs::hipMalloc; const auto dst_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); @@ -107,7 +94,7 @@ TEST_CASE("Performance_hipMemcpyAsync_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyAsync_HostToDevice") { +TEST_CASE(Performance_hipMemcpyAsync_HostToDevice) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); const auto dst_allocation_type = LinearAllocs::hipMalloc; @@ -132,7 +119,7 @@ TEST_CASE("Performance_hipMemcpyAsync_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyAsync_HostToHost") { +TEST_CASE(Performance_hipMemcpyAsync_HostToHost) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); const auto dst_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); @@ -157,7 +144,7 @@ TEST_CASE("Performance_hipMemcpyAsync_HostToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyAsync_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpyAsync_DeviceToDevice_DisablePeerAccess) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = LinearAllocs::hipMalloc; const auto dst_allocation_type = LinearAllocs::hipMalloc; @@ -184,7 +171,7 @@ TEST_CASE("Performance_hipMemcpyAsync_DeviceToDevice_DisablePeerAccess") { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyAsync_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpyAsync_DeviceToDevice_EnablePeerAccess) { if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); return; diff --git a/catch/performance/memcpy/hipMemcpyAtoH.cc b/catch/performance/memcpy/hipMemcpyAtoH.cc index f280b4c95..44ee2c831 100644 --- a/catch/performance/memcpy/hipMemcpyAtoH.cc +++ b/catch/performance/memcpy/hipMemcpyAtoH.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -60,7 +47,7 @@ static void RunBenchmark(LinearAllocs host_allocation_type, size_t width) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyAtoH") { +TEST_CASE(Performance_hipMemcpyAtoH) { CHECK_IMAGE_SUPPORT const auto allocation_size = GENERATE(512, 1024, 4096); diff --git a/catch/performance/memcpy/hipMemcpyDtoD.cc b/catch/performance/memcpy/hipMemcpyDtoD.cc index e7665bdc8..4d6864d0b 100644 --- a/catch/performance/memcpy/hipMemcpyDtoD.cc +++ b/catch/performance/memcpy/hipMemcpyDtoD.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -71,7 +58,7 @@ static void RunBenchmark(size_t size, bool enable_peer_access = false) { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyDtoD_PeerAccessEnabled") { +TEST_CASE(Performance_hipMemcpyDtoD_PeerAccessEnabled) { if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); return; @@ -98,7 +85,7 @@ TEST_CASE("Performance_hipMemcpyDtoD_PeerAccessEnabled") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyDtoD_PeerAccessDisabled") { +TEST_CASE(Performance_hipMemcpyDtoD_PeerAccessDisabled) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(allocation_size); } diff --git a/catch/performance/memcpy/hipMemcpyDtoDAsync.cc b/catch/performance/memcpy/hipMemcpyDtoDAsync.cc index 1a1cdc57e..af2850bef 100644 --- a/catch/performance/memcpy/hipMemcpyDtoDAsync.cc +++ b/catch/performance/memcpy/hipMemcpyDtoDAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -76,7 +63,7 @@ static void RunBenchmark(size_t size, bool enable_peer_access = false) { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyDtoDAsync_PeerAccessEnabled") { +TEST_CASE(Performance_hipMemcpyDtoDAsync_PeerAccessEnabled) { if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); return; @@ -103,7 +90,7 @@ TEST_CASE("Performance_hipMemcpyDtoDAsync_PeerAccessEnabled") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyDtoDAsync_PeerAccessDisabled") { +TEST_CASE(Performance_hipMemcpyDtoDAsync_PeerAccessDisabled) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(allocation_size); } diff --git a/catch/performance/memcpy/hipMemcpyDtoH.cc b/catch/performance/memcpy/hipMemcpyDtoH.cc index 32751bda8..9ac9d1be4 100644 --- a/catch/performance/memcpy/hipMemcpyDtoH.cc +++ b/catch/performance/memcpy/hipMemcpyDtoH.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -62,7 +49,7 @@ static void RunBenchmark(LinearAllocs host_allocation_type, LinearAllocs device_ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyDtoH") { +TEST_CASE(Performance_hipMemcpyDtoH) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto device_allocation_type = LinearAllocs::hipMalloc; const auto host_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); diff --git a/catch/performance/memcpy/hipMemcpyDtoHAsync.cc b/catch/performance/memcpy/hipMemcpyDtoHAsync.cc index 205fea0ef..d775c13e6 100644 --- a/catch/performance/memcpy/hipMemcpyDtoHAsync.cc +++ b/catch/performance/memcpy/hipMemcpyDtoHAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -67,7 +54,7 @@ static void RunBenchmark(LinearAllocs host_allocation_type, LinearAllocs device_ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyDtoHAsync") { +TEST_CASE(Performance_hipMemcpyDtoHAsync) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto device_allocation_type = LinearAllocs::hipMalloc; const auto host_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); diff --git a/catch/performance/memcpy/hipMemcpyFromSymbol.cc b/catch/performance/memcpy/hipMemcpyFromSymbol.cc index 15180730a..f09ff96f8 100644 --- a/catch/performance/memcpy/hipMemcpyFromSymbol.cc +++ b/catch/performance/memcpy/hipMemcpyFromSymbol.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" #pragma clang diagnostic ignored "-Wvla-extension" @@ -57,7 +44,7 @@ static void RunBenchmark(const void* source, void* result, size_t size = 1, size * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyFromSymbol_SingularValue") { +TEST_CASE(Performance_hipMemcpyFromSymbol_SingularValue) { int set{42}; int result{0}; RunBenchmark(&set, &result); @@ -78,7 +65,7 @@ TEST_CASE("Performance_hipMemcpyFromSymbol_SingularValue") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyFromSymbol_ArrayValue") { +TEST_CASE(Performance_hipMemcpyFromSymbol_ArrayValue) { size_t size = GENERATE(1_KB, 4_KB, 512_KB); std::vector array(size); std::fill_n(array.data(), size, 42); @@ -104,7 +91,7 @@ TEST_CASE("Performance_hipMemcpyFromSymbol_ArrayValue") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyFromSymbol_WithOffset") { +TEST_CASE(Performance_hipMemcpyFromSymbol_WithOffset) { size_t size = GENERATE(1_KB, 4_KB, 512_KB); std::vector array(size); std::fill_n(array.data(), size, 42); diff --git a/catch/performance/memcpy/hipMemcpyFromSymbolAsync.cc b/catch/performance/memcpy/hipMemcpyFromSymbolAsync.cc index f19863f8a..957bd7aa1 100644 --- a/catch/performance/memcpy/hipMemcpyFromSymbolAsync.cc +++ b/catch/performance/memcpy/hipMemcpyFromSymbolAsync.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" #pragma clang diagnostic ignored "-Wvla-extension" @@ -64,7 +51,7 @@ static void RunBenchmark(const void* source, void* result, size_t size = 1, size * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyFromSymbolAsync_SingularValue") { +TEST_CASE(Performance_hipMemcpyFromSymbolAsync_SingularValue) { int set{42}; int result{0}; RunBenchmark(&set, &result); @@ -85,7 +72,7 @@ TEST_CASE("Performance_hipMemcpyFromSymbolAsync_SingularValue") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyFromSymbolAsync_ArrayValue") { +TEST_CASE(Performance_hipMemcpyFromSymbolAsync_ArrayValue) { size_t size = GENERATE(1_KB, 4_KB, 512_KB); std::vector array(size); std::fill_n(array.data(), size, 42); @@ -111,7 +98,7 @@ TEST_CASE("Performance_hipMemcpyFromSymbolAsync_ArrayValue") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyFromSymbolAsync_WithOffset") { +TEST_CASE(Performance_hipMemcpyFromSymbolAsync_WithOffset) { size_t size = GENERATE(1_KB, 4_KB, 512_KB); std::vector array(size); std::fill_n(array.data(), size, 42); diff --git a/catch/performance/memcpy/hipMemcpyHtoA.cc b/catch/performance/memcpy/hipMemcpyHtoA.cc index 5c2d0c942..4397ec281 100644 --- a/catch/performance/memcpy/hipMemcpyHtoA.cc +++ b/catch/performance/memcpy/hipMemcpyHtoA.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -60,7 +47,7 @@ static void RunBenchmark(LinearAllocs host_allocation_type, size_t width) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyHtoA") { +TEST_CASE(Performance_hipMemcpyHtoA) { CHECK_IMAGE_SUPPORT const auto allocation_size = GENERATE(512, 1024, 4096); diff --git a/catch/performance/memcpy/hipMemcpyHtoD.cc b/catch/performance/memcpy/hipMemcpyHtoD.cc index 17f194f08..d15f6a488 100644 --- a/catch/performance/memcpy/hipMemcpyHtoD.cc +++ b/catch/performance/memcpy/hipMemcpyHtoD.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -62,7 +49,7 @@ static void RunBenchmark(LinearAllocs host_allocation_type, LinearAllocs device_ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyHtoD") { +TEST_CASE(Performance_hipMemcpyHtoD) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto device_allocation_type = LinearAllocs::hipMalloc; const auto host_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); diff --git a/catch/performance/memcpy/hipMemcpyHtoDAsync.cc b/catch/performance/memcpy/hipMemcpyHtoDAsync.cc index c8cffa607..2a56a2d2e 100644 --- a/catch/performance/memcpy/hipMemcpyHtoDAsync.cc +++ b/catch/performance/memcpy/hipMemcpyHtoDAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -67,7 +54,7 @@ static void RunBenchmark(LinearAllocs host_allocation_type, LinearAllocs device_ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyHtoDAsync") { +TEST_CASE(Performance_hipMemcpyHtoDAsync) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto device_allocation_type = LinearAllocs::hipMalloc; const auto host_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); diff --git a/catch/performance/memcpy/hipMemcpyParam2D.cc b/catch/performance/memcpy/hipMemcpyParam2D.cc index b7e889e3d..a4362c0ed 100644 --- a/catch/performance/memcpy/hipMemcpyParam2D.cc +++ b/catch/performance/memcpy/hipMemcpyParam2D.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -92,7 +79,7 @@ static void RunBenchmark(size_t width, size_t height, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2D_DeviceToHost") { +TEST_CASE(Performance_hipMemcpyParam2D_DeviceToHost) { const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyDeviceToHost); } @@ -113,7 +100,7 @@ TEST_CASE("Performance_hipMemcpyParam2D_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2D_HostToDevice") { +TEST_CASE(Performance_hipMemcpyParam2D_HostToDevice) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyHostToDevice); @@ -135,7 +122,7 @@ TEST_CASE("Performance_hipMemcpyParam2D_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2D_HostToHost") { +TEST_CASE(Performance_hipMemcpyParam2D_HostToHost) { const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyHostToHost); } @@ -156,7 +143,7 @@ TEST_CASE("Performance_hipMemcpyParam2D_HostToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2D_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpyParam2D_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyDeviceToDevice); @@ -179,7 +166,7 @@ TEST_CASE("Performance_hipMemcpyParam2D_DeviceToDevice_DisablePeerAccess") { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2D_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpyParam2D_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); diff --git a/catch/performance/memcpy/hipMemcpyParam2DAsync.cc b/catch/performance/memcpy/hipMemcpyParam2DAsync.cc index f127db397..51fc136ed 100644 --- a/catch/performance/memcpy/hipMemcpyParam2DAsync.cc +++ b/catch/performance/memcpy/hipMemcpyParam2DAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -96,7 +83,7 @@ static void RunBenchmark(size_t width, size_t height, hipMemcpyKind kind, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2DAsync_DeviceToHost") { +TEST_CASE(Performance_hipMemcpyParam2DAsync_DeviceToHost) { const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyDeviceToHost); } @@ -117,7 +104,7 @@ TEST_CASE("Performance_hipMemcpyParam2DAsync_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2DAsync_HostToDevice") { +TEST_CASE(Performance_hipMemcpyParam2DAsync_HostToDevice) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyHostToDevice); @@ -139,7 +126,7 @@ TEST_CASE("Performance_hipMemcpyParam2DAsync_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2DAsync_HostToHost") { +TEST_CASE(Performance_hipMemcpyParam2DAsync_HostToHost) { const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyHostToHost); } @@ -160,7 +147,7 @@ TEST_CASE("Performance_hipMemcpyParam2DAsync_HostToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2DAsync_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpyParam2DAsync_DeviceToDevice_DisablePeerAccess) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32, hipMemcpyDeviceToDevice); @@ -183,7 +170,7 @@ TEST_CASE("Performance_hipMemcpyParam2DAsync_DeviceToDevice_DisablePeerAccess") * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyParam2DAsync_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpyParam2DAsync_DeviceToDevice_EnablePeerAccess) { CHECK_IMAGE_SUPPORT if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); diff --git a/catch/performance/memcpy/hipMemcpyToSymbol.cc b/catch/performance/memcpy/hipMemcpyToSymbol.cc index 9159f91a8..3bcfc229c 100644 --- a/catch/performance/memcpy/hipMemcpyToSymbol.cc +++ b/catch/performance/memcpy/hipMemcpyToSymbol.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" #pragma clang diagnostic ignored "-Wvla-extension" @@ -55,7 +42,7 @@ static void RunBenchmark(const void* source, size_t size = 1, size_t offset = 0) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyToSymbol_SingularValue") { +TEST_CASE(Performance_hipMemcpyToSymbol_SingularValue) { int set{42}; RunBenchmark(&set); } @@ -75,7 +62,7 @@ TEST_CASE("Performance_hipMemcpyToSymbol_SingularValue") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyToSymbol_ArrayValue") { +TEST_CASE(Performance_hipMemcpyToSymbol_ArrayValue) { size_t size = GENERATE(1_KB, 4_KB, 1_MB); std::vector array(size); std::fill_n(array.data(), size, 42); @@ -99,7 +86,7 @@ TEST_CASE("Performance_hipMemcpyToSymbol_ArrayValue") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyToSymbol_WithOffset") { +TEST_CASE(Performance_hipMemcpyToSymbol_WithOffset) { size_t size = GENERATE(1_KB, 4_KB, 1_MB); std::vector array(size); std::fill_n(array.data(), size, 42); diff --git a/catch/performance/memcpy/hipMemcpyToSymbolAsync.cc b/catch/performance/memcpy/hipMemcpyToSymbolAsync.cc index e9496a5be..47e3e4874 100644 --- a/catch/performance/memcpy/hipMemcpyToSymbolAsync.cc +++ b/catch/performance/memcpy/hipMemcpyToSymbolAsync.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" #pragma clang diagnostic ignored "-Wvla-extension" @@ -62,7 +49,7 @@ static void RunBenchmark(const void* source, size_t size = 1, size_t offset = 0) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyToSymbolAsync_SingularValue") { +TEST_CASE(Performance_hipMemcpyToSymbolAsync_SingularValue) { int set{42}; RunBenchmark(&set); } @@ -82,7 +69,7 @@ TEST_CASE("Performance_hipMemcpyToSymbolAsync_SingularValue") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyToSymbolAsync_ArrayValue") { +TEST_CASE(Performance_hipMemcpyToSymbolAsync_ArrayValue) { size_t size = GENERATE(1_KB, 4_KB, 1_MB); std::vector array(size); std::fill_n(array.data(), size, 42); @@ -106,7 +93,7 @@ TEST_CASE("Performance_hipMemcpyToSymbolAsync_ArrayValue") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyToSymbolAsync_WithOffset") { +TEST_CASE(Performance_hipMemcpyToSymbolAsync_WithOffset) { size_t size = GENERATE(1_KB, 4_KB, 1_MB); std::vector array(size); std::fill_n(array.data(), size, 42); diff --git a/catch/performance/memcpy/hipMemcpyWithKernel.cc b/catch/performance/memcpy/hipMemcpyWithKernel.cc index 82cc661d4..a0b488faa 100644 --- a/catch/performance/memcpy/hipMemcpyWithKernel.cc +++ b/catch/performance/memcpy/hipMemcpyWithKernel.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "memcpy_performance_common.hh" /** * @addtogroup memcpy memcpy @@ -104,7 +92,7 @@ template static void RunBenchmark(LinearAllocs host_all * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyHtoDKernelDtoHV1Async") { +TEST_CASE(Performance_hipMemcpyHtoDKernelDtoHV1Async) { const auto allocation_size = GENERATE(16, 128, 1_KB, 4_KB, 16_KB, 256_KB, 512_KB, 1_MB, 4_MB, 16_MB, 128_MB); const auto device_allocation_type = LinearAllocs::hipMalloc; @@ -112,7 +100,7 @@ TEST_CASE("Performance_hipMemcpyHtoDKernelDtoHV1Async") { RunBenchmark(host_allocation_type, device_allocation_type, allocation_size); } -TEST_CASE("Performance_hipMemcpyHtoDKernelDtoHV2Async") { +TEST_CASE(Performance_hipMemcpyHtoDKernelDtoHV2Async) { const auto allocation_size = GENERATE(16, 128, 1_KB, 4_KB, 16_KB, 256_KB, 512_KB, 1_MB, 4_MB, 16_MB, 128_MB); const auto device_allocation_type = LinearAllocs::hipMalloc; diff --git a/catch/performance/memcpy/hipMemcpyWithStream.cc b/catch/performance/memcpy/hipMemcpyWithStream.cc index e382266ad..445e81410 100644 --- a/catch/performance/memcpy/hipMemcpyWithStream.cc +++ b/catch/performance/memcpy/hipMemcpyWithStream.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy_performance_common.hh" @@ -79,7 +66,7 @@ static void RunBenchmark(LinearAllocs dst_allocation_type, LinearAllocs src_allo * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyWithStream_DeviceToHost") { +TEST_CASE(Performance_hipMemcpyWithStream_DeviceToHost) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = LinearAllocs::hipMalloc; const auto dst_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); @@ -104,7 +91,7 @@ TEST_CASE("Performance_hipMemcpyWithStream_DeviceToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyWithStream_HostToDevice") { +TEST_CASE(Performance_hipMemcpyWithStream_HostToDevice) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); const auto dst_allocation_type = LinearAllocs::hipMalloc; @@ -129,7 +116,7 @@ TEST_CASE("Performance_hipMemcpyWithStream_HostToDevice") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyWithStream_HostToHost") { +TEST_CASE(Performance_hipMemcpyWithStream_HostToHost) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); const auto dst_allocation_type = GENERATE(LinearAllocs::malloc, LinearAllocs::hipHostMalloc); @@ -154,7 +141,7 @@ TEST_CASE("Performance_hipMemcpyWithStream_HostToHost") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyWithStream_DeviceToDevice_DisablePeerAccess") { +TEST_CASE(Performance_hipMemcpyWithStream_DeviceToDevice_DisablePeerAccess) { const auto allocation_size = GENERATE(4_KB, 4_MB, 16_MB); const auto src_allocation_type = LinearAllocs::hipMalloc; const auto dst_allocation_type = LinearAllocs::hipMalloc; @@ -181,7 +168,7 @@ TEST_CASE("Performance_hipMemcpyWithStream_DeviceToDevice_DisablePeerAccess") { * - Device supports Peer-to-Peer access * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemcpyWithStream_DeviceToDevice_EnablePeerAccess") { +TEST_CASE(Performance_hipMemcpyWithStream_DeviceToDevice_EnablePeerAccess) { if (HipTest::getDeviceCount() < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 GPUs. Skipping."); return; diff --git a/catch/performance/memcpy/memcpy_performance_common.hh b/catch/performance/memcpy/memcpy_performance_common.hh index 4abfbe37f..132beac8a 100644 --- a/catch/performance/memcpy/memcpy_performance_common.hh +++ b/catch/performance/memcpy/memcpy_performance_common.hh @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/performance/memset/CMakeLists.txt b/catch/performance/memset/CMakeLists.txt index ea27c5de1..cf6be181e 100644 --- a/catch/performance/memset/CMakeLists.txt +++ b/catch/performance/memset/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC hipMemset.cc diff --git a/catch/performance/memset/hipMemset.cc b/catch/performance/memset/hipMemset.cc index 04a1abfe1..e0832cc98 100644 --- a/catch/performance/memset/hipMemset.cc +++ b/catch/performance/memset/hipMemset.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -71,7 +55,7 @@ static void RunBenchmark(LinearAllocs allocation_type, size_t size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemset") { +TEST_CASE(Performance_hipMemset) { const auto size = GENERATE(4_KB, 4_MB, 16_MB); const auto allocation_type = GENERATE(LinearAllocs::hipMalloc, LinearAllocs::hipHostMalloc, LinearAllocs::hipMallocManaged); diff --git a/catch/performance/memset/hipMemset2D.cc b/catch/performance/memset/hipMemset2D.cc index b8b398dc7..a6a8f8324 100644 --- a/catch/performance/memset/hipMemset2D.cc +++ b/catch/performance/memset/hipMemset2D.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -65,7 +49,7 @@ static void RunBenchmark(size_t width, size_t height) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemset2D") { +TEST_CASE(Performance_hipMemset2D) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32); diff --git a/catch/performance/memset/hipMemset2DAsync.cc b/catch/performance/memset/hipMemset2DAsync.cc index fcaa23722..cf4cd2f51 100644 --- a/catch/performance/memset/hipMemset2DAsync.cc +++ b/catch/performance/memset/hipMemset2DAsync.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -69,7 +53,7 @@ static void RunBenchmark(size_t width, size_t height) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemset2DAsync") { +TEST_CASE(Performance_hipMemset2DAsync) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 32); diff --git a/catch/performance/memset/hipMemset3D.cc b/catch/performance/memset/hipMemset3D.cc index f04307f30..810d0488b 100644 --- a/catch/performance/memset/hipMemset3D.cc +++ b/catch/performance/memset/hipMemset3D.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -66,7 +50,7 @@ static void RunBenchmark(size_t width, size_t height, size_t depth) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemset3D") { +TEST_CASE(Performance_hipMemset3D) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 16, 4); diff --git a/catch/performance/memset/hipMemset3DAsync.cc b/catch/performance/memset/hipMemset3DAsync.cc index 93a4e390a..42425cd61 100644 --- a/catch/performance/memset/hipMemset3DAsync.cc +++ b/catch/performance/memset/hipMemset3DAsync.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -69,7 +53,7 @@ static void RunBenchmark(size_t width, size_t height, size_t depth) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemset3DAsync") { +TEST_CASE(Performance_hipMemset3DAsync) { CHECK_IMAGE_SUPPORT const auto width = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(width, 16, 4); diff --git a/catch/performance/memset/hipMemsetAsync.cc b/catch/performance/memset/hipMemsetAsync.cc index 9f05ff14f..c1d5ebd0d 100644 --- a/catch/performance/memset/hipMemsetAsync.cc +++ b/catch/performance/memset/hipMemsetAsync.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -74,7 +58,7 @@ static void RunBenchmark(LinearAllocs allocation_type, size_t size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemsetAsync") { +TEST_CASE(Performance_hipMemsetAsync) { const auto size = GENERATE(4_KB, 4_MB, 16_MB); const auto allocation_type = GENERATE(LinearAllocs::hipMalloc, LinearAllocs::hipHostMalloc, LinearAllocs::hipMallocManaged); diff --git a/catch/performance/memset/hipMemsetD16.cc b/catch/performance/memset/hipMemsetD16.cc index 8de462e48..3d45a15e3 100644 --- a/catch/performance/memset/hipMemsetD16.cc +++ b/catch/performance/memset/hipMemsetD16.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -72,7 +56,7 @@ static void RunBenchmark(LinearAllocs allocation_type, size_t size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemsetD16") { +TEST_CASE(Performance_hipMemsetD16) { const auto size = GENERATE(4_KB, 4_MB, 16_MB); const auto allocation_type = GENERATE(LinearAllocs::hipMalloc, LinearAllocs::hipHostMalloc, LinearAllocs::hipMallocManaged); diff --git a/catch/performance/memset/hipMemsetD16Async.cc b/catch/performance/memset/hipMemsetD16Async.cc index d3ad42fa5..a98048563 100644 --- a/catch/performance/memset/hipMemsetD16Async.cc +++ b/catch/performance/memset/hipMemsetD16Async.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -75,7 +59,7 @@ static void RunBenchmark(LinearAllocs allocation_type, size_t size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemsetD16Async") { +TEST_CASE(Performance_hipMemsetD16Async) { const auto size = GENERATE(4_KB, 4_MB, 16_MB); const auto allocation_type = GENERATE(LinearAllocs::hipMalloc, LinearAllocs::hipHostMalloc, LinearAllocs::hipMallocManaged); diff --git a/catch/performance/memset/hipMemsetD32.cc b/catch/performance/memset/hipMemsetD32.cc index fa9c1c95c..5a33132d1 100644 --- a/catch/performance/memset/hipMemsetD32.cc +++ b/catch/performance/memset/hipMemsetD32.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -72,7 +56,7 @@ static void RunBenchmark(LinearAllocs allocation_type, size_t size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemsetD32") { +TEST_CASE(Performance_hipMemsetD32) { const auto size = GENERATE(4_KB, 4_MB, 16_MB); const auto allocation_type = GENERATE(LinearAllocs::hipMalloc, LinearAllocs::hipHostMalloc, LinearAllocs::hipMallocManaged); diff --git a/catch/performance/memset/hipMemsetD32Async.cc b/catch/performance/memset/hipMemsetD32Async.cc index 5255d7c2d..05b2ae396 100644 --- a/catch/performance/memset/hipMemsetD32Async.cc +++ b/catch/performance/memset/hipMemsetD32Async.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -75,7 +59,7 @@ static void RunBenchmark(LinearAllocs allocation_type, size_t size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemsetD32Async") { +TEST_CASE(Performance_hipMemsetD32Async) { const auto size = GENERATE(4_KB, 4_MB, 16_MB); const auto allocation_type = GENERATE(LinearAllocs::hipMalloc, LinearAllocs::hipHostMalloc, LinearAllocs::hipMallocManaged); diff --git a/catch/performance/memset/hipMemsetD8.cc b/catch/performance/memset/hipMemsetD8.cc index f78195939..ce1b23e2e 100644 --- a/catch/performance/memset/hipMemsetD8.cc +++ b/catch/performance/memset/hipMemsetD8.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -72,7 +56,7 @@ static void RunBenchmark(LinearAllocs allocation_type, size_t size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemsetD8") { +TEST_CASE(Performance_hipMemsetD8) { const auto size = GENERATE(4_KB, 4_MB, 16_MB); const auto allocation_type = GENERATE(LinearAllocs::hipMalloc, LinearAllocs::hipHostMalloc, LinearAllocs::hipMallocManaged); diff --git a/catch/performance/memset/hipMemsetD8Async.cc b/catch/performance/memset/hipMemsetD8Async.cc index 7b8ef5b77..5d6906cc3 100644 --- a/catch/performance/memset/hipMemsetD8Async.cc +++ b/catch/performance/memset/hipMemsetD8Async.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -75,7 +59,7 @@ static void RunBenchmark(LinearAllocs allocation_type, size_t size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemsetD8Async") { +TEST_CASE(Performance_hipMemsetD8Async) { const auto size = GENERATE(4_KB, 4_MB, 16_MB); const auto allocation_type = GENERATE(LinearAllocs::hipMalloc, LinearAllocs::hipHostMalloc, LinearAllocs::hipMallocManaged); diff --git a/catch/performance/stream/CMakeLists.txt b/catch/performance/stream/CMakeLists.txt index ea6598af4..e43b42db3 100644 --- a/catch/performance/stream/CMakeLists.txt +++ b/catch/performance/stream/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT if(HIP_PLATFORM MATCHES "amd") set(TEST_SRC diff --git a/catch/performance/stream/hipExtStreamCreateWithCUMask.cc b/catch/performance/stream/hipExtStreamCreateWithCUMask.cc index 87b208d2a..77a5d75a6 100644 --- a/catch/performance/stream/hipExtStreamCreateWithCUMask.cc +++ b/catch/performance/stream/hipExtStreamCreateWithCUMask.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -60,7 +47,7 @@ static void RunBenchmark() { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipExtStreamCreateWithCUMask") { RunBenchmark(); } +TEST_CASE(Performance_hipExtStreamCreateWithCUMask) { RunBenchmark(); } /** * End doxygen group PerformanceTest. diff --git a/catch/performance/stream/hipExtStreamGetCUMask.cc b/catch/performance/stream/hipExtStreamGetCUMask.cc index 6c51eb152..d321d1608 100644 --- a/catch/performance/stream/hipExtStreamGetCUMask.cc +++ b/catch/performance/stream/hipExtStreamGetCUMask.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -62,7 +49,7 @@ static void RunBenchmark() { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipExtStreamGetCUMask") { RunBenchmark(); } +TEST_CASE(Performance_hipExtStreamGetCUMask) { RunBenchmark(); } /** * End doxygen group PerformanceTest. diff --git a/catch/performance/stream/hipFreeAsync.cc b/catch/performance/stream/hipFreeAsync.cc index 9c17c95ef..60ed79e13 100644 --- a/catch/performance/stream/hipFreeAsync.cc +++ b/catch/performance/stream/hipFreeAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -62,7 +49,7 @@ static void RunBenchmark(const size_t array_size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipFreeAsync") { +TEST_CASE(Performance_hipFreeAsync) { size_t array_size = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(array_size); } diff --git a/catch/performance/stream/hipMallocAsync.cc b/catch/performance/stream/hipMallocAsync.cc index d03ad3e22..7cfdd4fed 100644 --- a/catch/performance/stream/hipMallocAsync.cc +++ b/catch/performance/stream/hipMallocAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -63,7 +50,7 @@ static void RunBenchmark(const size_t array_size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMallocAsync") { +TEST_CASE(Performance_hipMallocAsync) { size_t array_size = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(array_size); } diff --git a/catch/performance/stream/hipMallocFromPoolAsync.cc b/catch/performance/stream/hipMallocFromPoolAsync.cc index b4fa00b18..e744d0324 100644 --- a/catch/performance/stream/hipMallocFromPoolAsync.cc +++ b/catch/performance/stream/hipMallocFromPoolAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -71,7 +58,7 @@ static void RunBenchmark(const size_t array_size) { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMallocFromPoolAsync") { +TEST_CASE(Performance_hipMallocFromPoolAsync) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolCreate.cc b/catch/performance/stream/hipMemPoolCreate.cc index 0254e1e35..a5d57748b 100644 --- a/catch/performance/stream/hipMemPoolCreate.cc +++ b/catch/performance/stream/hipMemPoolCreate.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -59,7 +46,7 @@ static void RunBenchmark() { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolCreate") { +TEST_CASE(Performance_hipMemPoolCreate) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolDestroy.cc b/catch/performance/stream/hipMemPoolDestroy.cc index 2e47f5f85..be63fbdec 100644 --- a/catch/performance/stream/hipMemPoolDestroy.cc +++ b/catch/performance/stream/hipMemPoolDestroy.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -58,7 +45,7 @@ static void RunBenchmark() { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolDestroy") { +TEST_CASE(Performance_hipMemPoolDestroy) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolExportPointer.cc b/catch/performance/stream/hipMemPoolExportPointer.cc index 359d04162..3d2074283 100644 --- a/catch/performance/stream/hipMemPoolExportPointer.cc +++ b/catch/performance/stream/hipMemPoolExportPointer.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -71,7 +58,7 @@ static void RunBenchmark(const size_t array_size) { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolExportPointer") { +TEST_CASE(Performance_hipMemPoolExportPointer) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolExportToShareableHandle.cc b/catch/performance/stream/hipMemPoolExportToShareableHandle.cc index f50dbc87d..3c0063f15 100644 --- a/catch/performance/stream/hipMemPoolExportToShareableHandle.cc +++ b/catch/performance/stream/hipMemPoolExportToShareableHandle.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -65,7 +52,7 @@ static void RunBenchmark() { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolExportToShareableHandle") { +TEST_CASE(Performance_hipMemPoolExportToShareableHandle) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolGetAccess.cc b/catch/performance/stream/hipMemPoolGetAccess.cc index db20d7819..b129bbec9 100644 --- a/catch/performance/stream/hipMemPoolGetAccess.cc +++ b/catch/performance/stream/hipMemPoolGetAccess.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -61,7 +48,7 @@ static void RunBenchmark() { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolGetAccess") { +TEST_CASE(Performance_hipMemPoolGetAccess) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolGetAttribute.cc b/catch/performance/stream/hipMemPoolGetAttribute.cc index 5dbfc1dad..ec4f6de5e 100644 --- a/catch/performance/stream/hipMemPoolGetAttribute.cc +++ b/catch/performance/stream/hipMemPoolGetAttribute.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -67,7 +54,7 @@ static void RunBenchmark(const hipMemPoolAttr attribute) { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolGetAttribute") { +TEST_CASE(Performance_hipMemPoolGetAttribute) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolImportFromShareableHandle.cc b/catch/performance/stream/hipMemPoolImportFromShareableHandle.cc index 13cf3a866..aee7b908c 100644 --- a/catch/performance/stream/hipMemPoolImportFromShareableHandle.cc +++ b/catch/performance/stream/hipMemPoolImportFromShareableHandle.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -73,7 +60,7 @@ static void RunBenchmark() { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolImportFromShareableHandle") { +TEST_CASE(Performance_hipMemPoolImportFromShareableHandle) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolImportPointer.cc b/catch/performance/stream/hipMemPoolImportPointer.cc index ff0568b0a..f6dea6b99 100644 --- a/catch/performance/stream/hipMemPoolImportPointer.cc +++ b/catch/performance/stream/hipMemPoolImportPointer.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -77,7 +64,7 @@ static void RunBenchmark(const size_t array_size) { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolImportPointer") { +TEST_CASE(Performance_hipMemPoolImportPointer) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolSetAccess.cc b/catch/performance/stream/hipMemPoolSetAccess.cc index a7414c199..0c0ed862b 100644 --- a/catch/performance/stream/hipMemPoolSetAccess.cc +++ b/catch/performance/stream/hipMemPoolSetAccess.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -61,7 +48,7 @@ static void RunBenchmark() { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolSetAccess") { +TEST_CASE(Performance_hipMemPoolSetAccess) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolSetAttribute.cc b/catch/performance/stream/hipMemPoolSetAttribute.cc index cca58da0e..4c60337aa 100644 --- a/catch/performance/stream/hipMemPoolSetAttribute.cc +++ b/catch/performance/stream/hipMemPoolSetAttribute.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -75,7 +62,7 @@ static void RunBenchmark(const hipMemPoolAttr attribute) { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolSetAttribute") { +TEST_CASE(Performance_hipMemPoolSetAttribute) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipMemPoolTrimTo.cc b/catch/performance/stream/hipMemPoolTrimTo.cc index 66fba5830..6d2d82fd9 100644 --- a/catch/performance/stream/hipMemPoolTrimTo.cc +++ b/catch/performance/stream/hipMemPoolTrimTo.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "mem_pools_performance_common.hh" @@ -64,7 +51,7 @@ static void RunBenchmark(const size_t min_bytes_to_hold) { * - Device supports memory pools * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipMemPoolTrimTo") { +TEST_CASE(Performance_hipMemPoolTrimTo) { if (!AreMemPoolsSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipDeviceAttributeMemoryPoolsSupported " diff --git a/catch/performance/stream/hipStreamAddCallback.cc b/catch/performance/stream/hipStreamAddCallback.cc index ff517f4fb..e7487cbaf 100644 --- a/catch/performance/stream/hipStreamAddCallback.cc +++ b/catch/performance/stream/hipStreamAddCallback.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -54,7 +41,7 @@ static void RunBenchmark() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamAddCallback") { RunBenchmark(); } +TEST_CASE(Performance_hipStreamAddCallback) { RunBenchmark(); } /** * End doxygen group PerformanceTest. diff --git a/catch/performance/stream/hipStreamBasic.cc b/catch/performance/stream/hipStreamBasic.cc index a9df57fb0..b344a5d86 100644 --- a/catch/performance/stream/hipStreamBasic.cc +++ b/catch/performance/stream/hipStreamBasic.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -148,7 +135,7 @@ class HipStreamCreateWithFlagsBenchmark : public Benchmark= 5.2 */ -TEST_CASE("Performance_hipStreamCreate") { +TEST_CASE(Performance_hipStreamCreate) { HipStreamCreateBenchmark benchmark; benchmark.Run(); } @@ -179,7 +166,7 @@ static void RunBenchmarkWithPriority(unsigned flag) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamCreateWithFlags") { +TEST_CASE(Performance_hipStreamCreateWithFlags) { const auto flag = GENERATE(hipStreamDefault, hipStreamNonBlocking); RunBenchmark(flag); } @@ -198,7 +185,7 @@ TEST_CASE("Performance_hipStreamCreateWithFlags") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamCreateWithPriority") { +TEST_CASE(Performance_hipStreamCreateWithPriority) { const auto flag = GENERATE(hipStreamDefault, hipStreamNonBlocking); RunBenchmarkWithPriority(flag); } @@ -214,7 +201,7 @@ TEST_CASE("Performance_hipStreamCreateWithPriority") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamDestroy") { +TEST_CASE(Performance_hipStreamDestroy) { HipStreamDestroyBenchmark benchmark; benchmark.Run(); } @@ -230,7 +217,7 @@ TEST_CASE("Performance_hipStreamDestroy") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipDeviceGetStreamPriorityRange") { +TEST_CASE(Performance_hipDeviceGetStreamPriorityRange) { HipDeviceGetStreamPriorityRangeBenchmark benchmark; benchmark.Run(); } @@ -246,7 +233,7 @@ TEST_CASE("Performance_hipDeviceGetStreamPriorityRange") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamQuery") { +TEST_CASE(Performance_hipStreamQuery) { const auto perform_work = GENERATE(true, false); HipStreamQueryBenchmark benchmark; if (perform_work) { @@ -268,7 +255,7 @@ TEST_CASE("Performance_hipStreamQuery") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamSynchronize") { +TEST_CASE(Performance_hipStreamSynchronize) { HipStreamSynchronizeBenchmark benchmark; benchmark.Run(); } diff --git a/catch/performance/stream/hipStreamGetFlags.cc b/catch/performance/stream/hipStreamGetFlags.cc index ef7e5a15e..c9335f37b 100644 --- a/catch/performance/stream/hipStreamGetFlags.cc +++ b/catch/performance/stream/hipStreamGetFlags.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -67,7 +54,7 @@ static void RunBenchmark(unsigned int expected_flag) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamGetFlags") { +TEST_CASE(Performance_hipStreamGetFlags) { unsigned int expected_flag = GENERATE(hipStreamDefault, hipStreamNonBlocking); RunBenchmark(expected_flag); } diff --git a/catch/performance/stream/hipStreamGetPriority.cc b/catch/performance/stream/hipStreamGetPriority.cc index def4b7c78..23cee0273 100644 --- a/catch/performance/stream/hipStreamGetPriority.cc +++ b/catch/performance/stream/hipStreamGetPriority.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -66,7 +53,7 @@ static void RunBenchmark(Streams stream_type) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamGetPriority") { +TEST_CASE(Performance_hipStreamGetPriority) { Streams stream_type = GENERATE(Streams::nullstream, Streams::created); RunBenchmark(stream_type); } diff --git a/catch/performance/stream/hipStreamWaitEvent.cc b/catch/performance/stream/hipStreamWaitEvent.cc index 24d6c281e..f9b298d5d 100644 --- a/catch/performance/stream/hipStreamWaitEvent.cc +++ b/catch/performance/stream/hipStreamWaitEvent.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -74,7 +61,7 @@ static void RunBenchmark(Streams stream_type) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamWaitEvent") { +TEST_CASE(Performance_hipStreamWaitEvent) { Streams stream_type = GENERATE(Streams::nullstream, Streams::created); RunBenchmark(stream_type); } diff --git a/catch/performance/stream/hipStreamWaitValue.cc b/catch/performance/stream/hipStreamWaitValue.cc index d9eb51537..5f752b6e3 100644 --- a/catch/performance/stream/hipStreamWaitValue.cc +++ b/catch/performance/stream/hipStreamWaitValue.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -121,7 +108,7 @@ static void RunBenchmark(const size_t array_size, unsigned int flag) { * - Device supports Stream Wait Value operations * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamWaitValue32") { +TEST_CASE(Performance_hipStreamWaitValue32) { #if HT_AMD if (!IsStreamWaitValueSupported(0)) { HipTest::HIP_SKIP_TEST( @@ -158,7 +145,7 @@ TEST_CASE("Performance_hipStreamWaitValue32") { * - Device supports Stream Wait Value operations * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamWaitValue64") { +TEST_CASE(Performance_hipStreamWaitValue64) { if (!IsStreamWaitValueSupported(0)) { HipTest::HIP_SKIP_TEST( "GPU 0 doesn't support hipStreamWaitValue64() function. " diff --git a/catch/performance/stream/hipStreamWriteValue.cc b/catch/performance/stream/hipStreamWriteValue.cc index 191226fc6..9f922c05b 100644 --- a/catch/performance/stream/hipStreamWriteValue.cc +++ b/catch/performance/stream/hipStreamWriteValue.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -87,7 +74,7 @@ template static void RunBenchmark(const size_t ar * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamWriteValue32") { +TEST_CASE(Performance_hipStreamWriteValue32) { #if HT_AMD size_t array_size = GENERATE(4_KB, 4_MB, 16_MB); RunBenchmark(array_size); @@ -109,7 +96,7 @@ TEST_CASE("Performance_hipStreamWriteValue32") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Performance_hipStreamWriteValue64") { +TEST_CASE(Performance_hipStreamWriteValue64) { #if HT_NVIDIA if (!IsStreamWriteValueSupported(0)) { HipTest::HIP_SKIP_TEST( diff --git a/catch/performance/stream/mem_pools_performance_common.hh b/catch/performance/stream/mem_pools_performance_common.hh index da40053a7..904100e7f 100644 --- a/catch/performance/stream/mem_pools_performance_common.hh +++ b/catch/performance/stream/mem_pools_performance_common.hh @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/performance/warpSync/CMakeLists.txt b/catch/performance/warpSync/CMakeLists.txt index 095f27c4f..db3359b10 100644 --- a/catch/performance/warpSync/CMakeLists.txt +++ b/catch/performance/warpSync/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # As CUDA use 32-bit sync masks and not 64-bit this has been disabled on Nvidia if(HIP_PLATFORM MATCHES "amd") diff --git a/catch/performance/warpSync/warpSync.cc b/catch/performance/warpSync/warpSync.cc index ac75a9a6d..4f7ce32f1 100644 --- a/catch/performance/warpSync/warpSync.cc +++ b/catch/performance/warpSync/warpSync.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #define HIP_ENABLE_WARP_SYNC_BUILTINS #define HIP_ENABLE_EXTRA_WARP_SYNC_TYPES @@ -326,42 +314,42 @@ template class Op> struct ReduceBenchmark { } }; -TEMPLATE_TEST_CASE("Performance_Reduce_Sync_Add", "", int, unsigned int, unsigned long long, +TEMPLATE_TEST_CASE(Performance_Reduce_Sync_Add, int, unsigned int, unsigned long long, long long, float, half, double) { ReduceBenchmark benchmark; benchmark.Run(); } -TEMPLATE_TEST_CASE("Performance_Reduce_Sync_Min", "", int, unsigned int, unsigned long long, +TEMPLATE_TEST_CASE(Performance_Reduce_Sync_Min, int, unsigned int, unsigned long long, long long, float, half, double) { ReduceBenchmark benchmark; benchmark.Run(); } -TEMPLATE_TEST_CASE("Performance_Reduce_Sync_Max", "", int, unsigned int, unsigned long long, +TEMPLATE_TEST_CASE(Performance_Reduce_Sync_Max, int, unsigned int, unsigned long long, long long, float, half, double) { ReduceBenchmark benchmark; benchmark.Run(); } -TEMPLATE_TEST_CASE("Performance_Reduce_Sync_And", "", int, unsigned int, unsigned long long, +TEMPLATE_TEST_CASE(Performance_Reduce_Sync_And, int, unsigned int, unsigned long long, long long) { ReduceBenchmark benchmark; benchmark.Run(); } -TEMPLATE_TEST_CASE("Performance_Reduce_Sync_Or", "", int, unsigned int, unsigned long long, +TEMPLATE_TEST_CASE(Performance_Reduce_Sync_Or, int, unsigned int, unsigned long long, long long) { ReduceBenchmark benchmark; benchmark.Run(); } -TEMPLATE_TEST_CASE("Performance_Reduce_Sync_Xor", "", int, unsigned int, unsigned long long, +TEMPLATE_TEST_CASE(Performance_Reduce_Sync_Xor, int, unsigned int, unsigned long long, long long) { ReduceBenchmark benchmark; diff --git a/catch/perftests/CMakeLists.txt b/catch/perftests/CMakeLists.txt index a6e4ecd91..4f7600f53 100644 --- a/catch/perftests/CMakeLists.txt +++ b/catch/perftests/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT add_custom_target(perf_test COMMAND "${CMAKE_CTEST_COMMAND}" -R "Perf_" COMMENT "Build complete, now executing the performnce test ...") diff --git a/catch/perftests/compute/CMakeLists.txt b/catch/perftests/compute/CMakeLists.txt index 4844b92c9..cc317a9ef 100644 --- a/catch/perftests/compute/CMakeLists.txt +++ b/catch/perftests/compute/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(TEST_SRC diff --git a/catch/perftests/compute/hipPerfDotProduct.cc b/catch/perftests/compute/hipPerfDotProduct.cc index 4228cda14..16409c2f7 100644 --- a/catch/perftests/compute/hipPerfDotProduct.cc +++ b/catch/perftests/compute/hipPerfDotProduct.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -230,7 +217,7 @@ void computeDotProduct(int n, const double* x, const double* y, double& result, * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfDotProduct") { +TEST_CASE(Perf_hipPerfDotProduct) { int nGpu = 0; int p_gpuDevice = 0; HIP_CHECK(hipGetDeviceCount(&nGpu)); diff --git a/catch/perftests/compute/hipPerfMandelbrot.cc b/catch/perftests/compute/hipPerfMandelbrot.cc index 5e2c55f94..38becd1d8 100644 --- a/catch/perftests/compute/hipPerfMandelbrot.cc +++ b/catch/perftests/compute/hipPerfMandelbrot.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -599,7 +586,7 @@ void hipPerfMandelBrot::checkData(uint* ptr) { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfMandelbrot") { +TEST_CASE(Perf_hipPerfMandelbrot) { hipPerfMandelBrot mandelbrotCompute; int deviceId = 0; mandelbrotCompute.open(deviceId); diff --git a/catch/perftests/dispatch/CMakeLists.txt b/catch/perftests/dispatch/CMakeLists.txt index 490b621ba..9a44d3ef1 100644 --- a/catch/perftests/dispatch/CMakeLists.txt +++ b/catch/perftests/dispatch/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(TEST_SRC diff --git a/catch/perftests/dispatch/hipPerfDispatchSpeed.cc b/catch/perftests/dispatch/hipPerfDispatchSpeed.cc index 8e40197b2..103b96005 100644 --- a/catch/perftests/dispatch/hipPerfDispatchSpeed.cc +++ b/catch/perftests/dispatch/hipPerfDispatchSpeed.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -60,7 +47,7 @@ __global__ void _TimingKernel(uint64_t count) { enum TimingMode { TimingMode_WallTime, TimingMode_HIPEvent, TimingMode_NumModes }; -TEST_CASE("Perf_hipPerfDispatchAndExecutionSpeed") { +TEST_CASE(Perf_hipPerfDispatchAndExecutionSpeed) { hipError_t err = hipSuccess; unsigned int testListSize = sizeof(testList) / sizeof(testList[0]); diff --git a/catch/perftests/event/CMakeLists.txt b/catch/perftests/event/CMakeLists.txt index a6566f3a1..b6a6e0020 100644 --- a/catch/perftests/event/CMakeLists.txt +++ b/catch/perftests/event/CMakeLists.txt @@ -1,20 +1,7 @@ -# Copyright (c) 2025 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. -# Common Tests - Test independent of all platforms +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + set(TEST_SRC hipKernelLookUpPerf.cc hipEventOverFlowPerf.cc diff --git a/catch/perftests/event/hipEventOverFlowPerf.cc b/catch/perftests/event/hipEventOverFlowPerf.cc index 3c87190e4..0f52dc325 100644 --- a/catch/perftests/event/hipEventOverFlowPerf.cc +++ b/catch/perftests/event/hipEventOverFlowPerf.cc @@ -1,20 +1,9 @@ -/*Copyright (c) 2025 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -102,7 +91,7 @@ void thread_job(int dev, int virt) { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipEventOverFlow_PerfTest") { +TEST_CASE(Unit_hipEventOverFlow_PerfTest) { int mgpu = 0; HIP_CHECK_PERF(hipGetDeviceCount(&mgpu)); stream_pool.resize(mgpu); diff --git a/catch/perftests/event/hipKernelLookUpPerf.cc b/catch/perftests/event/hipKernelLookUpPerf.cc index 220904aed..bda1a213a 100644 --- a/catch/perftests/event/hipKernelLookUpPerf.cc +++ b/catch/perftests/event/hipKernelLookUpPerf.cc @@ -1,20 +1,9 @@ -/*Copyright (c) 2025 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -75,7 +64,7 @@ void thread_jobs(int dev, int virt) { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipKernelLookUp_PerfTest") { +TEST_CASE(Unit_hipKernelLookUp_PerfTest) { int mgpu = 0; HIP_CHECK_PERF(hipGetDeviceCount(&mgpu)); stream_pools.resize(mgpu); diff --git a/catch/perftests/graph/CMakeLists.txt b/catch/perftests/graph/CMakeLists.txt index dd2d395b9..0807d6490 100644 --- a/catch/perftests/graph/CMakeLists.txt +++ b/catch/perftests/graph/CMakeLists.txt @@ -1,19 +1,6 @@ -# Copyright (c) 2024 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. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(TEST_SRC diff --git a/catch/perftests/graph/hipGraphTopology.cc b/catch/perftests/graph/hipGraphTopology.cc index f557167f2..82e3b68fa 100644 --- a/catch/perftests/graph/hipGraphTopology.cc +++ b/catch/perftests/graph/hipGraphTopology.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -193,7 +180,7 @@ static void run_graph_topology_test(const TestOptions& opt) { int kernel_count = 0; int current_batch_size = 0; - int batch_number = 0; + [[maybe_unused]] int batch_number = 0; for (int i = 0; i < opt.length; ++i) { std::string node_type; @@ -431,7 +418,7 @@ static void run_graph_topology_test(const TestOptions& opt) { /** * Test straight topology graph performance */ -TEST_CASE("Perf_GraphTopology_Straight") { +TEST_CASE(Perf_GraphTopology_Straight) { TestOptions opt; opt.topology = "straight"; opt.length = 50; @@ -443,7 +430,7 @@ TEST_CASE("Perf_GraphTopology_Straight") { /** * Test parallel topology graph performance */ -TEST_CASE("Perf_GraphTopology_Parallel") { +TEST_CASE(Perf_GraphTopology_Parallel) { TestOptions opt; opt.topology = "parallel"; opt.length = 25; @@ -456,7 +443,7 @@ TEST_CASE("Perf_GraphTopology_Parallel") { /** * Test hexagon topology graph performance */ -TEST_CASE("Perf_GraphTopology_Hexagon") { +TEST_CASE(Perf_GraphTopology_Hexagon) { TestOptions opt; opt.topology = "hexagon"; opt.straight_nodes = 20; @@ -469,7 +456,7 @@ TEST_CASE("Perf_GraphTopology_Hexagon") { /** * Test mixed topology graph performance */ -TEST_CASE("Perf_GraphTopology_Mixed") { +TEST_CASE(Perf_GraphTopology_Mixed) { TestOptions opt; opt.topology = "mixed"; opt.length = 27; // 3 cycles of 9-step pattern diff --git a/catch/perftests/graph/hipPerfGraphLaunch.cc b/catch/perftests/graph/hipPerfGraphLaunch.cc index d564fe132..925268097 100644 --- a/catch/perftests/graph/hipPerfGraphLaunch.cc +++ b/catch/perftests/graph/hipPerfGraphLaunch.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -90,7 +77,7 @@ static __global__ void addKernel(int* arr1, int* arr2, int size) { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Perf_GraphWithMoreAllocFreeNodes_SingleBranchNoOperations") { +TEST_CASE(Perf_GraphWithMoreAllocFreeNodes_SingleBranchNoOperations) { constexpr int numberOfNodes = 1024; int* devMem[numberOfNodes]; @@ -214,7 +201,7 @@ TEST_CASE("Perf_GraphWithMoreAllocFreeNodes_SingleBranchNoOperations") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Perf_GraphWithMoreAllocFreeNodes_SerialNodesSingleBranchWithOps") { +TEST_CASE(Perf_GraphWithMoreAllocFreeNodes_SerialNodesSingleBranchWithOps) { constexpr int SIZE = 100; char* dev[SIZE]; @@ -408,7 +395,7 @@ TEST_CASE("Perf_GraphWithMoreAllocFreeNodes_SerialNodesSingleBranchWithOps") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Perf_GraphWithMoreAllocFreeNodes_MultipleBranches") { +TEST_CASE(Perf_GraphWithMoreAllocFreeNodes_MultipleBranches) { constexpr int SIZE = 1024; constexpr size_t NBYTES = SIZE * sizeof(int); constexpr int BRANCHES = 10; @@ -595,7 +582,7 @@ TEST_CASE("Perf_GraphWithMoreAllocFreeNodes_MultipleBranches") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Perf_GraphWithMoreAllocFreeNodes_MultipleIndependentBranches") { +TEST_CASE(Perf_GraphWithMoreAllocFreeNodes_MultipleIndependentBranches) { constexpr int BRANCHES = 10; char* dev[BRANCHES]; @@ -742,7 +729,7 @@ TEST_CASE("Perf_GraphWithMoreAllocFreeNodes_MultipleIndependentBranches") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Perf_GraphWithMoreAllocFreeNodes_OneBranchNoOps_AutoFreeOnLaunch") { +TEST_CASE(Perf_GraphWithMoreAllocFreeNodes_OneBranchNoOps_AutoFreeOnLaunch) { constexpr int SIZE = 1024; int* devMem[SIZE]; diff --git a/catch/perftests/graph/parallelGraph.cc b/catch/perftests/graph/parallelGraph.cc index b0eb3128b..5ac12e4e3 100644 --- a/catch/perftests/graph/parallelGraph.cc +++ b/catch/perftests/graph/parallelGraph.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -59,7 +46,7 @@ template __global__ void vectorADD(const T* A_d, const T* B_d, T* C * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraph_Performance_Improvement_ParallelGraph") { +TEST_CASE(Unit_hipGraph_Performance_Improvement_ParallelGraph) { hipGraphNode_t memCpy1, memCpy2, memCpy3; std::vector kNode(kNumNode); hipGraph_t graph; @@ -135,7 +122,7 @@ TEST_CASE("Unit_hipGraph_Performance_Improvement_ParallelGraph") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraph_Performance_With_Stream_Operations") { +TEST_CASE(Unit_hipGraph_Performance_With_Stream_Operations) { unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); @@ -177,7 +164,7 @@ TEST_CASE("Unit_hipGraph_Performance_With_Stream_Operations") { * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraph_Performance_With_Stream_Capture") { +TEST_CASE(Unit_hipGraph_Performance_With_Stream_Capture) { unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); hipGraph_t graph; hipStream_t stream, streamForGraph; diff --git a/catch/perftests/memory/CMakeLists.txt b/catch/perftests/memory/CMakeLists.txt index 8773766de..d4f092ba7 100644 --- a/catch/perftests/memory/CMakeLists.txt +++ b/catch/perftests/memory/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC hipPerfMemcpy.cc diff --git a/catch/perftests/memory/FindNUMA.cmake b/catch/perftests/memory/FindNUMA.cmake index f16c06773..67de07d01 100644 --- a/catch/perftests/memory/FindNUMA.cmake +++ b/catch/perftests/memory/FindNUMA.cmake @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2021 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT find_path(NUMA_INCLUDE_DIR numa.h) find_library(NUMA_LIBRARIES numa) diff --git a/catch/perftests/memory/hipPerfBufferCopyInterGpuPerformance.cc b/catch/perftests/memory/hipPerfBufferCopyInterGpuPerformance.cc index c3f6ff433..a75e62e83 100644 --- a/catch/perftests/memory/hipPerfBufferCopyInterGpuPerformance.cc +++ b/catch/perftests/memory/hipPerfBufferCopyInterGpuPerformance.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpyAsync @@ -50,7 +37,7 @@ static constexpr int nIters = 10; // interation number for t * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Perf_PerfBufferCopySpeedAll2All_Inter_GPU") { +TEST_CASE(Perf_PerfBufferCopySpeedAll2All_Inter_GPU) { int nGpus = 0; HIP_CHECK(hipGetDeviceCount(&nGpus)); if (nGpus < 2) { diff --git a/catch/perftests/memory/hipPerfBufferCopyRectSpeed.cc b/catch/perftests/memory/hipPerfBufferCopyRectSpeed.cc index c9d77db5d..00d417f0c 100644 --- a/catch/perftests/memory/hipPerfBufferCopyRectSpeed.cc +++ b/catch/perftests/memory/hipPerfBufferCopyRectSpeed.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpy2DAsync hipMemcpy2DAsync @@ -207,16 +194,16 @@ static bool hipPerfBufferCopyRectSpeed_test(int p_tests) { /** * Test Description * ------------------------ - *  - Verify hipPerfBufferCopy status. + * - Verify hipPerfBufferCopy status. * Test source * ------------------------ - *  - perftests/memory/hipPerfBufferCopyRectSpeed.cc + * - perftests/memory/hipPerfBufferCopyRectSpeed.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfBufferCopyRectSpeed_test") { +TEST_CASE(Perf_hipPerfBufferCopyRectSpeed_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); diff --git a/catch/perftests/memory/hipPerfBufferCopySpeed.cc b/catch/perftests/memory/hipPerfBufferCopySpeed.cc index 7a7751f71..1d79bf090 100644 --- a/catch/perftests/memory/hipPerfBufferCopySpeed.cc +++ b/catch/perftests/memory/hipPerfBufferCopySpeed.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpyAsync hipMemcpyAsync @@ -373,16 +360,16 @@ static bool hipPerfBufferCopySpeed_test(int p_tests) { /** * Test Description * ------------------------ - *  - Verify hipPerfBufferCopySpeed status. + * - Verify hipPerfBufferCopySpeed status. * Test source * ------------------------ - *  - perftests/memory/hipPerfBufferCopySpeed.cc + * - perftests/memory/hipPerfBufferCopySpeed.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfBufferCopySpeed_test") { +TEST_CASE(Perf_hipPerfBufferCopySpeed_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); if (numDevices <= 0) { diff --git a/catch/perftests/memory/hipPerfBufferCopySpeedAll2All.cc b/catch/perftests/memory/hipPerfBufferCopySpeedAll2All.cc index 1d3a1708b..e0526acc8 100644 --- a/catch/perftests/memory/hipPerfBufferCopySpeedAll2All.cc +++ b/catch/perftests/memory/hipPerfBufferCopySpeedAll2All.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpyAsync @@ -267,7 +254,7 @@ static void testCopyPerf(bool toRemote, bool kernelCopy, bool onOneGpu) { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_PerfBufferCopySpeedAll2All_test - hipMemcpyPeerAsync - remotes to local") { +TEST_CASE(Perf_PerfBufferCopySpeedAll2All_test_hipMemcpyPeerAsync_remotes_to_local) { testCopyPerf(false, false, false); } @@ -286,7 +273,7 @@ TEST_CASE("Perf_PerfBufferCopySpeedAll2All_test - hipMemcpyPeerAsync - remotes t * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_PerfBufferCopySpeedAll2All_test - hipMemcpyPeerAsync - local to remotes") { +TEST_CASE(Perf_PerfBufferCopySpeedAll2All_test_hipMemcpyPeerAsync_local_to_remotes) { testCopyPerf(true, false, false); } @@ -307,7 +294,7 @@ TEST_CASE("Perf_PerfBufferCopySpeedAll2All_test - hipMemcpyPeerAsync - local to * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_PerfBufferCopySpeedAll2All_test - kernel copy - remotes to local") { +TEST_CASE(Perf_PerfBufferCopySpeedAll2All_test_kernel_copy_remotes_to_local) { testCopyPerf(false, true, false); } @@ -328,7 +315,7 @@ TEST_CASE("Perf_PerfBufferCopySpeedAll2All_test - kernel copy - remotes to local * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_PerfBufferCopySpeedAll2All_test - kernel copy - local to remotes") { +TEST_CASE(Perf_PerfBufferCopySpeedAll2All_test_kernel_copy_local_to_remotes) { testCopyPerf(true, true, false); } @@ -347,7 +334,7 @@ TEST_CASE("Perf_PerfBufferCopySpeedAll2All_test - kernel copy - local to remotes * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_PerfBufferCopySpeedAll2One_test - hipMemcpyPeerAsync - remotes to local") { +TEST_CASE(Perf_PerfBufferCopySpeedAll2One_test_hipMemcpyPeerAsync_remotes_to_local) { testCopyPerf(false, false, true); } @@ -366,7 +353,7 @@ TEST_CASE("Perf_PerfBufferCopySpeedAll2One_test - hipMemcpyPeerAsync - remotes t * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_PerfBufferCopySpeedOne2All_test - hipMemcpyPeerAsync - local to remotes") { +TEST_CASE(Perf_PerfBufferCopySpeedOne2All_test_hipMemcpyPeerAsync_local_to_remotes) { testCopyPerf(true, false, true); } @@ -385,7 +372,7 @@ TEST_CASE("Perf_PerfBufferCopySpeedOne2All_test - hipMemcpyPeerAsync - local to * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_PerfBufferCopySpeedAll2One_test - kernel copy - remotes to local") { +TEST_CASE(Perf_PerfBufferCopySpeedAll2One_test_kernel_copy_remotes_to_local) { testCopyPerf(false, true, true); } @@ -406,7 +393,7 @@ TEST_CASE("Perf_PerfBufferCopySpeedAll2One_test - kernel copy - remotes to local * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_PerfBufferCopySpeedOne2All_test - kernel copy - local to remotes") { +TEST_CASE(Perf_PerfBufferCopySpeedOne2All_test_kernel_copy_local_to_remotes) { testCopyPerf(true, true, true); } diff --git a/catch/perftests/memory/hipPerfBufferCopySpeedP2P.cc b/catch/perftests/memory/hipPerfBufferCopySpeedP2P.cc index 985abb114..85a4fe68d 100644 --- a/catch/perftests/memory/hipPerfBufferCopySpeedP2P.cc +++ b/catch/perftests/memory/hipPerfBufferCopySpeedP2P.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpyAsync @@ -444,25 +431,25 @@ static void testP2PBiDirMemPerf(const int iterations, const bool useHipMemcpyAsy /** * Test Description * ------------------------ - *  - Verify P2P uni-direction memcpy performance. + * - Verify P2P uni-direction memcpy performance. * To enable rocr kernel copying, export HSA_ENABLE_SDMA=0 * To enable SDMA copying, export HSA_ENABLE_SDMA=1 (by default) * To specify devices to be tested, export HIP_VISIBLE_DEVICES=gpuid0, gupid1,... * For example, to test first 2 devices, export HIP_VISIBLE_DEVICES=0,1 * Test source * ------------------------ - *  - perftests/memory/hipPerfBufferCopySpeedP2P.cc + * - perftests/memory/hipPerfBufferCopySpeedP2P.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 6.0 + * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_hipTestP2PUniDirMemcpyAsync_test - Timing CPU") { +TEST_CASE(Perf_hipTestP2PUniDirMemcpyAsync_test_Timing_CPU) { const int iterations = cmd_options.iterations == 1000 ? defaultIterations : cmd_options.iterations; testP2PUniDirMemPerf(iterations, TIMING_MODE_CPU, true); } -TEST_CASE("Perf_hipTestP2PUniDirMemcpyAsync_test - Timing GPU") { +TEST_CASE(Perf_hipTestP2PUniDirMemcpyAsync_test_Timing_GPU) { const int iterations = cmd_options.iterations == 1000 ? defaultIterations : cmd_options.iterations; testP2PUniDirMemPerf(iterations, TIMING_MODE_GPU, true); @@ -471,23 +458,23 @@ TEST_CASE("Perf_hipTestP2PUniDirMemcpyAsync_test - Timing GPU") { /** * Test Description * ------------------------ - *  - Verify P2P uni-direction kernel copy performance. + * - Verify P2P uni-direction kernel copy performance. * To specify devices to be tested, export HIP_VISIBLE_DEVICES=gpuid0, gupid1,... * For example, to test first 2 devices, export HIP_VISIBLE_DEVICES=0,1 * Test source * ------------------------ - *  - perftests/memory/hipPerfBufferCopySpeedP2P.cc + * - perftests/memory/hipPerfBufferCopySpeedP2P.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 6.0 + * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_hipTestP2PUniDirKernelCopy_test - Timing CPU") { +TEST_CASE(Perf_hipTestP2PUniDirKernelCopy_test_Timing_CPU) { const int iterations = cmd_options.iterations == 1000 ? defaultIterations : cmd_options.iterations; testP2PUniDirMemPerf(iterations, TIMING_MODE_CPU, false); } -TEST_CASE("Perf_hipTestP2PUniDirKernelCopy_test - Timing GPU") { +TEST_CASE(Perf_hipTestP2PUniDirKernelCopy_test_Timing_GPU) { const int iterations = cmd_options.iterations == 1000 ? defaultIterations : cmd_options.iterations; testP2PUniDirMemPerf(iterations, TIMING_MODE_GPU, false); @@ -496,19 +483,19 @@ TEST_CASE("Perf_hipTestP2PUniDirKernelCopy_test - Timing GPU") { /** * Test Description * ------------------------ - *  - Verify P2P bi-direction memcpy performance. + * - Verify P2P bi-direction memcpy performance. * To enable rocr kernel copying, export HSA_ENABLE_SDMA=0 * To enable SDMA copying, export HSA_ENABLE_SDMA=1 (by default) * To specify devices to be tested, export HIP_VISIBLE_DEVICES=gpuid0, gupid1,... * For example, to test first 2 devices, export HIP_VISIBLE_DEVICES=0,1 * Test source * ------------------------ - *  - perftests/memory/hipPerfBufferCopySpeedP2P.cc + * - perftests/memory/hipPerfBufferCopySpeedP2P.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 6.0 + * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_hipTestP2PBiDirMemcpyAsync_test") { +TEST_CASE(Perf_hipTestP2PBiDirMemcpyAsync_test) { const int iterations = cmd_options.iterations == 1000 ? defaultIterations : cmd_options.iterations; testP2PBiDirMemPerf(iterations, true); @@ -517,17 +504,17 @@ TEST_CASE("Perf_hipTestP2PBiDirMemcpyAsync_test") { /** * Test Description * ------------------------ - *  - Verify P2P bi-direction kernel copy performance. + * - Verify P2P bi-direction kernel copy performance. * To specify devices to be tested, export HIP_VISIBLE_DEVICES=gpuid0, gupid1,... * For example, to test first 2 devices, export HIP_VISIBLE_DEVICES=0,1 * Test source * ------------------------ - *  - perftests/memory/hipPerfBufferCopySpeedP2P.cc + * - perftests/memory/hipPerfBufferCopySpeedP2P.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 6.0 + * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_hipTestP2PBiDirKernelCopy_test") { +TEST_CASE(Perf_hipTestP2PBiDirKernelCopy_test) { const int iterations = cmd_options.iterations == 1000 ? defaultIterations : cmd_options.iterations; testP2PBiDirMemPerf(iterations, false); @@ -536,15 +523,15 @@ TEST_CASE("Perf_hipTestP2PBiDirKernelCopy_test") { /** * Test Description * ------------------------ - *  - Check support of peer to peer + * - Check support of peer to peer * Test source * ------------------------ - *  - perftests/memory/hipPerfBufferCopySpeedP2P.cc + * - perftests/memory/hipPerfBufferCopySpeedP2P.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 6.0 + * - HIP_VERSION >= 6.0 */ -TEST_CASE("Perf_hipCheckP2PSupport") { checkP2PSupport(); } +TEST_CASE(Perf_hipCheckP2PSupport) { checkP2PSupport(); } /** * End doxygen group perfMemoryTest. diff --git a/catch/perftests/memory/hipPerfDevMemReadSpeed.cc b/catch/perftests/memory/hipPerfDevMemReadSpeed.cc index 19663b46a..bb5a1f198 100644 --- a/catch/perftests/memory/hipPerfDevMemReadSpeed.cc +++ b/catch/perftests/memory/hipPerfDevMemReadSpeed.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpyKernel hipMemcpyKernel @@ -132,16 +119,16 @@ static bool hipPerfDevMemReadSpeed_test() { /** * Test Description * ------------------------ - *  - Verify hipPerfDevMemReadSpeed status. + * - Verify hipPerfDevMemReadSpeed status. * Test source * ------------------------ - *  - perftests/memory/hipPerfDevMemReadSpeed.cc + * - perftests/memory/hipPerfDevMemReadSpeed.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfDevMemReadSpeed_test") { +TEST_CASE(Perf_hipPerfDevMemReadSpeed_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); diff --git a/catch/perftests/memory/hipPerfDevMemWriteSpeed.cc b/catch/perftests/memory/hipPerfDevMemWriteSpeed.cc index e96b206c8..b75ecc07b 100644 --- a/catch/perftests/memory/hipPerfDevMemWriteSpeed.cc +++ b/catch/perftests/memory/hipPerfDevMemWriteSpeed.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpyKernel hipMemcpyKernel @@ -124,16 +111,16 @@ static bool hipPerfDevMemWriteSpeed_test() { /** * Test Description * ------------------------ - *  - Verify hipPerfDevMemWriteSpeed status. + * - Verify hipPerfDevMemWriteSpeed status. * Test source * ------------------------ - *  - perftests/memory/hipPerfDevMemWriteSpeed.cc + * - perftests/memory/hipPerfDevMemWriteSpeed.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfDevMemWriteSpeed_test") { +TEST_CASE(Perf_hipPerfDevMemWriteSpeed_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); diff --git a/catch/perftests/memory/hipPerfDeviceHeapMemory.cc b/catch/perftests/memory/hipPerfDeviceHeapMemory.cc index 3e87fef45..65abed9f9 100644 --- a/catch/perftests/memory/hipPerfDeviceHeapMemory.cc +++ b/catch/perftests/memory/hipPerfDeviceHeapMemory.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -62,7 +50,7 @@ __global__ void mallocTest_1() { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_Perf_Device_Heap_Memory_Allocation") { +TEST_CASE(Unit_Perf_Device_Heap_Memory_Allocation) { HIP_CHECK(hipDeviceSetLimit(hipLimitMallocHeapSize, 128 * 1024 * 1024)); hipEvent_t event; HIP_CHECK(hipEventCreate(&event)); diff --git a/catch/perftests/memory/hipPerfHostNumaAlloc.cc b/catch/perftests/memory/hipPerfHostNumaAlloc.cc index 1a7a1fdb2..22fb61a38 100644 --- a/catch/perftests/memory/hipPerfHostNumaAlloc.cc +++ b/catch/perftests/memory/hipPerfHostNumaAlloc.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpyKernel hipMemcpyKernel @@ -134,16 +121,16 @@ bool runTest(const int& cpuCount, const int& gpuCount, unsigned int hostMallocfl /** * Test Description * ------------------------ - *  - Verify hipPerfHostNumaAlloc status. + * - Verify hipPerfHostNumaAlloc status. * Test source * ------------------------ - *  - perftests/memory/hipPerfHostNumaAlloc.cc + * - perftests/memory/hipPerfHostNumaAlloc.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfHostNumaAlloc_test") { +TEST_CASE(Perf_hipPerfHostNumaAlloc_test) { int gpuCount = 0; HIP_CHECK(hipGetDeviceCount(&gpuCount)); int cpuCount = numa_max_node() + 1; // number of numa nodes diff --git a/catch/perftests/memory/hipPerfHostNumaAllocWin.cc b/catch/perftests/memory/hipPerfHostNumaAllocWin.cc index 12437c065..d15acdb9e 100644 --- a/catch/perftests/memory/hipPerfHostNumaAllocWin.cc +++ b/catch/perftests/memory/hipPerfHostNumaAllocWin.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipHostMalloc @@ -290,7 +277,7 @@ static void runTestPrefered(std::vector &nodes, MallocType type, u } /* Test memory allocation on preferred host numa node on each CPU */ -TEST_CASE("Perf_hipPerfHostNumaAlloc_test_preferred_host_numa_node_on_each_GPU") { +TEST_CASE(Perf_hipPerfHostNumaAlloc_test_preferred_host_numa_node_on_each_GPU) { std::vector nodes; enumerateNumaNodes(nodes); if (nodes.empty()) { diff --git a/catch/perftests/memory/hipPerfMemFill.cc b/catch/perftests/memory/hipPerfMemFill.cc index 32bfa622c..94d209f29 100644 --- a/catch/perftests/memory/hipPerfMemFill.cc +++ b/catch/perftests/memory/hipPerfMemFill.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -503,16 +490,16 @@ template class hipPerfMemFill { /** * Test Description * ------------------------ - *  - Verify hipPerfMemFill status. + * - Verify hipPerfMemFill status. * Test source * ------------------------ - *  - perftests/memory/hipPerfMemFill.cc + * - perftests/memory/hipPerfMemFill.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfMemFill_test") { +TEST_CASE(Perf_hipPerfMemFill_test) { std::cout << "Test int" << std::endl; hipPerfMemFill hipPerfMemFillInt; REQUIRE(true == hipPerfMemFillInt.open(0)); diff --git a/catch/perftests/memory/hipPerfMemMallocCpyFree.cc b/catch/perftests/memory/hipPerfMemMallocCpyFree.cc index e48bc53e5..0ebb74ba7 100644 --- a/catch/perftests/memory/hipPerfMemMallocCpyFree.cc +++ b/catch/perftests/memory/hipPerfMemMallocCpyFree.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpy hipMemcpy @@ -122,16 +109,16 @@ static bool hipPerfMemMallocCpyFree_test() { /** * Test Description * ------------------------ - *  - Verify hipPerfMemMallocCpyFree status. + * - Verify hipPerfMemMallocCpyFree status. * Test source * ------------------------ - *  - perftests/memory/hipPerfMemMallocCpyFree.cc + * - perftests/memory/hipPerfMemMallocCpyFree.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfMemMallocCpyFree_test") { +TEST_CASE(Perf_hipPerfMemMallocCpyFree_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); diff --git a/catch/perftests/memory/hipPerfMemcpy.cc b/catch/perftests/memory/hipPerfMemcpy.cc index c790fb5cd..aa9beadfd 100644 --- a/catch/perftests/memory/hipPerfMemcpy.cc +++ b/catch/perftests/memory/hipPerfMemcpy.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -199,16 +186,16 @@ bool hipPerfMemcpy::run_d2d_nocu(unsigned int numTests) { /** * Test Description * ------------------------ - *  - Verify hipPerfMemcpy status. + * - Verify hipPerfMemcpy status. * Test source * ------------------------ - *  - perftests/memory/hipPerfMemcpy.cc + * - perftests/memory/hipPerfMemcpy.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfMemcpy_test") { +TEST_CASE(Perf_hipPerfMemcpy_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); diff --git a/catch/perftests/memory/hipPerfMemcpyAsyncSpeed.cc b/catch/perftests/memory/hipPerfMemcpyAsyncSpeed.cc index cd231ad91..3b002dcda 100644 --- a/catch/perftests/memory/hipPerfMemcpyAsyncSpeed.cc +++ b/catch/perftests/memory/hipPerfMemcpyAsyncSpeed.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #define NUM_SIZES 6 @@ -41,7 +29,7 @@ void checkData(void* ptr, unsigned int size, char value) { } bool extraWarmup = true; -TEST_CASE("Perf_hipPerfMemcpyAsyncSpeed_test") { +TEST_CASE(Perf_hipPerfMemcpyAsyncSpeed_test) { hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, 0)); CONSOLE_PRINT("Set device to %d : %s\n", 0, props.name); diff --git a/catch/perftests/memory/hipPerfMempool.cc b/catch/perftests/memory/hipPerfMempool.cc index b936530ea..81237cae2 100644 --- a/catch/perftests/memory/hipPerfMempool.cc +++ b/catch/perftests/memory/hipPerfMempool.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -64,7 +51,7 @@ void getAndPrintMemoryDetails(const hipMemPool_t& pool) { * - HIP_VERSION >= 6.5 */ -TEST_CASE("Perf_MempoolManager_hipMallocAsync_hipFreeAsync") { +TEST_CASE(Perf_MempoolManager_hipMallocAsync_hipFreeAsync) { size_t free = 0, total = 0; HIP_CHECK(hipMemGetInfo(&free, &total)); if (free < 30_GB) { diff --git a/catch/perftests/memory/hipPerfMemset.cc b/catch/perftests/memory/hipPerfMemset.cc index 49808d496..fb1a0baca 100644 --- a/catch/perftests/memory/hipPerfMemset.cc +++ b/catch/perftests/memory/hipPerfMemset.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -344,16 +331,16 @@ void hipPerfMemset::run3D(unsigned int test, T memsetval, enum MemsetType type, /** * Test Description * ------------------------ - *  - Verify hipPerfMemset status. + * - Verify hipPerfMemset status. * Test source * ------------------------ - *  - perftests/memory/hipPerfMemset.cc + * - perftests/memory/hipPerfMemset.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfMemset_test") { +TEST_CASE(Perf_hipPerfMemset_test) { hipPerfMemset hipPerfMemset; int deviceId = 0; diff --git a/catch/perftests/memory/hipPerfMemsetAsyncSpeed.cc b/catch/perftests/memory/hipPerfMemsetAsyncSpeed.cc index fe2fcdb33..8145b2f53 100644 --- a/catch/perftests/memory/hipPerfMemsetAsyncSpeed.cc +++ b/catch/perftests/memory/hipPerfMemsetAsyncSpeed.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #define NUM_SIZES 6 @@ -41,7 +29,7 @@ void checkData_(void* ptr, unsigned int size, char value) { } bool extraWarmup_ = true; -TEST_CASE("Perf_hipPerfMemsetAsyncSpeed_test") { +TEST_CASE(Perf_hipPerfMemsetAsyncSpeed_test) { hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, 0)); CONSOLE_PRINT("Set device to %d : %s", 0, props.name); diff --git a/catch/perftests/memory/hipPerfSampleRate.cc b/catch/perftests/memory/hipPerfSampleRate.cc index 30ddae521..dcacf32d6 100644 --- a/catch/perftests/memory/hipPerfSampleRate.cc +++ b/catch/perftests/memory/hipPerfSampleRate.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ @@ -278,16 +265,16 @@ void hipPerfSampleRate::checkData(uint* ptr) { /** * Test Description * ------------------------ - *  - Verify hipPerfSampleRate status. + * - Verify hipPerfSampleRate status. * Test source * ------------------------ - *  - perftests/memory/hipPerfSampleRate.cc + * - perftests/memory/hipPerfSampleRate.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfSampleRate_test") { +TEST_CASE(Perf_hipPerfSampleRate_test) { hipPerfSampleRate sampleTypes; REQUIRE(true == sampleTypes.open()); diff --git a/catch/perftests/memory/hipPerfSharedMemReadSpeed.cc b/catch/perftests/memory/hipPerfSharedMemReadSpeed.cc index 3a5520d22..4158b96c7 100644 --- a/catch/perftests/memory/hipPerfSharedMemReadSpeed.cc +++ b/catch/perftests/memory/hipPerfSharedMemReadSpeed.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -237,16 +224,16 @@ static bool hipPerfSharedMemReadSpeed_test() { /** * Test Description * ------------------------ - *  - Verify hipPerfSharedMemReadSpeed status. + * - Verify hipPerfSharedMemReadSpeed status. * Test source * ------------------------ - *  - perftests/memory/hipPerfSharedMemReadSpeed.cc + * - perftests/memory/hipPerfSharedMemReadSpeed.cc * Test requirements * ------------------------ - *  - HIP_VERSION >= 5.6 + * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfSharedMemReadSpeed_test") { +TEST_CASE(Perf_hipPerfSharedMemReadSpeed_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); diff --git a/catch/perftests/stream/CMakeLists.txt b/catch/perftests/stream/CMakeLists.txt index 84307f5e0..e7b13d8c7 100644 --- a/catch/perftests/stream/CMakeLists.txt +++ b/catch/perftests/stream/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(TEST_SRC diff --git a/catch/perftests/stream/hipPerfDeviceConcurrency.cc b/catch/perftests/stream/hipPerfDeviceConcurrency.cc index c8b10d190..4e112b96a 100644 --- a/catch/perftests/stream/hipPerfDeviceConcurrency.cc +++ b/catch/perftests/stream/hipPerfDeviceConcurrency.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -248,7 +235,7 @@ void hipPerfDeviceConcurrency::checkData(uint* ptr) { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfDeviceConcurrency") { +TEST_CASE(Perf_hipPerfDeviceConcurrency) { hipPerfDeviceConcurrency deviceConcurrency; deviceConcurrency.open(); int nGpu = deviceConcurrency.getNumGpus(); diff --git a/catch/perftests/stream/hipPerfIncreasingNumberOfStreams.cc b/catch/perftests/stream/hipPerfIncreasingNumberOfStreams.cc index 91a8eb60d..194bcee1b 100644 --- a/catch/perftests/stream/hipPerfIncreasingNumberOfStreams.cc +++ b/catch/perftests/stream/hipPerfIncreasingNumberOfStreams.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2015 - 2024 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include @@ -26,7 +13,7 @@ using namespace std; __global__ static void _noop_kernel() {} -TEST_CASE("Perf_KernelLaunchLatency_IncreasingNumberOfStreams") { +TEST_CASE(Perf_KernelLaunchLatency_IncreasingNumberOfStreams) { vector streamsNumber{1, 10, 50, 100, 1000, 5000}; hipError_t err = hipSuccess; hipEvent_t start, stop; diff --git a/catch/perftests/stream/hipPerfMultiStreamKernelLaunch.cc b/catch/perftests/stream/hipPerfMultiStreamKernelLaunch.cc index 8cd8020e4..6f55271d9 100644 --- a/catch/perftests/stream/hipPerfMultiStreamKernelLaunch.cc +++ b/catch/perftests/stream/hipPerfMultiStreamKernelLaunch.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2025 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -108,7 +95,7 @@ class Experiment { std::vector streams_; }; -TEST_CASE("Perf_hipPerfMultiStreamKernelLaunch") { +TEST_CASE(Perf_hipPerfMultiStreamKernelLaunch) { constexpr uint64_t KERNEL_SLEEP_US = 100; constexpr uint64_t KERNEL_DISPATCHES_PER_STREAM = 10; constexpr uint64_t WARMUP_KERNEL_DISPATCHES_PER_STREAM = 10; diff --git a/catch/perftests/stream/hipPerfStreamConcurrency.cc b/catch/perftests/stream/hipPerfStreamConcurrency.cc index c4904361c..6bc96641e 100644 --- a/catch/perftests/stream/hipPerfStreamConcurrency.cc +++ b/catch/perftests/stream/hipPerfStreamConcurrency.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -357,7 +344,7 @@ void hipPerfStreamConcurrency::checkData(uint* ptr) { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfStreamConcurrency") { +TEST_CASE(Perf_hipPerfStreamConcurrency) { hipPerfStreamConcurrency streamConcurrency; int deviceId = 0; REQUIRE(true == streamConcurrency.open(deviceId)); diff --git a/catch/perftests/stream/hipPerfStreamCreateCopyDestroy.cc b/catch/perftests/stream/hipPerfStreamCreateCopyDestroy.cc index ebcf628eb..35a49c07e 100644 --- a/catch/perftests/stream/hipPerfStreamCreateCopyDestroy.cc +++ b/catch/perftests/stream/hipPerfStreamCreateCopyDestroy.cc @@ -1,20 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -139,7 +126,7 @@ bool hipPerfStreamCreateCopyDestroy::run(unsigned int testNumber) { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Perf_hipPerfStreamCreateCopyDestroy") { +TEST_CASE(Perf_hipPerfStreamCreateCopyDestroy) { hipPerfStreamCreateCopyDestroy streamCCD; int deviceId = 0; REQUIRE(true == streamCCD.open(deviceId)); diff --git a/catch/perftests/vmm/CMakeLists.txt b/catch/perftests/vmm/CMakeLists.txt index 57f6d0a51..b41e860e5 100644 --- a/catch/perftests/vmm/CMakeLists.txt +++ b/catch/perftests/vmm/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC hipPerfVMMAlloc.cc diff --git a/catch/perftests/vmm/hipPerfVMMAlloc.cc b/catch/perftests/vmm/hipPerfVMMAlloc.cc index 5fc64dec3..73bc62bab 100644 --- a/catch/perftests/vmm/hipPerfVMMAlloc.cc +++ b/catch/perftests/vmm/hipPerfVMMAlloc.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemCreate hipMemCreate @@ -285,7 +272,7 @@ bool TestOnDevice(int deviceId) { return true; } -TEST_CASE("Perf_hipPerfVMMAllocSpeed_test") { +TEST_CASE(Perf_hipPerfVMMAllocSpeed_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); if (numDevices <= 0) { diff --git a/catch/stress/CMakeLists.txt b/catch/stress/CMakeLists.txt index 0beb263a8..09bcbd1d8 100644 --- a/catch/stress/CMakeLists.txt +++ b/catch/stress/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + add_custom_target(stress_test COMMAND "${CMAKE_CTEST_COMMAND}" -R "Stress_" COMMENT "Build complete, now executing the stress test ...") diff --git a/catch/stress/deviceallocation/CMakeLists.txt b/catch/stress/deviceallocation/CMakeLists.txt index 1db7bef13..e461afefd 100644 --- a/catch/stress/deviceallocation/CMakeLists.txt +++ b/catch/stress/deviceallocation/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC Stress_deviceAllocationStress.cc diff --git a/catch/stress/deviceallocation/Stress_deviceAllocationStress.cc b/catch/stress/deviceallocation/Stress_deviceAllocationStress.cc index 3943762ec..c0b190378 100644 --- a/catch/stress/deviceallocation/Stress_deviceAllocationStress.cc +++ b/catch/stress/deviceallocation/Stress_deviceAllocationStress.cc @@ -1,21 +1,9 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -340,7 +328,7 @@ static bool TestMemoryAllocationInLoop(int test_type, bool isMultikernel = false /** * Scenario: Test malloc till nullptr is returned using even chunksize. */ -TEST_CASE("Stress_deviceAllocation_malloc_Even") { +TEST_CASE(Stress_deviceAllocation_malloc_Even) { REQUIRE(true == TestAllocationOfAllAvailableMemory(TEST_MALLOC_FREE, NO_ALLOCATION_ONHOST, MEMORY_CHUNK_SIZE)); } @@ -348,7 +336,7 @@ TEST_CASE("Stress_deviceAllocation_malloc_Even") { /** * Scenario: Test malloc till nullptr is returned using odd chunksize. */ -TEST_CASE("Stress_deviceAllocation_malloc_Odd") { +TEST_CASE(Stress_deviceAllocation_malloc_Odd) { REQUIRE(true == TestAllocationOfAllAvailableMemory(TEST_MALLOC_FREE, NO_ALLOCATION_ONHOST, MEMORY_CHUNK_SIZE_ODD)); } @@ -356,7 +344,7 @@ TEST_CASE("Stress_deviceAllocation_malloc_Odd") { /** * Scenario: Test new till nullptr is returned using even chunksize. */ -TEST_CASE("Stress_deviceAllocation_new_Even") { +TEST_CASE(Stress_deviceAllocation_new_Even) { REQUIRE(true == TestAllocationOfAllAvailableMemory(TEST_NEW_DELETE, NO_ALLOCATION_ONHOST, MEMORY_CHUNK_SIZE)); } @@ -364,7 +352,7 @@ TEST_CASE("Stress_deviceAllocation_new_Even") { /** * Scenario: Test new till nullptr is returned using odd chunksize. */ -TEST_CASE("Stress_deviceAllocation_new_Odd") { +TEST_CASE(Stress_deviceAllocation_new_Odd) { REQUIRE(true == TestAllocationOfAllAvailableMemory(TEST_NEW_DELETE, NO_ALLOCATION_ONHOST, MEMORY_CHUNK_SIZE_ODD)); } @@ -374,7 +362,7 @@ TEST_CASE("Stress_deviceAllocation_new_Odd") { * is returned. Device memory is also allocated using hipmallocmanaged * from host. */ -TEST_CASE("Stress_deviceAllocation_malloc_hipmallocmanaged") { +TEST_CASE(Stress_deviceAllocation_malloc_hipmallocmanaged) { REQUIRE(true == TestAllocationOfAllAvailableMemory( TEST_MALLOC_FREE, ALLOCATE_ONHOST_HIPMALLOCMANAGED, MEMORY_CHUNK_SIZE)); } @@ -384,7 +372,7 @@ TEST_CASE("Stress_deviceAllocation_malloc_hipmallocmanaged") { * is returned. Device memory is also allocated using hipmallocmanaged * from host. */ -TEST_CASE("Stress_deviceAllocation_new_hipmallocmanaged") { +TEST_CASE(Stress_deviceAllocation_new_hipmallocmanaged) { REQUIRE(true == TestAllocationOfAllAvailableMemory( TEST_NEW_DELETE, ALLOCATE_ONHOST_HIPMALLOCMANAGED, MEMORY_CHUNK_SIZE)); } @@ -393,7 +381,7 @@ TEST_CASE("Stress_deviceAllocation_new_hipmallocmanaged") { * Scenario: This test checks device allocation using malloc till nullptr * is returned. Device memory is also allocated using hipmalloc from host. */ -TEST_CASE("Stress_deviceAllocation_malloc_hipmalloc") { +TEST_CASE(Stress_deviceAllocation_malloc_hipmalloc) { REQUIRE(true == TestAllocationOfAllAvailableMemory(TEST_MALLOC_FREE, ALLOCATE_ONHOST_HIPMALLOC, MEMORY_CHUNK_SIZE)); } @@ -402,7 +390,7 @@ TEST_CASE("Stress_deviceAllocation_malloc_hipmalloc") { * Scenario: This test checks device allocation using new till nullptr * is returned. Device memory is also allocated using hipmalloc from host. */ -TEST_CASE("Stress_deviceAllocation_new_hipmalloc") { +TEST_CASE(Stress_deviceAllocation_new_hipmalloc) { REQUIRE(true == TestAllocationOfAllAvailableMemory(TEST_NEW_DELETE, ALLOCATE_ONHOST_HIPMALLOC, MEMORY_CHUNK_SIZE)); } @@ -411,7 +399,7 @@ TEST_CASE("Stress_deviceAllocation_new_hipmalloc") { * Scenario: This test validates device allocation negative scenario * when size > available memory. */ -TEST_CASE("Stress_deviceAllocation_Negative") { +TEST_CASE(Stress_deviceAllocation_Negative) { int *ret_d{nullptr}, *ret_h{nullptr}; size_t avail = 0, tot = 0; HIP_CHECK(hipMemGetInfo(&avail, &tot)); @@ -440,7 +428,7 @@ TEST_CASE("Stress_deviceAllocation_Negative") { * Scenario: This test performs stress test of malloc/free in a loop * using single kernel. */ -TEST_CASE("Stress_deviceAllocation_malloc_loop_singlekernel") { +TEST_CASE(Stress_deviceAllocation_malloc_loop_singlekernel) { REQUIRE(true == TestMemoryAllocationInLoop(TEST_MALLOC_FREE, false)); } @@ -448,7 +436,7 @@ TEST_CASE("Stress_deviceAllocation_malloc_loop_singlekernel") { * Scenario: This test performs stress test of new/delete in a loop * using single kernel. */ -TEST_CASE("Stress_deviceAllocation_new_loop_singlekernel") { +TEST_CASE(Stress_deviceAllocation_new_loop_singlekernel) { REQUIRE(true == TestMemoryAllocationInLoop(TEST_NEW_DELETE, false)); } @@ -456,7 +444,7 @@ TEST_CASE("Stress_deviceAllocation_new_loop_singlekernel") { * Scenario: This test performs stress test of malloc/free in a loop * using multiple kernel. */ -TEST_CASE("Stress_deviceAllocation_malloc_loop_multkernel") { +TEST_CASE(Stress_deviceAllocation_malloc_loop_multkernel) { REQUIRE(true == TestMemoryAllocationInLoop(TEST_MALLOC_FREE, true)); } @@ -464,6 +452,6 @@ TEST_CASE("Stress_deviceAllocation_malloc_loop_multkernel") { * Scenario: This test performs stress test of new/delete in a loop * using multiple kernel. */ -TEST_CASE("Stress_deviceAllocation_new_loop_multkernel") { +TEST_CASE(Stress_deviceAllocation_new_loop_multkernel) { REQUIRE(true == TestMemoryAllocationInLoop(TEST_NEW_DELETE, true)); } diff --git a/catch/stress/memory/CMakeLists.txt b/catch/stress/memory/CMakeLists.txt index 3039f4f17..1f0f9ae1f 100644 --- a/catch/stress/memory/CMakeLists.txt +++ b/catch/stress/memory/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + find_package(TBB REQUIRED) # Common Tests - Test independent of all platforms diff --git a/catch/stress/memory/hipHmmOvrSubscriptionTst.cc b/catch/stress/memory/hipHmmOvrSubscriptionTst.cc index a442ba232..20761336b 100644 --- a/catch/stress/memory/hipHmmOvrSubscriptionTst.cc +++ b/catch/stress/memory/hipHmmOvrSubscriptionTst.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021-Present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Test Case Description: This test case tests the working of OverSubscription feature which is part of HMM.*/ @@ -34,7 +18,7 @@ __global__ void floatx2(float* ptr, size_t size) { } } -TEST_CASE("Stress_HMM_OverSubscriptionTst") { +TEST_CASE(Stress_HMM_OverSubscriptionTst) { int hmm = 0; HIP_CHECK(hipDeviceGetAttribute(&hmm, hipDeviceAttributeManagedMemory, 0)); diff --git a/catch/stress/memory/hipHostMallocStress.cc b/catch/stress/memory/hipHostMallocStress.cc index 5ba425e96..aa2d28f7d 100644 --- a/catch/stress/memory/hipHostMallocStress.cc +++ b/catch/stress/memory/hipHostMallocStress.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,7 +13,7 @@ THE SOFTWARE. // Try to allocate as much memory as possible // But since max allocation can fail, we need to try the next value -TEST_CASE("Stress_hipHostMalloc_MaxAllocation") { +TEST_CASE(Stress_hipHostMalloc_MaxAllocation) { size_t devMemAvail{0}, devMemFree{0}; HIP_CHECK(hipMemGetInfo(&devMemFree, &devMemAvail)); auto hostMemFree = HipTest::getAvailableSystemMemoryInMB() * 1024 * 1024; // In bytes @@ -56,7 +43,7 @@ TEST_CASE("Stress_hipHostMalloc_MaxAllocation") { // Allocate more memory than total GPU memory in each available GPU. // hipHostMalloc should return hipSuccess. -TEST_CASE("Stress_hipHostMalloc_MaxAllocation_AllGpu") { +TEST_CASE(Stress_hipHostMalloc_MaxAllocation_AllGpu) { char* A = nullptr; size_t maxGpuMem = 0, availableMem = 0; int count = 0; diff --git a/catch/stress/memory/hipHostRegisterStress.cc b/catch/stress/memory/hipHostRegisterStress.cc index 9a9555b29..ae0edc6b0 100644 --- a/catch/stress/memory/hipHostRegisterStress.cc +++ b/catch/stress/memory/hipHostRegisterStress.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipHostRegister hipHostRegister @@ -55,7 +39,7 @@ static __global__ void Inc(uint8_t* Ad) { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Stress_hipHostRegister_Oversubscription") { +TEST_CASE(Stress_hipHostRegister_Oversubscription) { hipDeviceProp_t prop; HIP_CHECK(hipGetDeviceProperties(&prop, 0)); std::string arch = prop.gcnArchName; diff --git a/catch/stress/memory/hipMalloc.cc b/catch/stress/memory/hipMalloc.cc index a790f8db9..1019ed6e2 100644 --- a/catch/stress/memory/hipMalloc.cc +++ b/catch/stress/memory/hipMalloc.cc @@ -1,20 +1,7 @@ /* - 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include @@ -27,7 +14,7 @@ // Stress allocation tests // Try to allocate as much memory as possible, backing off gradually on failure. -TEST_CASE("Stress_hipMalloc_HighSizeAlloc") { +TEST_CASE(Stress_hipMalloc_HighSizeAlloc) { size_t devMemTotal{0}, devMemFree{0}; HIP_CHECK(hipMemGetInfo(&devMemFree, &devMemTotal)); REQUIRE(devMemFree > 0); diff --git a/catch/stress/memory/hipMallocConcurrency.cc b/catch/stress/memory/hipMallocConcurrency.cc index b60eab171..7ea34d733 100644 --- a/catch/stress/memory/hipMallocConcurrency.cc +++ b/catch/stress/memory/hipMallocConcurrency.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -210,7 +197,7 @@ static void threadFunc(int gpu) { * Regress hipMalloc()/hipFree() in loop for bigger chunks and * smaller chunks of memory allocation */ -TEST_CASE("Stress_hipMalloc_LoopRegressionAllocFreeCycles") { +TEST_CASE(Stress_hipMalloc_LoopRegressionAllocFreeCycles) { int devCnt = 0; // Get GPU count @@ -227,7 +214,7 @@ TEST_CASE("Stress_hipMalloc_LoopRegressionAllocFreeCycles") { * continuously, stores it for later use and then frees it at later point * of time. */ -TEST_CASE("Stress_hipMalloc_AllocateAndPoolBuffers") { +TEST_CASE(Stress_hipMalloc_AllocateAndPoolBuffers) { size_t avail{0}, tot{0}; bool ret{false}; hipError_t err{}; @@ -268,7 +255,7 @@ TEST_CASE("Stress_hipMalloc_AllocateAndPoolBuffers") { * Exercise hipMalloc() api parellely on all gpus from * multiple threads and regress the api. */ -TEST_CASE("Stress_hipMalloc_Multithreaded_MultiGPU", "[multigpu]") { +TEST_CASE(Stress_hipMalloc_Multithreaded_MultiGPU) { std::vector threadlist; int devCnt; diff --git a/catch/stress/memory/hipMallocManagedStress.cc b/catch/stress/memory/hipMallocManagedStress.cc index cae8a09db..f3c65e5f8 100644 --- a/catch/stress/memory/hipMallocManagedStress.cc +++ b/catch/stress/memory/hipMallocManagedStress.cc @@ -1,20 +1,7 @@ /* - 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ // The following test case allocation, host access, device access of HMM @@ -143,7 +130,7 @@ static int HmmAttrPrint() { // The following test case allocation, host access, device access of HMM // memory from size 1 to 10KB -TEST_CASE("Stress_hipMallocManaged_MultiSize") { +TEST_CASE(Stress_hipMallocManaged_MultiSize) { IfTestPassed = true; int managed = HmmAttrPrint(); if (managed == 1) { @@ -190,7 +177,7 @@ TEST_CASE("Stress_hipMallocManaged_MultiSize") { // The following test case tests the behavior of kernel with a HMM memory and // hipMalloc memory -TEST_CASE("Stress_hipMallocManaged_KrnlWth2MemTypes") { +TEST_CASE(Stress_hipMallocManaged_KrnlWth2MemTypes) { IfTestPassed = true; int *Hmm = NULL, *Dptr = NULL, InitVal = 123; size_t NumElms = (1024 * 1024); @@ -235,7 +222,7 @@ TEST_CASE("Stress_hipMallocManaged_KrnlWth2MemTypes") { // The following test case tests when the same Hmm memory is used for // launching multiple different kernels will results in any issue -TEST_CASE("Stress_hipMallocManaged_MultiKrnlHmmAccess") { +TEST_CASE(Stress_hipMallocManaged_MultiKrnlHmmAccess) { int managed = HmmAttrPrint(); if (managed) { int InitVal = 123, NumElms = (1024 * 1024); @@ -248,7 +235,7 @@ TEST_CASE("Stress_hipMallocManaged_MultiKrnlHmmAccess") { } // Testing the allocation of/scenarios around max possible memory -TEST_CASE("Stress_hipMallocManaged_ExtremeSizes") { +TEST_CASE(Stress_hipMallocManaged_ExtremeSizes) { int managed = HmmAttrPrint(); if (managed == 1) { bool IfTestPassed = true; diff --git a/catch/stress/memory/hipMemPrftchAsyncStressTst.cc b/catch/stress/memory/hipMemPrftchAsyncStressTst.cc index b3bb45492..da7e214fe 100644 --- a/catch/stress/memory/hipMemPrftchAsyncStressTst.cc +++ b/catch/stress/memory/hipMemPrftchAsyncStressTst.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Test Case Description: The following test allocates a managed memory and prefetch it in @@ -62,7 +49,7 @@ static void ReleaseResource(int* Hmm, hipStream_t* strm) { /* The following test allocates a managed memory and prefetch it in one-to-all and all-to-one fahsion followed by kernel launch within available devices*/ -TEST_CASE("Stress_hipMemPrefetchAsyncOneToAll") { +TEST_CASE(Stress_hipMemPrefetchAsyncOneToAll) { int MangdMem = HmmAttrPrint(); if (MangdMem == 1) { int *Hmm1 = nullptr, NumDevs, MemSz = (4096 * 4); diff --git a/catch/stress/memory/hipMemcpyMThreadMSize.cc b/catch/stress/memory/hipMemcpyMThreadMSize.cc index cc1956112..9452e988e 100644 --- a/catch/stress/memory/hipMemcpyMThreadMSize.cc +++ b/catch/stress/memory/hipMemcpyMThreadMSize.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 - present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -241,7 +228,7 @@ template void Memcpy_And_verify(int NUM_ELM) { } } -TEMPLATE_TEST_CASE("Stress_hipMemcpy_multiDevice-AllAPIs", "", char, int, size_t, long double) { +TEMPLATE_TEST_CASE(Stress_hipMemcpy_multiDevice_AllAPIs, char, int, size_t, long double) { auto diff_size = GENERATE(1, 5, 10, 100, 1024, 10 * 1024, 100 * 1024, 1024 * 1024, 10 * 1024 * 1024, 100 * 1024 * 1024, 1024 * 1024 * 1024); size_t free = 0, total = 0; diff --git a/catch/stress/memory/hold_memory.cc b/catch/stress/memory/hold_memory.cc index 3a7d028f5..ca37e75fa 100644 --- a/catch/stress/memory/hold_memory.cc +++ b/catch/stress/memory/hold_memory.cc @@ -1,20 +1,7 @@ /* - 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 - 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include diff --git a/catch/stress/memory/memcpy.cc b/catch/stress/memory/memcpy.cc index 7ba95b4e7..01a9bdead 100644 --- a/catch/stress/memory/memcpy.cc +++ b/catch/stress/memory/memcpy.cc @@ -1,6 +1,12 @@ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include -TEST_CASE("Stress_hipMalloc", "DifferentSizes") { +TEST_CASE(Stress_hipMalloc) { int* d_a = nullptr; SECTION("Size 10") { auto res = hipMalloc(&d_a, sizeof(10)); diff --git a/catch/stress/module/CMakeLists.txt b/catch/stress/module/CMakeLists.txt index c09cd7c43..0f12d9915 100644 --- a/catch/stress/module/CMakeLists.txt +++ b/catch/stress/module/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC hipModuleLoadUnload.cc diff --git a/catch/stress/module/hipModuleLoadUnload.cc b/catch/stress/module/hipModuleLoadUnload.cc index 20fe9eda2..42bb7908c 100644 --- a/catch/stress/module/hipModuleLoadUnload.cc +++ b/catch/stress/module/hipModuleLoadUnload.cc @@ -1,20 +1,7 @@ /* - 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 - 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include @@ -102,7 +89,7 @@ void GetCodeObjectUsingRTC(size_t codeSize, std::vector& code) { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Stress_hipModuleLoadUnload") { +TEST_CASE(Stress_hipModuleLoadUnload) { size_t code_size = 0; std::vector code; GetCodeObjectUsingRTC(code_size, code); diff --git a/catch/stress/printf/CMakeLists.txt b/catch/stress/printf/CMakeLists.txt index a1f6ac6b8..8b5e11eb2 100644 --- a/catch/stress/printf/CMakeLists.txt +++ b/catch/stress/printf/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC Stress_printf_ComplexKernels.cc diff --git a/catch/stress/printf/Stress_printf_ComplexKernels.cc b/catch/stress/printf/Stress_printf_ComplexKernels.cc index 5eee0d1d1..2e9ae49eb 100644 --- a/catch/stress/printf/Stress_printf_ComplexKernels.cc +++ b/catch/stress/printf/Stress_printf_ComplexKernels.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #ifdef __linux__ @@ -397,7 +381,7 @@ bool testPrintfMultGPU(int numOfGPUs, uint32_t num_blocks, uint32_t threads_per_ #endif } // namespace hipPrintfStressTest -TEST_CASE("Stress_printf_ComplexKernelMultStream") { +TEST_CASE(Stress_printf_ComplexKernelMultStream) { #ifdef __linux__ printf("Test - Stress_printf_ComplexKernelMultStream start\n"); bool TestPassed = true; @@ -419,7 +403,7 @@ TEST_CASE("Stress_printf_ComplexKernelMultStream") { #endif } -TEST_CASE("Stress_printf_ComplexKernelMultStreamMultGpu") { +TEST_CASE(Stress_printf_ComplexKernelMultStreamMultGpu) { #ifdef __linux__ printf("Test - Stress_printf_ComplexKernelMultStreamMultGpu start \n"); bool TestPassed = true; diff --git a/catch/stress/printf/Stress_printf_SimpleKernels.cc b/catch/stress/printf/Stress_printf_SimpleKernels.cc index 9604f8a30..c8a25cc1d 100644 --- a/catch/stress/printf/Stress_printf_SimpleKernels.cc +++ b/catch/stress/printf/Stress_printf_SimpleKernels.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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 #ifdef __linux__ #include "printf_common.h" @@ -592,7 +577,7 @@ bool test_synchronized_printf(uint32_t num_blocks, uint32_t threads_per_block, #endif } // namespace hipPrintfStressTest -TEST_CASE("Stress_printf_ConstStr") { +TEST_CASE(Stress_printf_ConstStr) { #ifdef __linux__ printf("Test: Stress_printf_ConstStr\n"); bool TestPassed = true; @@ -608,7 +593,7 @@ TEST_CASE("Stress_printf_ConstStr") { #endif } -TEST_CASE("Stress_printf_IfElseConditionalStr") { +TEST_CASE(Stress_printf_IfElseConditionalStr) { #ifdef __linux__ printf("Test: Stress_printf_IfElseConditionalStr\n"); bool TestPassed = true; @@ -624,7 +609,7 @@ TEST_CASE("Stress_printf_IfElseConditionalStr") { #endif } -TEST_CASE("Stress_printf_IfConditionalStr") { +TEST_CASE(Stress_printf_IfConditionalStr) { #ifdef __linux__ printf("Test: Stress_printf_IfConditionalStr\n"); bool TestPassed = true; @@ -640,7 +625,7 @@ TEST_CASE("Stress_printf_IfConditionalStr") { #endif } -TEST_CASE("Stress_printf_VariableStr") { +TEST_CASE(Stress_printf_VariableStr) { #ifdef __linux__ printf("Test: Stress_printf_VariableStr\n"); bool TestPassed = true; @@ -655,7 +640,7 @@ TEST_CASE("Stress_printf_VariableStr") { #endif } -TEST_CASE("Stress_printf_DependentCalc") { +TEST_CASE(Stress_printf_DependentCalc) { #ifdef __linux__ printf("Test: Stress_printf_DependentCalc\n"); bool TestPassed = true; @@ -670,7 +655,7 @@ TEST_CASE("Stress_printf_DependentCalc") { #endif } -TEST_CASE("Stress_printf_DecimalStr") { +TEST_CASE(Stress_printf_DecimalStr) { #ifdef __linux__ printf("Test: Stress_printf_DecimalStr\n"); bool TestPassed = true; @@ -685,7 +670,7 @@ TEST_CASE("Stress_printf_DecimalStr") { #endif } -TEST_CASE("Stress_printf_SharedMem") { +TEST_CASE(Stress_printf_SharedMem) { #ifdef __linux__ printf("Test: Stress_printf_SharedMem\n"); bool TestPassed = true; @@ -700,7 +685,7 @@ TEST_CASE("Stress_printf_SharedMem") { #endif } -TEST_CASE("Stress_printf_SynchronizedPrintf") { +TEST_CASE(Stress_printf_SynchronizedPrintf) { #ifdef __linux__ printf("Test: Stress_printf_SynchronizedPrintf\n"); bool TestPassed = true; @@ -714,7 +699,7 @@ TEST_CASE("Stress_printf_SynchronizedPrintf") { #endif } -TEST_CASE("Stress_printf_AtomicCalc") { +TEST_CASE(Stress_printf_AtomicCalc) { #ifdef __linux__ printf("Test: Stress_printf_AtomicCalc\n"); bool TestPassed = true; diff --git a/catch/stress/printf/printf_common.h b/catch/stress/printf/printf_common.h index 0331572b9..561c0cc3d 100644 --- a/catch/stress/printf/printf_common.h +++ b/catch/stress/printf/printf_common.h @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #ifndef _STRESSTEST_PRINTF_COMMON_H_ #define _STRESSTEST_PRINTF_COMMON_H_ diff --git a/catch/stress/stream/CMakeLists.txt b/catch/stress/stream/CMakeLists.txt index db988c426..145edefcc 100644 --- a/catch/stress/stream/CMakeLists.txt +++ b/catch/stress/stream/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC Stress_hipStreamCreate.cc diff --git a/catch/stress/stream/Stress_hipStreamCreate.cc b/catch/stress/stream/Stress_hipStreamCreate.cc index ac53b9b7d..8c6793690 100644 --- a/catch/stress/stream/Stress_hipStreamCreate.cc +++ b/catch/stress/stream/Stress_hipStreamCreate.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -152,14 +139,14 @@ void testhipStreamCreateFlags(int* stream_sequence, unsigned int flag) { } } // namespace hipStreamCreateStressTest -TEST_CASE("Stress_hipStreamCreate_SyncTest") { +TEST_CASE(Stress_hipStreamCreate_SyncTest) { printf("hipStreamCreate stress test:\n"); for (int i = 0; i < TOTALSEQ; i++) { hipStreamCreateStressTest::testhipStreamCreate(hipStreamCreateStressTest::stream_seq[i]); } } -TEST_CASE("Stress_hipStreamCreatePriority_SyncTest") { +TEST_CASE(Stress_hipStreamCreatePriority_SyncTest) { printf("hipStreamCreateWithPriority(hipStreamDefault) stress test:\n"); for (int i = 0; i < TOTALSEQ; i++) { hipStreamCreateStressTest::testhipStreamCreatePriority(hipStreamCreateStressTest::stream_seq[i], @@ -172,7 +159,7 @@ TEST_CASE("Stress_hipStreamCreatePriority_SyncTest") { } } -TEST_CASE("Stress_hipStreamCreateWithFlags_SyncTest") { +TEST_CASE(Stress_hipStreamCreateWithFlags_SyncTest) { printf("hipStreamCreateWithFlags(hipStreamDefault) stress test:\n"); for (int i = 0; i < TOTALSEQ; i++) { hipStreamCreateStressTest::testhipStreamCreateFlags(hipStreamCreateStressTest::stream_seq[i], diff --git a/catch/stress/stream/streamEnqueue.cc b/catch/stress/stream/streamEnqueue.cc index 57accf2f2..1a44e324e 100644 --- a/catch/stress/stream/streamEnqueue.cc +++ b/catch/stress/stream/streamEnqueue.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -51,7 +38,7 @@ template struct AtomicWrap { // Have multiple threads and enqueue commands from them on a single stream // Validate at the end that all commands have completed successfully -TEST_CASE("Stress_StreamEnqueue_DifferentThreads") { +TEST_CASE(Stress_StreamEnqueue_DifferentThreads) { auto hwThreads = std::thread::hardware_concurrency(); hwThreads = (hwThreads >= 2) ? hwThreads : 2; // Run atleast 2 threads @@ -121,7 +108,7 @@ __global__ void doOperation(int* dPtr, int val) { // Allocate mulitple stream for same device. // Same device stream operate on same memory -TEST_CASE("Stress_StreamEnqueue_DifferentThreads_MultiGPU") { +TEST_CASE(Stress_StreamEnqueue_DifferentThreads_MultiGPU) { int deviceCount{0}; HIP_CHECK(hipGetDeviceCount(&deviceCount)); REQUIRE(deviceCount > 0); diff --git a/catch/unit/CMakeLists.txt b/catch/unit/CMakeLists.txt index 9a37ac90d..4ada24dad 100644 --- a/catch/unit/CMakeLists.txt +++ b/catch/unit/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2021-2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT add_subdirectory(rtc) add_subdirectory(graph) @@ -38,7 +22,6 @@ add_subdirectory(context) add_subdirectory(device_memory) add_subdirectory(warp) add_subdirectory(dynamicLoading) -add_subdirectory(c_compilation) add_subdirectory(g++) #add_subdirectory(gcc) # TODO link error TheRock build add_subdirectory(module) @@ -51,19 +34,21 @@ add_subdirectory(threadfence) add_subdirectory(virtualMemoryManagement) # TODO Rock build failures if(UNIX) - add_subdirectory(atomics) - add_subdirectory(math) - # TODO compute build failures - add_subdirectory(deviceLib) - add_subdirectory(syncthreads) + add_subdirectory(atomics) + add_subdirectory(math) + # TODO compute build failures + add_subdirectory(deviceLib) + add_subdirectory(syncthreads) endif() if(HIP_PLATFORM STREQUAL "amd") - add_subdirectory(callback) - add_subdirectory(clock) - add_subdirectory(hip_specific) - # Vulkan interop APIs currently undefined for Nvidia - add_subdirectory(vulkan_interop) - add_subdirectory(gl_interop) # Disabled on NVIDIA due to defect - EXSWHTEC-246 + add_subdirectory(callback) + add_subdirectory(clock) + add_subdirectory(hip_specific) + # fails while including the hip_nvidia_details + add_subdirectory(c_compilation) + # Vulkan interop APIs currently undefined for Nvidia + add_subdirectory(vulkan_interop) + add_subdirectory(gl_interop) # Disabled on NVIDIA due to defect - EXSWHTEC-246 endif() add_subdirectory(synchronization) add_subdirectory(launchBounds) diff --git a/catch/unit/assertion/CMakeLists.txt b/catch/unit/assertion/CMakeLists.txt index 77d8a2401..cbc1925cd 100644 --- a/catch/unit/assertion/CMakeLists.txt +++ b/catch/unit/assertion/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT if(HIP_PLATFORM MATCHES "nvidia") set(TEST_SRC @@ -30,7 +14,6 @@ elseif(HIP_PLATFORM MATCHES "amd") set(TEST_SRC static_assert.cc assert.cc - constexpr_assert.cc ) hip_add_exe_to_target(NAME AssertionTest TEST_SRC ${TEST_SRC} diff --git a/catch/unit/assertion/assert.cc b/catch/unit/assertion/assert.cc index 07cc8f5fb..e2be59a67 100644 --- a/catch/unit/assertion/assert.cc +++ b/catch/unit/assertion/assert.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -73,7 +60,7 @@ bool isAbortOnErrorEnabled() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Assert_Positive_Basic_KernelPass") { +TEST_CASE(Unit_Assert_Positive_Basic_KernelPass) { #ifdef NDEBUG HipTest::HIP_SKIP_TEST("Assertions are disabled on this build."); @@ -115,7 +102,7 @@ TEST_CASE("Unit_Assert_Positive_Basic_KernelPass") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Assert_Positive_Basic_KernelFail") { +TEST_CASE(Unit_Assert_Positive_Basic_KernelFail) { #ifdef NDEBUG HipTest::HIP_SKIP_TEST("Assertions are disabled on this build."); diff --git a/catch/unit/assertion/constexpr_assert.cc b/catch/unit/assertion/constexpr_assert.cc deleted file mode 100644 index 7671ef3dd..000000000 --- a/catch/unit/assertion/constexpr_assert.cc +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright (c) 2025 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 -#include - -/** - * @addtogroup constexpr_assert constexpr_assert - * @{ - * @ingroup DeviceLanguageTest - * Tests for using assert() inside constexpr device functions. - */ - -__device__ constexpr int safe_divide(int a, int b) { - assert(b != 0); - return a / b; -} - -__device__ constexpr int result = safe_divide(10, 2); - -/** - * Test Description - * ------------------------ - * - Verifies that assert() can be used in constexpr __device__ functions. - * - Tests compile-time evaluation of constexpr device function with assert. - * - The assert condition is true, so it should not trigger. - * Test source - * ------------------------ - * - unit/assertion/constexpr_assert.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.3 - */ -TEST_CASE("Unit_ConstexprAssert_Positive_SafeDivide") { - static_assert(result == 5, "safe_divide(10, 2) should equal 5"); - REQUIRE(result == 5); -} - -/** - * End doxygen group DeviceLanguageTest. - * @} - */ - diff --git a/catch/unit/assertion/static_assert.cc b/catch/unit/assertion/static_assert.cc index a740964bb..d988e6019 100644 --- a/catch/unit/assertion/static_assert.cc +++ b/catch/unit/assertion/static_assert.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "static_assert_kernels_rtc.hh" @@ -70,7 +57,7 @@ void StaticAssertWrapper(const char* program_source) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_StaticAssert_Positive_Basic_RTC") { StaticAssertWrapper(kStaticAssert_Positive); } +TEST_CASE(Unit_StaticAssert_Positive_Basic_RTC) { StaticAssertWrapper(kStaticAssert_Positive); } /** * Test Description @@ -85,7 +72,7 @@ TEST_CASE("Unit_StaticAssert_Positive_Basic_RTC") { StaticAssertWrapper(kStaticA * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_StaticAssert_Negative_Basic_RTC") { StaticAssertWrapper(kStaticAssert_Negative); } +TEST_CASE(Unit_StaticAssert_Negative_Basic_RTC) { StaticAssertWrapper(kStaticAssert_Negative); } /** * End doxygen group DeviceLanguageTest. diff --git a/catch/unit/assertion/static_assert_kernels_negative.cc b/catch/unit/assertion/static_assert_kernels_negative.cc index 777f27855..96b608cfa 100644 --- a/catch/unit/assertion/static_assert_kernels_negative.cc +++ b/catch/unit/assertion/static_assert_kernels_negative.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/assertion/static_assert_kernels_positive.cc b/catch/unit/assertion/static_assert_kernels_positive.cc index 2ed0d7b68..fc6a180a6 100644 --- a/catch/unit/assertion/static_assert_kernels_positive.cc +++ b/catch/unit/assertion/static_assert_kernels_positive.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/assertion/static_assert_kernels_rtc.hh b/catch/unit/assertion/static_assert_kernels_rtc.hh index 5bb7419e3..bc31b4f35 100644 --- a/catch/unit/assertion/static_assert_kernels_rtc.hh +++ b/catch/unit/assertion/static_assert_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/CMakeLists.txt b/catch/unit/atomics/CMakeLists.txt index 33bd107b3..235bcdc2e 100644 --- a/catch/unit/atomics/CMakeLists.txt +++ b/catch/unit/atomics/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT if(HIP_PLATFORM MATCHES "amd") set(TEST_SRC diff --git a/catch/unit/atomics/__hip_atomic_compare_exchange_strong.cc b/catch/unit/atomics/__hip_atomic_compare_exchange_strong.cc index 065a4c174..67e059b76 100644 --- a/catch/unit/atomics/__hip_atomic_compare_exchange_strong.cc +++ b/catch/unit/atomics/__hip_atomic_compare_exchange_strong.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" @@ -103,7 +87,7 @@ template static void runHipAtomicCompareExchangeStrongWorkgr * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_compare_exchange_strong_Positive_Wavefront") { +TEST_CASE(Unit___hip_atomic_compare_exchange_strong_Positive_Wavefront) { SECTION("int") { runHipAtomicCompareExchangeStrongWavefrontTest(); } SECTION("unsigned int") { runHipAtomicCompareExchangeStrongWavefrontTest(); } SECTION("unsigned long") { runHipAtomicCompareExchangeStrongWavefrontTest(); } @@ -139,7 +123,7 @@ TEST_CASE("Unit___hip_atomic_compare_exchange_strong_Positive_Wavefront") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_compare_exchange_strong_Positive_Workgroup") { +TEST_CASE(Unit___hip_atomic_compare_exchange_strong_Positive_Workgroup) { SECTION("int") { runHipAtomicCompareExchangeStrongWorkgroupTest(); } SECTION("unsigned int") { runHipAtomicCompareExchangeStrongWorkgroupTest(); } SECTION("unsigned long") { runHipAtomicCompareExchangeStrongWorkgroupTest(); } diff --git a/catch/unit/atomics/__hip_atomic_exchange.cc b/catch/unit/atomics/__hip_atomic_exchange.cc index 624085e51..f0c3b98e2 100644 --- a/catch/unit/atomics/__hip_atomic_exchange.cc +++ b/catch/unit/atomics/__hip_atomic_exchange.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "atomicExch_common.hh" @@ -109,7 +93,7 @@ template static void runHipAtomicExchangeWorkgroupTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_exchange_Positive_Wavefront") { +TEST_CASE(Unit___hip_atomic_exchange_Positive_Wavefront) { SECTION("int") { runHipAtomicExchangeWavefrontTest(); } SECTION("unsigned int") { runHipAtomicExchangeWavefrontTest(); } SECTION("unsigned long") { runHipAtomicExchangeWavefrontTest(); } @@ -144,7 +128,7 @@ TEST_CASE("Unit___hip_atomic_exchange_Positive_Wavefront") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_exchange_Positive_Workgroup") { +TEST_CASE(Unit___hip_atomic_exchange_Positive_Workgroup) { SECTION("int") { runHipAtomicExchangeWorkgroupTest(); } SECTION("unsigned int") { runHipAtomicExchangeWorkgroupTest(); } SECTION("unsigned long") { runHipAtomicExchangeWorkgroupTest(); } diff --git a/catch/unit/atomics/__hip_atomic_fetch_add.cc b/catch/unit/atomics/__hip_atomic_fetch_add.cc index ece5b62ce..014eefe75 100644 --- a/catch/unit/atomics/__hip_atomic_fetch_add.cc +++ b/catch/unit/atomics/__hip_atomic_fetch_add.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" @@ -58,7 +42,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit___hip_atomic_fetch_add_Positive_Wavefront", "", int, unsigned int, +TEMPLATE_TEST_CASE(Unit___hip_atomic_fetch_add_Positive_Wavefront, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); @@ -107,7 +91,7 @@ TEMPLATE_TEST_CASE("Unit___hip_atomic_fetch_add_Positive_Wavefront", "", int, un * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit___hip_atomic_fetch_add_Positive_Workgroup", "", int, unsigned int, +TEMPLATE_TEST_CASE(Unit___hip_atomic_fetch_add_Positive_Workgroup, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); diff --git a/catch/unit/atomics/__hip_atomic_fetch_and.cc b/catch/unit/atomics/__hip_atomic_fetch_and.cc index 22b0732df..59320c8d4 100644 --- a/catch/unit/atomics/__hip_atomic_fetch_and.cc +++ b/catch/unit/atomics/__hip_atomic_fetch_and.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "bitwise_common.hh" @@ -127,7 +111,7 @@ static void runHipAtomicFetchAndWorkgroupScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Wavefront_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_and_Positive_Wavefront_SameAddress) { SECTION("int") { runHipAtomicFetchAndWavefrontSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchAndWavefrontSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchAndWavefrontSameAddressTest(); } @@ -147,7 +131,7 @@ TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Wavefront_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Wavefront_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_and_Positive_Wavefront_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchAndWavefrontAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchAndWavefrontAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchAndWavefrontAdjacentAddressesTest(); } @@ -167,7 +151,7 @@ TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Wavefront_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Wavefront_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_and_Positive_Wavefront_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchAndWavefrontScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchAndWavefrontScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchAndWavefrontScatteredAddressesTest(); } @@ -187,7 +171,7 @@ TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Wavefront_Scattered_Addresses") * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Workgroup_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_and_Positive_Workgroup_SameAddress) { SECTION("int") { runHipAtomicFetchAndWorkgroupSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchAndWorkgroupSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchAndWorkgroupSameAddressTest(); } @@ -207,7 +191,7 @@ TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Workgroup_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Workgroup_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_and_Positive_Workgroup_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchAndWorkgroupAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchAndWorkgroupAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchAndWorkgroupAdjacentAddressesTest(); } @@ -227,7 +211,7 @@ TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Workgroup_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Workgroup_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_and_Positive_Workgroup_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchAndWorkgroupScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchAndWorkgroupScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchAndWorkgroupScatteredAddressesTest(); } diff --git a/catch/unit/atomics/__hip_atomic_fetch_max.cc b/catch/unit/atomics/__hip_atomic_fetch_max.cc index fa4bfbfa7..cb3640dd7 100644 --- a/catch/unit/atomics/__hip_atomic_fetch_max.cc +++ b/catch/unit/atomics/__hip_atomic_fetch_max.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "min_max_common.hh" @@ -127,7 +111,7 @@ static void runHipAtomicFetchMaxWorkgroupScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Wavefront_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_max_Positive_Wavefront_SameAddress) { SECTION("int") { runHipAtomicFetchMaxWavefrontSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchMaxWavefrontSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchMaxWavefrontSameAddressTest(); } @@ -149,7 +133,7 @@ TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Wavefront_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Wavefront_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_max_Positive_Wavefront_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchMaxWavefrontAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchMaxWavefrontAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchMaxWavefrontAdjacentAddressesTest(); } @@ -171,7 +155,7 @@ TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Wavefront_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Wavefront_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_max_Positive_Wavefront_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchMaxWavefrontScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchMaxWavefrontScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchMaxWavefrontScatteredAddressesTest(); } @@ -193,7 +177,7 @@ TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Wavefront_Scattered_Addresses") * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Workgroup_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_max_Positive_Workgroup_SameAddress) { SECTION("int") { runHipAtomicFetchMaxWorkgroupSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchMaxWorkgroupSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchMaxWorkgroupSameAddressTest(); } @@ -215,7 +199,7 @@ TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Workgroup_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Workgroup_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_max_Positive_Workgroup_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchMaxWorkgroupAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchMaxWorkgroupAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchMaxWorkgroupAdjacentAddressesTest(); } @@ -237,7 +221,7 @@ TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Workgroup_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Workgroup_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_max_Positive_Workgroup_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchMaxWorkgroupScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchMaxWorkgroupScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchMaxWorkgroupScatteredAddressesTest(); } diff --git a/catch/unit/atomics/__hip_atomic_fetch_min.cc b/catch/unit/atomics/__hip_atomic_fetch_min.cc index 13e5b5efc..1203d691c 100644 --- a/catch/unit/atomics/__hip_atomic_fetch_min.cc +++ b/catch/unit/atomics/__hip_atomic_fetch_min.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "min_max_common.hh" @@ -127,7 +111,7 @@ static void runHipAtomicFetchMinWorkgroupScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Wavefront_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_min_Positive_Wavefront_SameAddress) { SECTION("int") { runHipAtomicFetchMinWavefrontSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchMinWavefrontSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchMinWavefrontSameAddressTest(); } @@ -149,7 +133,7 @@ TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Wavefront_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Wavefront_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_min_Positive_Wavefront_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchMinWavefrontAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchMinWavefrontAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchMinWavefrontAdjacentAddressesTest(); } @@ -171,7 +155,7 @@ TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Wavefront_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Wavefront_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_min_Positive_Wavefront_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchMinWavefrontScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchMinWavefrontScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchMinWavefrontScatteredAddressesTest(); } @@ -193,7 +177,7 @@ TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Wavefront_Scattered_Addresses") * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Workgroup_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_min_Positive_Workgroup_SameAddress) { SECTION("int") { runHipAtomicFetchMinWorkgroupSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchMinWorkgroupSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchMinWorkgroupSameAddressTest(); } @@ -215,7 +199,7 @@ TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Workgroup_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Workgroup_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_min_Positive_Workgroup_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchMinWorkgroupAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchMinWorkgroupAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchMinWorkgroupAdjacentAddressesTest(); } @@ -237,7 +221,7 @@ TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Workgroup_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Workgroup_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_min_Positive_Workgroup_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchMinWorkgroupScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchMinWorkgroupScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchMinWorkgroupScatteredAddressesTest(); } diff --git a/catch/unit/atomics/__hip_atomic_fetch_or.cc b/catch/unit/atomics/__hip_atomic_fetch_or.cc index 2b9b3772b..2158f5b20 100644 --- a/catch/unit/atomics/__hip_atomic_fetch_or.cc +++ b/catch/unit/atomics/__hip_atomic_fetch_or.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "bitwise_common.hh" @@ -127,7 +111,7 @@ static void runHipAtomicFetchOrWorkgroupScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Wavefront_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_or_Positive_Wavefront_SameAddress) { SECTION("int") { runHipAtomicFetchOrWavefrontSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchOrWavefrontSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchOrWavefrontSameAddressTest(); } @@ -147,7 +131,7 @@ TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Wavefront_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Wavefront_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_or_Positive_Wavefront_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchOrWavefrontAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchOrWavefrontAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchOrWavefrontAdjacentAddressesTest(); } @@ -167,7 +151,7 @@ TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Wavefront_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Wavefront_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_or_Positive_Wavefront_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchOrWavefrontScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchOrWavefrontScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchOrWavefrontScatteredAddressesTest(); } @@ -187,7 +171,7 @@ TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Wavefront_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Workgroup_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_or_Positive_Workgroup_SameAddress) { SECTION("int") { runHipAtomicFetchOrWorkgroupSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchOrWorkgroupSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchOrWorkgroupSameAddressTest(); } @@ -207,7 +191,7 @@ TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Workgroup_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Workgroup_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_or_Positive_Workgroup_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchOrWorkgroupAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchOrWorkgroupAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchOrWorkgroupAdjacentAddressesTest(); } @@ -227,7 +211,7 @@ TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Workgroup_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Workgroup_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_or_Positive_Workgroup_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchOrWorkgroupScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchOrWorkgroupScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchOrWorkgroupScatteredAddressesTest(); } diff --git a/catch/unit/atomics/__hip_atomic_fetch_xor.cc b/catch/unit/atomics/__hip_atomic_fetch_xor.cc index 649b02365..c2780c3e5 100644 --- a/catch/unit/atomics/__hip_atomic_fetch_xor.cc +++ b/catch/unit/atomics/__hip_atomic_fetch_xor.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "bitwise_common.hh" @@ -127,7 +111,7 @@ static void runHipAtomicFetchXorWorkgroupScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Wavefront_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_xor_Positive_Wavefront_SameAddress) { SECTION("int") { runHipAtomicFetchXorWavefrontSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchXorWavefrontSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchXorWavefrontSameAddressTest(); } @@ -147,7 +131,7 @@ TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Wavefront_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Wavefront_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_xor_Positive_Wavefront_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchXorWavefrontAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchXorWavefrontAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchXorWavefrontAdjacentAddressesTest(); } @@ -167,7 +151,7 @@ TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Wavefront_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Wavefront_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_xor_Positive_Wavefront_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchXorWavefrontScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchXorWavefrontScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchXorWavefrontScatteredAddressesTest(); } @@ -187,7 +171,7 @@ TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Wavefront_Scattered_Addresses") * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Workgroup_SameAddress") { +TEST_CASE(Unit___hip_atomic_fetch_xor_Positive_Workgroup_SameAddress) { SECTION("int") { runHipAtomicFetchXorWorkgroupSameAddressTest(); } SECTION("unsigned int") { runHipAtomicFetchXorWorkgroupSameAddressTest(); } SECTION("unsigned long") { runHipAtomicFetchXorWorkgroupSameAddressTest(); } @@ -207,7 +191,7 @@ TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Workgroup_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Workgroup_Adjacent_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_xor_Positive_Workgroup_Adjacent_Addresses) { SECTION("int") { runHipAtomicFetchXorWorkgroupAdjacentAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchXorWorkgroupAdjacentAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchXorWorkgroupAdjacentAddressesTest(); } @@ -227,7 +211,7 @@ TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Workgroup_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Workgroup_Scattered_Addresses") { +TEST_CASE(Unit___hip_atomic_fetch_xor_Positive_Workgroup_Scattered_Addresses) { SECTION("int") { runHipAtomicFetchXorWorkgroupScatteredAddressesTest(); } SECTION("unsigned int") { runHipAtomicFetchXorWorkgroupScatteredAddressesTest(); } SECTION("unsigned long") { runHipAtomicFetchXorWorkgroupScatteredAddressesTest(); } diff --git a/catch/unit/atomics/acquire_release.cc b/catch/unit/atomics/acquire_release.cc index 7e0996f56..3c516423a 100644 --- a/catch/unit/atomics/acquire_release.cc +++ b/catch/unit/atomics/acquire_release.cc @@ -1,30 +1,14 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "memory_order_common.hh" -TEST_CASE("Unit___hip_atomic_load_store_Positive_Acquire_Release") { +TEST_CASE(Unit___hip_atomic_load_store_Positive_Acquire_Release) { SECTION("ACQUIRE/RELEASE") { SECTION("WAVEFRONT") { AcquireRelease::Test= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicAdd_Positive", "", int, unsigned int, unsigned long, +TEMPLATE_TEST_CASE(Unit_atomicAdd_Positive, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); @@ -101,7 +85,7 @@ TEMPLATE_TEST_CASE("Unit_atomicAdd_Positive", "", int, unsigned int, unsigned lo * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicAdd_Positive_Multi_Kernel", "", int, unsigned int, unsigned long, +TEMPLATE_TEST_CASE(Unit_atomicAdd_Positive_Multi_Kernel, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); @@ -136,7 +120,7 @@ TEMPLATE_TEST_CASE("Unit_atomicAdd_Positive_Multi_Kernel", "", int, unsigned int * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAdd_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicAdd_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kAtomicAdd_int, kAtomicAdd_uint, kAtomicAdd_ulong, diff --git a/catch/unit/atomics/atomicAdd_negative_kernels.cc b/catch/unit/atomics/atomicAdd_negative_kernels.cc index e0e8112cd..98d635c1b 100644 --- a/catch/unit/atomics/atomicAdd_negative_kernels.cc +++ b/catch/unit/atomics/atomicAdd_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicAdd_negative_kernels_rtc.hh b/catch/unit/atomics/atomicAdd_negative_kernels_rtc.hh index c5141d03b..0e4b181ff 100644 --- a/catch/unit/atomics/atomicAdd_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicAdd_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicAdd_system.cc b/catch/unit/atomics/atomicAdd_system.cc index 0e2a023b3..dce0ab83f 100644 --- a/catch/unit/atomics/atomicAdd_system.cc +++ b/catch/unit/atomics/atomicAdd_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" @@ -54,7 +38,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicAdd_system_Positive_Peer_GPUs", "[multigpu]", +TEMPLATE_TEST_CASE(Unit_atomicAdd_system_Positive_Peer_GPUs, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; @@ -104,7 +88,7 @@ TEMPLATE_TEST_CASE("Unit_atomicAdd_system_Positive_Peer_GPUs", "[multigpu]", * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicAdd_system_Positive_Host_And_GPU", "[multigpu]", +TEMPLATE_TEST_CASE(Unit_atomicAdd_system_Positive_Host_And_GPU, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; @@ -154,8 +138,8 @@ TEMPLATE_TEST_CASE("Unit_atomicAdd_system_Positive_Host_And_GPU", "[multigpu]", * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicAdd_system_Positive_Host_And_Peer_GPUs", - "[multigpu]", int, unsigned int, unsigned long, +TEMPLATE_TEST_CASE(Unit_atomicAdd_system_Positive_Host_And_Peer_GPUs, + int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); diff --git a/catch/unit/atomics/atomicAnd.cc b/catch/unit/atomics/atomicAnd.cc index 5b16b87f9..be69b4f17 100644 --- a/catch/unit/atomics/atomicAnd.cc +++ b/catch/unit/atomics/atomicAnd.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "atomicAnd_negative_kernels_rtc.hh" #include "bitwise_common.hh" @@ -125,7 +109,7 @@ static void runAtomicAndMultiKernelScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_Positive_SameAddress") { +TEST_CASE(Unit_atomicAnd_Positive_SameAddress) { SECTION("int") { runAtomicAndSameAddressTest(); } SECTION("unsigned int") { runAtomicAndSameAddressTest(); } SECTION("unsigned long") { runAtomicAndSameAddressTest(); } @@ -144,7 +128,7 @@ TEST_CASE("Unit_atomicAnd_Positive_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_Positive_Adjacent_Addresses") { +TEST_CASE(Unit_atomicAnd_Positive_Adjacent_Addresses) { SECTION("int") { runAtomicAndAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicAndAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicAndAdjacentAddressesTest(); } @@ -163,7 +147,7 @@ TEST_CASE("Unit_atomicAnd_Positive_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_Positive_Scattered_Addresses") { +TEST_CASE(Unit_atomicAnd_Positive_Scattered_Addresses) { SECTION("int") { runAtomicAndScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicAndScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicAndScatteredAddressesTest(); } @@ -182,7 +166,7 @@ TEST_CASE("Unit_atomicAnd_Positive_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_Positive_Multi_Kernel_Same_Address") { +TEST_CASE(Unit_atomicAnd_Positive_Multi_Kernel_Same_Address) { SECTION("int") { runAtomicAndMultiKernelSameAddressTest(); } SECTION("unsigned int") { runAtomicAndMultiKernelSameAddressTest(); } SECTION("unsigned long") { runAtomicAndMultiKernelSameAddressTest(); } @@ -201,7 +185,7 @@ TEST_CASE("Unit_atomicAnd_Positive_Multi_Kernel_Same_Address") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_Positive_Multi_Kernel_Adjacent_Addresses") { +TEST_CASE(Unit_atomicAnd_Positive_Multi_Kernel_Adjacent_Addresses) { SECTION("int") { runAtomicAndMultiKernelAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicAndMultiKernelAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicAndMultiKernelAdjacentAddressesTest(); } @@ -222,7 +206,7 @@ TEST_CASE("Unit_atomicAnd_Positive_Multi_Kernel_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_Positive_Multi_Kernel_Scattered_Addresses") { +TEST_CASE(Unit_atomicAnd_Positive_Multi_Kernel_Scattered_Addresses) { SECTION("int") { runAtomicAndMultiKernelScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicAndMultiKernelScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicAndMultiKernelScatteredAddressesTest(); } @@ -243,7 +227,7 @@ TEST_CASE("Unit_atomicAnd_Positive_Multi_Kernel_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicAnd_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = diff --git a/catch/unit/atomics/atomicAnd_negative_kernels.cc b/catch/unit/atomics/atomicAnd_negative_kernels.cc index 593399b45..da2b20581 100644 --- a/catch/unit/atomics/atomicAnd_negative_kernels.cc +++ b/catch/unit/atomics/atomicAnd_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicAnd_negative_kernels_rtc.hh b/catch/unit/atomics/atomicAnd_negative_kernels_rtc.hh index d637feb9f..0b3ea383c 100644 --- a/catch/unit/atomics/atomicAnd_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicAnd_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicAnd_system.cc b/catch/unit/atomics/atomicAnd_system.cc index 29df3346b..02abc0b70 100644 --- a/catch/unit/atomics/atomicAnd_system.cc +++ b/catch/unit/atomics/atomicAnd_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "bitwise_common.hh" @@ -85,7 +69,7 @@ static void runAtomicAndSystemScatteredAddressesTest() { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") { +TEST_CASE(Unit_atomicAnd_system_Positive_Peer_GPUs_Same_Address) { SECTION("int") { runAtomicAndSystemSameAddressTest(); } SECTION("unsigned int") { runAtomicAndSystemSameAddressTest(); } SECTION("unsigned long") { runAtomicAndSystemSameAddressTest(); } @@ -105,7 +89,7 @@ TEST_CASE("Unit_atomicAnd_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicAnd_system_Positive_Peer_GPUs_Adjacent_Addresses) { SECTION("int") { runAtomicAndSystemAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicAndSystemAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicAndSystemAdjacentAddressesTest(); } @@ -125,7 +109,7 @@ TEST_CASE("Unit_atomicAnd_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multi * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicAnd_system_Positive_Peer_GPUs_Scattered_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicAnd_system_Positive_Peer_GPUs_Scattered_Addresses) { SECTION("int") { runAtomicAndSystemScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicAndSystemScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicAndSystemScatteredAddressesTest(); } diff --git a/catch/unit/atomics/atomicCAS.cc b/catch/unit/atomics/atomicCAS.cc index 4d3558840..18d11cd3b 100644 --- a/catch/unit/atomics/atomicCAS.cc +++ b/catch/unit/atomics/atomicCAS.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" #include "atomicCAS_negative_kernels_rtc.hh" @@ -100,7 +84,7 @@ template static void runAtomicCASMultiKernelTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicCAS_Positive") { +TEST_CASE(Unit_atomicCAS_Positive) { SECTION("int") { runAtomicCASTest(); } SECTION("unsigned int") { runAtomicCASTest(); } SECTION("unsigned long long") { runAtomicCASTest(); } @@ -135,7 +119,7 @@ TEST_CASE("Unit_atomicCAS_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicCAS_Positive_Multi_Kernel") { +TEST_CASE(Unit_atomicCAS_Positive_Multi_Kernel) { SECTION("int") { runAtomicCASMultiKernelTest(); } SECTION("unsigned int") { runAtomicCASMultiKernelTest(); } SECTION("unsigned long long") { runAtomicCASMultiKernelTest(); } @@ -158,7 +142,7 @@ TEST_CASE("Unit_atomicCAS_Positive_Multi_Kernel") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicCAS_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicCAS_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kAtomicCAS_int, kAtomicCAS_uint, kAtomicCAS_ulong, diff --git a/catch/unit/atomics/atomicCAS_negative_kernels.cc b/catch/unit/atomics/atomicCAS_negative_kernels.cc index b0390bb3f..c621b47a5 100644 --- a/catch/unit/atomics/atomicCAS_negative_kernels.cc +++ b/catch/unit/atomics/atomicCAS_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicCAS_negative_kernels_rtc.hh b/catch/unit/atomics/atomicCAS_negative_kernels_rtc.hh index 952c4892f..d6d36d743 100644 --- a/catch/unit/atomics/atomicCAS_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicCAS_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicCAS_system.cc b/catch/unit/atomics/atomicCAS_system.cc index 1f60b3d6f..620510288 100644 --- a/catch/unit/atomics/atomicCAS_system.cc +++ b/catch/unit/atomics/atomicCAS_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" @@ -60,7 +44,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicCAS_system_Positive_Peer_GPUs", "[multigpu]", +TEMPLATE_TEST_CASE(Unit_atomicCAS_system_Positive_Peer_GPUs, int, unsigned int, unsigned long long, unsigned short int TYPES) { int warp_size = 0; @@ -104,7 +88,7 @@ TEMPLATE_TEST_CASE("Unit_atomicCAS_system_Positive_Peer_GPUs", "[multigpu]", * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicCAS_system_Positive_Host_And_GPU", "[multigpu]", +TEMPLATE_TEST_CASE(Unit_atomicCAS_system_Positive_Host_And_GPU, int, unsigned int, unsigned long long, unsigned short int TYPES) { int warp_size = 0; @@ -153,8 +137,8 @@ TEMPLATE_TEST_CASE("Unit_atomicCAS_system_Positive_Host_And_GPU", "[multigpu]", * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicCAS_system_Positive_Host_And_Peer_GPUs", - "[multigpu]", int, unsigned int, unsigned long long, +TEMPLATE_TEST_CASE(Unit_atomicCAS_system_Positive_Host_And_Peer_GPUs, + int, unsigned int, unsigned long long, unsigned short int TYPES) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); diff --git a/catch/unit/atomics/atomicDec.cc b/catch/unit/atomics/atomicDec.cc index c6aabe5b2..1eedf90d2 100644 --- a/catch/unit/atomics/atomicDec.cc +++ b/catch/unit/atomics/atomicDec.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" #include "atomicDec_negative_kernels_rtc.hh" @@ -56,7 +40,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicDec_Positive", "", unsigned int) { +TEMPLATE_TEST_CASE(Unit_atomicDec_Positive, unsigned int) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); const auto cache_line_size = 128u; @@ -100,7 +84,7 @@ TEMPLATE_TEST_CASE("Unit_atomicDec_Positive", "", unsigned int) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicDec_Positive_Multi_Kernel", "", unsigned int) { +TEMPLATE_TEST_CASE(Unit_atomicDec_Positive_Multi_Kernel, unsigned int) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); const auto cache_line_size = 128u; @@ -134,7 +118,7 @@ TEMPLATE_TEST_CASE("Unit_atomicDec_Positive_Multi_Kernel", "", unsigned int) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicDec_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicDec_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kAtomicDec_uint); diff --git a/catch/unit/atomics/atomicDec_negative_kernels.cc b/catch/unit/atomics/atomicDec_negative_kernels.cc index 4177ec0e7..21c97460d 100644 --- a/catch/unit/atomics/atomicDec_negative_kernels.cc +++ b/catch/unit/atomics/atomicDec_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicDec_negative_kernels_rtc.hh b/catch/unit/atomics/atomicDec_negative_kernels_rtc.hh index 88ab33d01..b6bc484df 100644 --- a/catch/unit/atomics/atomicDec_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicDec_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicExch.cc b/catch/unit/atomics/atomicExch.cc index b24592494..6d93b9ca0 100644 --- a/catch/unit/atomics/atomicExch.cc +++ b/catch/unit/atomics/atomicExch.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "atomicExch_common.hh" #include "atomicExch_negative_kernels_rtc.hh" @@ -106,7 +90,7 @@ template static void runAtomicExchMultiKernelTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicExch_Positive_Same_Address_Compile_Time") { +TEST_CASE(Unit_atomicExch_Positive_Same_Address_Compile_Time) { SECTION("int") { runAtomicExchSameAddressCompileTimeTest(); } SECTION("unsigned int") { runAtomicExchSameAddressCompileTimeTest(); } #ifndef HT_NVIDIA @@ -145,7 +129,7 @@ TEST_CASE("Unit_atomicExch_Positive_Same_Address_Compile_Time") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicExch_Positive") { +TEST_CASE(Unit_atomicExch_Positive) { SECTION("int") { runAtomicExchTest(); } SECTION("unsigned int") { runAtomicExchTest(); } #ifndef HT_NVIDIA @@ -183,7 +167,7 @@ TEST_CASE("Unit_atomicExch_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicExch_Positive_Multi_Kernel") { +TEST_CASE(Unit_atomicExch_Positive_Multi_Kernel) { SECTION("int") { runAtomicExchMultiKernelTest(); } SECTION("unsigned int") { runAtomicExchMultiKernelTest(); } #ifndef HT_NVIDIA @@ -208,7 +192,7 @@ TEST_CASE("Unit_atomicExch_Positive_Multi_Kernel") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicExch_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicExch_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kAtomicExchInt, kAtomicExchUnsignedInt, kAtomicExchULL, diff --git a/catch/unit/atomics/atomicExch_common.hh b/catch/unit/atomics/atomicExch_common.hh index bfe3c9d11..73c5ab151 100644 --- a/catch/unit/atomics/atomicExch_common.hh +++ b/catch/unit/atomics/atomicExch_common.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicExch_negative_kernels.cc b/catch/unit/atomics/atomicExch_negative_kernels.cc index 083d27747..91718af77 100644 --- a/catch/unit/atomics/atomicExch_negative_kernels.cc +++ b/catch/unit/atomics/atomicExch_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicExch_negative_kernels_rtc.hh b/catch/unit/atomics/atomicExch_negative_kernels_rtc.hh index 01387bba6..669572a17 100644 --- a/catch/unit/atomics/atomicExch_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicExch_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicExch_system.cc b/catch/unit/atomics/atomicExch_system.cc index c94569989..803bb3d25 100644 --- a/catch/unit/atomics/atomicExch_system.cc +++ b/catch/unit/atomics/atomicExch_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "atomicExch_common.hh" #include "atomicExch_system_negative_kernels_rtc.hh" @@ -116,7 +100,7 @@ template static void runAtomicExchSystemHostAndPeerGPUsTest( * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicExch_system_Positive_Peer_GPUs", "[multigpu]") { +TEST_CASE(Unit_atomicExch_system_Positive_Peer_GPUs) { SECTION("int") { runAtomicExchSystemPeerGPUsTest(); } SECTION("unsigned int") { runAtomicExchSystemPeerGPUsTest(); } #ifndef HT_NVIDIA @@ -156,7 +140,7 @@ TEST_CASE("Unit_atomicExch_system_Positive_Peer_GPUs", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicExch_system_Positive_Host_And_GPU", "[multigpu]") { +TEST_CASE(Unit_atomicExch_system_Positive_Host_And_GPU) { SECTION("int") { runAtomicExchSystemHostAndGPUTest(); } SECTION("unsigned int") { runAtomicExchSystemHostAndGPUTest(); } #ifndef HT_NVIDIA @@ -196,7 +180,7 @@ TEST_CASE("Unit_atomicExch_system_Positive_Host_And_GPU", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicExch_system_Positive_Host_And_Peer_GPUs", "[multigpu]") { +TEST_CASE(Unit_atomicExch_system_Positive_Host_And_Peer_GPUs) { SECTION("int") { runAtomicExchSystemHostAndPeerGPUsTest(); } SECTION("unsigned int") { runAtomicExchSystemHostAndPeerGPUsTest(); } #ifndef HT_NVIDIA @@ -221,7 +205,7 @@ TEST_CASE("Unit_atomicExch_system_Positive_Host_And_Peer_GPUs", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicExch_system_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicExch_system_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = diff --git a/catch/unit/atomics/atomicExch_system_negative_kernels.cc b/catch/unit/atomics/atomicExch_system_negative_kernels.cc index 15085f7da..b7afb4290 100644 --- a/catch/unit/atomics/atomicExch_system_negative_kernels.cc +++ b/catch/unit/atomics/atomicExch_system_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicExch_system_negative_kernels_rtc.hh b/catch/unit/atomics/atomicExch_system_negative_kernels_rtc.hh index 69fc31fb3..d641a1895 100644 --- a/catch/unit/atomics/atomicExch_system_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicExch_system_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicInc.cc b/catch/unit/atomics/atomicInc.cc index 2ac18e430..cea8a31b5 100644 --- a/catch/unit/atomics/atomicInc.cc +++ b/catch/unit/atomics/atomicInc.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" #include "atomicInc_negative_kernels_rtc.hh" @@ -56,7 +40,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicInc_Positive", "", unsigned int) { +TEMPLATE_TEST_CASE(Unit_atomicInc_Positive, unsigned int) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); const auto cache_line_size = 128u; @@ -100,7 +84,7 @@ TEMPLATE_TEST_CASE("Unit_atomicInc_Positive", "", unsigned int) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicInc_Positive_Multi_Kernel", "", unsigned int) { +TEMPLATE_TEST_CASE(Unit_atomicInc_Positive_Multi_Kernel, unsigned int) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); const auto cache_line_size = 128u; @@ -134,7 +118,7 @@ TEMPLATE_TEST_CASE("Unit_atomicInc_Positive_Multi_Kernel", "", unsigned int) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicInc_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicInc_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kAtomicInc_uint); diff --git a/catch/unit/atomics/atomicInc_negative_kernels.cc b/catch/unit/atomics/atomicInc_negative_kernels.cc index 8c0f9e7fb..90284117b 100644 --- a/catch/unit/atomics/atomicInc_negative_kernels.cc +++ b/catch/unit/atomics/atomicInc_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicInc_negative_kernels_rtc.hh b/catch/unit/atomics/atomicInc_negative_kernels_rtc.hh index c4ef1e91c..67bce3f06 100644 --- a/catch/unit/atomics/atomicInc_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicInc_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicMax.cc b/catch/unit/atomics/atomicMax.cc index bb2f5dccb..8e57af9e7 100644 --- a/catch/unit/atomics/atomicMax.cc +++ b/catch/unit/atomics/atomicMax.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "atomicMax_negative_kernels_rtc.hh" #include "min_max_common.hh" @@ -188,7 +172,7 @@ TEST_CASE("Unit_atomicMax_Positive_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMax_Positive_Multi_Kernel_Same_Address") { +TEST_CASE(Unit_atomicMax_Positive_Multi_Kernel_Same_Address) { SECTION("int") { runAtomicMaxMultiKernelSameAddressTest(); } SECTION("unsigned int") { runAtomicMaxMultiKernelSameAddressTest(); } SECTION("unsigned long") { runAtomicMaxMultiKernelSameAddressTest(); } @@ -209,7 +193,7 @@ TEST_CASE("Unit_atomicMax_Positive_Multi_Kernel_Same_Address") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMax_Positive_Multi_Kernel_Adjacent_Addresses") { +TEST_CASE(Unit_atomicMax_Positive_Multi_Kernel_Adjacent_Addresses) { SECTION("int") { runAtomicMaxMultiKernelAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicMaxMultiKernelAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicMaxMultiKernelAdjacentAddressesTest(); } @@ -232,7 +216,7 @@ TEST_CASE("Unit_atomicMax_Positive_Multi_Kernel_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMax_Positive_Multi_Kernel_Scattered_Addresses") { +TEST_CASE(Unit_atomicMax_Positive_Multi_Kernel_Scattered_Addresses) { SECTION("int") { runAtomicMaxMultiKernelScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicMaxMultiKernelScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicMaxMultiKernelScatteredAddressesTest(); } @@ -255,7 +239,7 @@ TEST_CASE("Unit_atomicMax_Positive_Multi_Kernel_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMax_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicMax_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kAtomicMax_int, kAtomicMax_uint, kAtomicMax_ulong, diff --git a/catch/unit/atomics/atomicMax_negative_kernels.cc b/catch/unit/atomics/atomicMax_negative_kernels.cc index 2f9b6a630..236c9d7b8 100644 --- a/catch/unit/atomics/atomicMax_negative_kernels.cc +++ b/catch/unit/atomics/atomicMax_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicMax_negative_kernels_rtc.hh b/catch/unit/atomics/atomicMax_negative_kernels_rtc.hh index 885f9f525..1c4bc0b29 100644 --- a/catch/unit/atomics/atomicMax_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicMax_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicMax_system.cc b/catch/unit/atomics/atomicMax_system.cc index b78918f4d..ebad84a47 100644 --- a/catch/unit/atomics/atomicMax_system.cc +++ b/catch/unit/atomics/atomicMax_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "min_max_common.hh" @@ -85,7 +69,7 @@ static void runAtomicMaxSystemScatteredAddressesTest() { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMax_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") { +TEST_CASE(Unit_atomicMax_system_Positive_Peer_GPUs_Same_Address) { SECTION("int") { runAtomicMaxSystemSameAddressTest(); } SECTION("unsigned int") { runAtomicMaxSystemSameAddressTest(); } SECTION("unsigned long") { runAtomicMaxSystemSameAddressTest(); } @@ -109,7 +93,7 @@ TEST_CASE("Unit_atomicMax_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMax_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicMax_system_Positive_Peer_GPUs_Adjacent_Addresses) { SECTION("int") { runAtomicMaxSystemAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicMaxSystemAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicMaxSystemAdjacentAddressesTest(); } @@ -133,7 +117,7 @@ TEST_CASE("Unit_atomicMax_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multi * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMax_system_Positive_Peer_GPUs_Scattered_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicMax_system_Positive_Peer_GPUs_Scattered_Addresses) { SECTION("int") { runAtomicMaxSystemScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicMaxSystemScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicMaxSystemScatteredAddressesTest(); } diff --git a/catch/unit/atomics/atomicMin.cc b/catch/unit/atomics/atomicMin.cc index 7d0a527a1..11a57dcd5 100644 --- a/catch/unit/atomics/atomicMin.cc +++ b/catch/unit/atomics/atomicMin.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "atomicMin_negative_kernels_rtc.hh" #include "min_max_common.hh" @@ -188,7 +172,7 @@ TEST_CASE("Unit_atomicMin_Positive_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMin_Positive_Multi_Kernel_Same_Address") { +TEST_CASE(Unit_atomicMin_Positive_Multi_Kernel_Same_Address) { SECTION("int") { runAtomicMinMultiKernelSameAddressTest(); } SECTION("unsigned int") { runAtomicMinMultiKernelSameAddressTest(); } SECTION("unsigned long") { runAtomicMinMultiKernelSameAddressTest(); } @@ -209,7 +193,7 @@ TEST_CASE("Unit_atomicMin_Positive_Multi_Kernel_Same_Address") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMin_Positive_Multi_Kernel_Adjacent_Addresses") { +TEST_CASE(Unit_atomicMin_Positive_Multi_Kernel_Adjacent_Addresses) { SECTION("int") { runAtomicMinMultiKernelAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicMinMultiKernelAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicMinMultiKernelAdjacentAddressesTest(); } @@ -232,7 +216,7 @@ TEST_CASE("Unit_atomicMin_Positive_Multi_Kernel_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMin_Positive_Multi_Kernel_Scattered_Addresses") { +TEST_CASE(Unit_atomicMin_Positive_Multi_Kernel_Scattered_Addresses) { SECTION("int") { runAtomicMinMultiKernelScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicMinMultiKernelScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicMinMultiKernelScatteredAddressesTest(); } @@ -255,7 +239,7 @@ TEST_CASE("Unit_atomicMin_Positive_Multi_Kernel_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMin_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicMin_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kAtomicMin_int, kAtomicMin_uint, kAtomicMin_ulong, diff --git a/catch/unit/atomics/atomicMin_negative_kernels.cc b/catch/unit/atomics/atomicMin_negative_kernels.cc index 644b7aaf8..ac241758c 100644 --- a/catch/unit/atomics/atomicMin_negative_kernels.cc +++ b/catch/unit/atomics/atomicMin_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicMin_negative_kernels_rtc.hh b/catch/unit/atomics/atomicMin_negative_kernels_rtc.hh index cc1ae5c7a..57a98ab3c 100644 --- a/catch/unit/atomics/atomicMin_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicMin_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicMin_system.cc b/catch/unit/atomics/atomicMin_system.cc index ebbadd389..c171e2449 100644 --- a/catch/unit/atomics/atomicMin_system.cc +++ b/catch/unit/atomics/atomicMin_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "min_max_common.hh" @@ -85,7 +69,7 @@ static void runAtomicMinSystemScatteredAddressesTest() { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMin_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") { +TEST_CASE(Unit_atomicMin_system_Positive_Peer_GPUs_Same_Address) { SECTION("int") { runAtomicMinSystemSameAddressTest(); } SECTION("unsigned int") { runAtomicMinSystemSameAddressTest(); } SECTION("unsigned long") { runAtomicMinSystemSameAddressTest(); } @@ -109,7 +93,7 @@ TEST_CASE("Unit_atomicMin_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMin_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicMin_system_Positive_Peer_GPUs_Adjacent_Addresses) { SECTION("int") { runAtomicMinSystemAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicMinSystemAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicMinSystemAdjacentAddressesTest(); } @@ -133,7 +117,7 @@ TEST_CASE("Unit_atomicMin_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multi * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicMin_system_Positive_Peer_GPUs_Scattered_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicMin_system_Positive_Peer_GPUs_Scattered_Addresses) { SECTION("int") { runAtomicMinSystemScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicMinSystemScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicMinSystemScatteredAddressesTest(); } diff --git a/catch/unit/atomics/atomicOr.cc b/catch/unit/atomics/atomicOr.cc index 692d6a025..e5a5d9069 100644 --- a/catch/unit/atomics/atomicOr.cc +++ b/catch/unit/atomics/atomicOr.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "atomicOr_negative_kernels_rtc.hh" #include "bitwise_common.hh" @@ -182,7 +166,7 @@ TEST_CASE("Unit_atomicOr_Positive_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicOr_Positive_Multi_Kernel_Same_Address") { +TEST_CASE(Unit_atomicOr_Positive_Multi_Kernel_Same_Address) { SECTION("int") { runAtomicOrMultiKernelSameAddressTest(); } SECTION("unsigned int") { runAtomicOrMultiKernelSameAddressTest(); } SECTION("unsigned long") { runAtomicOrMultiKernelSameAddressTest(); } @@ -201,7 +185,7 @@ TEST_CASE("Unit_atomicOr_Positive_Multi_Kernel_Same_Address") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicOr_Positive_Multi_Kernel_Adjacent_Addresses") { +TEST_CASE(Unit_atomicOr_Positive_Multi_Kernel_Adjacent_Addresses) { SECTION("int") { runAtomicOrMultiKernelAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicOrMultiKernelAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicOrMultiKernelAdjacentAddressesTest(); } @@ -222,7 +206,7 @@ TEST_CASE("Unit_atomicOr_Positive_Multi_Kernel_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicOr_Positive_Multi_Kernel_Scattered_Addresses") { +TEST_CASE(Unit_atomicOr_Positive_Multi_Kernel_Scattered_Addresses) { SECTION("int") { runAtomicOrMultiKernelScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicOrMultiKernelScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicOrMultiKernelScatteredAddressesTest(); } @@ -243,7 +227,7 @@ TEST_CASE("Unit_atomicOr_Positive_Multi_Kernel_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicOr_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicOr_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = diff --git a/catch/unit/atomics/atomicOr_negative_kernels.cc b/catch/unit/atomics/atomicOr_negative_kernels.cc index 47a56e3a0..6811cfa08 100644 --- a/catch/unit/atomics/atomicOr_negative_kernels.cc +++ b/catch/unit/atomics/atomicOr_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicOr_negative_kernels_rtc.hh b/catch/unit/atomics/atomicOr_negative_kernels_rtc.hh index dd4117e70..13477ba57 100644 --- a/catch/unit/atomics/atomicOr_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicOr_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicOr_system.cc b/catch/unit/atomics/atomicOr_system.cc index 91d606836..7ff5178d8 100644 --- a/catch/unit/atomics/atomicOr_system.cc +++ b/catch/unit/atomics/atomicOr_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "bitwise_common.hh" @@ -85,7 +69,7 @@ static void runAtomicOrSystemScatteredAddressesTest() { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicOr_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") { +TEST_CASE(Unit_atomicOr_system_Positive_Peer_GPUs_Same_Address) { SECTION("int") { runAtomicOrSystemSameAddressTest(); } SECTION("unsigned int") { runAtomicOrSystemSameAddressTest(); } SECTION("unsigned long") { runAtomicOrSystemSameAddressTest(); } @@ -105,7 +89,7 @@ TEST_CASE("Unit_atomicOr_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicOr_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicOr_system_Positive_Peer_GPUs_Adjacent_Addresses) { SECTION("int") { runAtomicOrSystemAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicOrSystemAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicOrSystemAdjacentAddressesTest(); } @@ -125,7 +109,7 @@ TEST_CASE("Unit_atomicOr_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multig * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicOr_system_Positive_Peer_GPUs_Scattered_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicOr_system_Positive_Peer_GPUs_Scattered_Addresses) { SECTION("int") { runAtomicOrSystemScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicOrSystemScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicOrSystemScatteredAddressesTest(); } diff --git a/catch/unit/atomics/atomicSub.cc b/catch/unit/atomics/atomicSub.cc index 05d09eef9..74bdbe036 100644 --- a/catch/unit/atomics/atomicSub.cc +++ b/catch/unit/atomics/atomicSub.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" #include "atomicSub_negative_kernels_rtc.hh" @@ -56,7 +40,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicSub_Positive", "", int, unsigned int, unsigned long, +TEMPLATE_TEST_CASE(Unit_atomicSub_Positive, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); @@ -101,7 +85,7 @@ TEMPLATE_TEST_CASE("Unit_atomicSub_Positive", "", int, unsigned int, unsigned lo * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicSub_Positive_Multi_Kernel", "", int, unsigned int, unsigned long, +TEMPLATE_TEST_CASE(Unit_atomicSub_Positive_Multi_Kernel, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); @@ -136,7 +120,7 @@ TEMPLATE_TEST_CASE("Unit_atomicSub_Positive_Multi_Kernel", "", int, unsigned int * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicSub_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicSub_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kAtomicSub_int, kAtomicSub_uint, kAtomicSub_ulong, diff --git a/catch/unit/atomics/atomicSub_negative_kernels.cc b/catch/unit/atomics/atomicSub_negative_kernels.cc index c13b243db..f177ca19f 100644 --- a/catch/unit/atomics/atomicSub_negative_kernels.cc +++ b/catch/unit/atomics/atomicSub_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicSub_negative_kernels_rtc.hh b/catch/unit/atomics/atomicSub_negative_kernels_rtc.hh index 543dba302..0591a333e 100644 --- a/catch/unit/atomics/atomicSub_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicSub_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicSub_system.cc b/catch/unit/atomics/atomicSub_system.cc index df5133493..15d69d615 100644 --- a/catch/unit/atomics/atomicSub_system.cc +++ b/catch/unit/atomics/atomicSub_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" @@ -54,7 +38,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicSub_system_Positive_Peer_GPUs", "[multigpu]", +TEMPLATE_TEST_CASE(Unit_atomicSub_system_Positive_Peer_GPUs, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; @@ -104,7 +88,7 @@ TEMPLATE_TEST_CASE("Unit_atomicSub_system_Positive_Peer_GPUs", "[multigpu]", * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicSub_system_Positive_Host_And_GPU", "[multigpu]", +TEMPLATE_TEST_CASE(Unit_atomicSub_system_Positive_Host_And_GPU, int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; @@ -154,8 +138,8 @@ TEMPLATE_TEST_CASE("Unit_atomicSub_system_Positive_Host_And_GPU", "[multigpu]", * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_atomicSub_system_Positive_Host_And_Peer_GPUs", - "[multigpu]", int, unsigned int, unsigned long, +TEMPLATE_TEST_CASE(Unit_atomicSub_system_Positive_Host_And_Peer_GPUs, + int, unsigned int, unsigned long, unsigned long long, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); diff --git a/catch/unit/atomics/atomicXor.cc b/catch/unit/atomics/atomicXor.cc index c92bb17b3..eb6503b00 100644 --- a/catch/unit/atomics/atomicXor.cc +++ b/catch/unit/atomics/atomicXor.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "atomicXor_negative_kernels_rtc.hh" #include "bitwise_common.hh" @@ -182,7 +166,7 @@ TEST_CASE("Unit_atomicXor_Positive_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicXor_Positive_Multi_Kernel_Same_Address") { +TEST_CASE(Unit_atomicXor_Positive_Multi_Kernel_Same_Address) { SECTION("int") { runAtomicXorMultiKernelSameAddressTest(); } SECTION("unsigned int") { runAtomicXorMultiKernelSameAddressTest(); } SECTION("unsigned long") { runAtomicXorMultiKernelSameAddressTest(); } @@ -201,7 +185,7 @@ TEST_CASE("Unit_atomicXor_Positive_Multi_Kernel_Same_Address") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicXor_Positive_Multi_Kernel_Adjacent_Addresses") { +TEST_CASE(Unit_atomicXor_Positive_Multi_Kernel_Adjacent_Addresses) { SECTION("int") { runAtomicXorMultiKernelAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicXorMultiKernelAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicXorMultiKernelAdjacentAddressesTest(); } @@ -222,7 +206,7 @@ TEST_CASE("Unit_atomicXor_Positive_Multi_Kernel_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicXor_Positive_Multi_Kernel_Scattered_Addresses") { +TEST_CASE(Unit_atomicXor_Positive_Multi_Kernel_Scattered_Addresses) { SECTION("int") { runAtomicXorMultiKernelScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicXorMultiKernelScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicXorMultiKernelScatteredAddressesTest(); } @@ -243,7 +227,7 @@ TEST_CASE("Unit_atomicXor_Positive_Multi_Kernel_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicXor_Negative_Parameters_RTC") { +TEST_CASE(Unit_atomicXor_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = diff --git a/catch/unit/atomics/atomicXor_negative_kernels.cc b/catch/unit/atomics/atomicXor_negative_kernels.cc index a180afd6d..821dceee6 100644 --- a/catch/unit/atomics/atomicXor_negative_kernels.cc +++ b/catch/unit/atomics/atomicXor_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomicXor_negative_kernels_rtc.hh b/catch/unit/atomics/atomicXor_negative_kernels_rtc.hh index 3d4e19c7e..f09973319 100644 --- a/catch/unit/atomics/atomicXor_negative_kernels_rtc.hh +++ b/catch/unit/atomics/atomicXor_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/atomicXor_system.cc b/catch/unit/atomics/atomicXor_system.cc index 62e6edac1..61eb3b644 100644 --- a/catch/unit/atomics/atomicXor_system.cc +++ b/catch/unit/atomics/atomicXor_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "bitwise_common.hh" @@ -85,7 +69,7 @@ static void runAtomicXorSystemScatteredAddressesTest() { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicXor_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") { +TEST_CASE(Unit_atomicXor_system_Positive_Peer_GPUs_Same_Address) { SECTION("int") { runAtomicXorSystemSameAddressTest(); } SECTION("unsigned int") { runAtomicXorSystemSameAddressTest(); } SECTION("unsigned long") { runAtomicXorSystemSameAddressTest(); } @@ -105,7 +89,7 @@ TEST_CASE("Unit_atomicXor_system_Positive_Peer_GPUs_Same_Address", "[multigpu]") * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicXor_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicXor_system_Positive_Peer_GPUs_Adjacent_Addresses) { SECTION("int") { runAtomicXorSystemAdjacentAddressesTest(); } SECTION("unsigned int") { runAtomicXorSystemAdjacentAddressesTest(); } SECTION("unsigned long") { runAtomicXorSystemAdjacentAddressesTest(); } @@ -125,7 +109,7 @@ TEST_CASE("Unit_atomicXor_system_Positive_Peer_GPUs_Adjacent_Addresses", "[multi * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_atomicXor_system_Positive_Peer_GPUs_Scattered_Addresses", "[multigpu]") { +TEST_CASE(Unit_atomicXor_system_Positive_Peer_GPUs_Scattered_Addresses) { SECTION("int") { runAtomicXorSystemScatteredAddressesTest(); } SECTION("unsigned int") { runAtomicXorSystemScatteredAddressesTest(); } SECTION("unsigned long") { runAtomicXorSystemScatteredAddressesTest(); } diff --git a/catch/unit/atomics/atomic_builtin_kernels.cc b/catch/unit/atomics/atomic_builtin_kernels.cc index b515db794..81fe1e65c 100644 --- a/catch/unit/atomics/atomic_builtin_kernels.cc +++ b/catch/unit/atomics/atomic_builtin_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/atomics/atomic_builtins.cc b/catch/unit/atomics/atomic_builtins.cc index 752f5c179..92d89e7da 100644 --- a/catch/unit/atomics/atomic_builtins.cc +++ b/catch/unit/atomics/atomic_builtins.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -80,7 +64,7 @@ void AtomicBuiltinsRTCWrapper(const char* program_source, int expected_errors_nu * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_AtomicBuiltins_Negative_Parameters_RTC") { +TEST_CASE(Unit_AtomicBuiltins_Negative_Parameters_RTC) { AtomicBuiltinsRTCWrapper(kBuiltinStore, 5, 5); AtomicBuiltinsRTCWrapper(kBuiltinLoad, 4, 4); AtomicBuiltinsRTCWrapper(kBuiltinCompExWeak, 5, 7); diff --git a/catch/unit/atomics/atomic_builtins_kernels_rtc.hh b/catch/unit/atomics/atomic_builtins_kernels_rtc.hh index 1339eaaa4..6fe759f5c 100644 --- a/catch/unit/atomics/atomic_builtins_kernels_rtc.hh +++ b/catch/unit/atomics/atomic_builtins_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/bitwise_common.hh b/catch/unit/atomics/bitwise_common.hh index 7a2c2f7f8..f0f47eec9 100644 --- a/catch/unit/atomics/bitwise_common.hh +++ b/catch/unit/atomics/bitwise_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/memory_order_common.hh b/catch/unit/atomics/memory_order_common.hh index cb98593a9..2d0794c81 100644 --- a/catch/unit/atomics/memory_order_common.hh +++ b/catch/unit/atomics/memory_order_common.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/min_max_common.hh b/catch/unit/atomics/min_max_common.hh index b28a67472..93497ca2b 100644 --- a/catch/unit/atomics/min_max_common.hh +++ b/catch/unit/atomics/min_max_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/atomics/safeAtomicAdd.cc b/catch/unit/atomics/safeAtomicAdd.cc index c3f575e1e..8b6c60a36 100644 --- a/catch/unit/atomics/safeAtomicAdd.cc +++ b/catch/unit/atomics/safeAtomicAdd.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" @@ -55,7 +39,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_safeAtomicAdd_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_safeAtomicAdd_Positive, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); const auto cache_line_size = 128u; @@ -100,7 +84,7 @@ TEMPLATE_TEST_CASE("Unit_safeAtomicAdd_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_safeAtomicAdd_Positive_Multi_Kernel", "", float, double) { +TEMPLATE_TEST_CASE(Unit_safeAtomicAdd_Positive_Multi_Kernel, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); const auto cache_line_size = 128u; diff --git a/catch/unit/atomics/safeAtomicMax.cc b/catch/unit/atomics/safeAtomicMax.cc index 3d9c726a7..6a40eb26b 100644 --- a/catch/unit/atomics/safeAtomicMax.cc +++ b/catch/unit/atomics/safeAtomicMax.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "min_max_common.hh" @@ -124,7 +108,7 @@ static void runSafeAtomicMaxMultiKernelScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMax_Positive_SameAddress") { +TEST_CASE(Unit_safeAtomicMax_Positive_SameAddress) { SECTION("float") { runSafeAtomicMaxSameAddressTest(); } SECTION("double") { runSafeAtomicMaxSameAddressTest(); } } @@ -141,7 +125,7 @@ TEST_CASE("Unit_safeAtomicMax_Positive_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMax_Positive_Adjacent_Addresses") { +TEST_CASE(Unit_safeAtomicMax_Positive_Adjacent_Addresses) { SECTION("float") { runSafeAtomicMaxAdjacentAddressesTest(); } SECTION("double") { runSafeAtomicMaxAdjacentAddressesTest(); } } @@ -158,7 +142,7 @@ TEST_CASE("Unit_safeAtomicMax_Positive_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMax_Positive_Scattered_Addresses") { +TEST_CASE(Unit_safeAtomicMax_Positive_Scattered_Addresses) { SECTION("float") { runSafeAtomicMaxScatteredAddressesTest(); } SECTION("double") { runSafeAtomicMaxScatteredAddressesTest(); } } @@ -175,7 +159,7 @@ TEST_CASE("Unit_safeAtomicMax_Positive_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMax_Positive_Multi_Kernel_Same_Address") { +TEST_CASE(Unit_safeAtomicMax_Positive_Multi_Kernel_Same_Address) { SECTION("float") { runSafeAtomicMaxMultiKernelSameAddressTest(); } SECTION("double") { runSafeAtomicMaxMultiKernelSameAddressTest(); } } @@ -192,7 +176,7 @@ TEST_CASE("Unit_safeAtomicMax_Positive_Multi_Kernel_Same_Address") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMax_Positive_Multi_Kernel_Adjacent_Addresses") { +TEST_CASE(Unit_safeAtomicMax_Positive_Multi_Kernel_Adjacent_Addresses) { SECTION("float") { runSafeAtomicMaxMultiKernelAdjacentAddressesTest(); } SECTION("double") { runSafeAtomicMaxMultiKernelAdjacentAddressesTest(); } } @@ -209,7 +193,7 @@ TEST_CASE("Unit_safeAtomicMax_Positive_Multi_Kernel_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMax_Positive_Multi_Kernel_Scattered_Addresses") { +TEST_CASE(Unit_safeAtomicMax_Positive_Multi_Kernel_Scattered_Addresses) { SECTION("float") { runSafeAtomicMaxMultiKernelScatteredAddressesTest(); } SECTION("double") { runSafeAtomicMaxMultiKernelScatteredAddressesTest(); } } diff --git a/catch/unit/atomics/safeAtomicMin.cc b/catch/unit/atomics/safeAtomicMin.cc index 36004c7bf..6df39701e 100644 --- a/catch/unit/atomics/safeAtomicMin.cc +++ b/catch/unit/atomics/safeAtomicMin.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "min_max_common.hh" @@ -124,7 +108,7 @@ static void runSafeAtomicMinMultiKernelScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMin_Positive_SameAddress") { +TEST_CASE(Unit_safeAtomicMin_Positive_SameAddress) { SECTION("float") { runSafeAtomicMinSameAddressTest(); } SECTION("double") { runSafeAtomicMinSameAddressTest(); } } @@ -141,7 +125,7 @@ TEST_CASE("Unit_safeAtomicMin_Positive_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMin_Positive_Adjacent_Addresses") { +TEST_CASE(Unit_safeAtomicMin_Positive_Adjacent_Addresses) { SECTION("float") { runSafeAtomicMinAdjacentAddressesTest(); } SECTION("double") { runSafeAtomicMinAdjacentAddressesTest(); } } @@ -158,7 +142,7 @@ TEST_CASE("Unit_safeAtomicMin_Positive_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMin_Positive_Scattered_Addresses") { +TEST_CASE(Unit_safeAtomicMin_Positive_Scattered_Addresses) { SECTION("float") { runSafeAtomicMinScatteredAddressesTest(); } SECTION("double") { runSafeAtomicMinScatteredAddressesTest(); } } @@ -175,7 +159,7 @@ TEST_CASE("Unit_safeAtomicMin_Positive_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMin_Positive_Multi_Kernel_Same_Address") { +TEST_CASE(Unit_safeAtomicMin_Positive_Multi_Kernel_Same_Address) { SECTION("float") { runSafeAtomicMinMultiKernelSameAddressTest(); } SECTION("double") { runSafeAtomicMinMultiKernelSameAddressTest(); } } @@ -192,7 +176,7 @@ TEST_CASE("Unit_safeAtomicMin_Positive_Multi_Kernel_Same_Address") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMin_Positive_Multi_Kernel_Adjacent_Addresses") { +TEST_CASE(Unit_safeAtomicMin_Positive_Multi_Kernel_Adjacent_Addresses) { SECTION("float") { runSafeAtomicMinMultiKernelAdjacentAddressesTest(); } SECTION("double") { runSafeAtomicMinMultiKernelAdjacentAddressesTest(); } } @@ -209,7 +193,7 @@ TEST_CASE("Unit_safeAtomicMin_Positive_Multi_Kernel_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_safeAtomicMin_Positive_Multi_Kernel_Scattered_Addresses") { +TEST_CASE(Unit_safeAtomicMin_Positive_Multi_Kernel_Scattered_Addresses) { SECTION("float") { runSafeAtomicMinMultiKernelScatteredAddressesTest(); } SECTION("double") { runSafeAtomicMinMultiKernelScatteredAddressesTest(); } } diff --git a/catch/unit/atomics/sequential_consistency.cc b/catch/unit/atomics/sequential_consistency.cc index c37b26487..81f3a900d 100644 --- a/catch/unit/atomics/sequential_consistency.cc +++ b/catch/unit/atomics/sequential_consistency.cc @@ -1,30 +1,14 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "memory_order_common.hh" -TEST_CASE("Unit___hip_atomic_load_store_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_load_store_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); } @@ -37,7 +21,7 @@ TEST_CASE("Unit___hip_atomic_load_store_Positive_Sequential_Consistency") { SECTION("SYSTEM") { SequentialConsistency::SystemTest(); } } -TEST_CASE("Unit___hip_atomic_exchange_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_exchange_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); } @@ -50,7 +34,7 @@ TEST_CASE("Unit___hip_atomic_exchange_Positive_Sequential_Consistency") { SECTION("SYSTEM") { SequentialConsistency::SystemTest(); } } -TEST_CASE("Unit___hip_atomic_compare_exchange_strong_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_compare_exchange_strong_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); @@ -68,7 +52,7 @@ TEST_CASE("Unit___hip_atomic_compare_exchange_strong_Positive_Sequential_Consist } } -TEST_CASE("Unit___hip_atomic_compare_exchange_weak_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_compare_exchange_weak_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); @@ -86,7 +70,7 @@ TEST_CASE("Unit___hip_atomic_compare_exchange_weak_Positive_Sequential_Consisten } } -TEST_CASE("Unit___hip_atomic_fetch_add_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_fetch_add_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); } @@ -99,7 +83,7 @@ TEST_CASE("Unit___hip_atomic_fetch_add_Positive_Sequential_Consistency") { SECTION("SYSTEM") { SequentialConsistency::SystemTest(); } } -TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_fetch_and_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); } @@ -112,7 +96,7 @@ TEST_CASE("Unit___hip_atomic_fetch_and_Positive_Sequential_Consistency") { SECTION("SYSTEM") { SequentialConsistency::SystemTest(); } } -TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_fetch_or_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); } @@ -125,7 +109,7 @@ TEST_CASE("Unit___hip_atomic_fetch_or_Positive_Sequential_Consistency") { SECTION("SYSTEM") { SequentialConsistency::SystemTest(); } } -TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_fetch_xor_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); } @@ -138,7 +122,7 @@ TEST_CASE("Unit___hip_atomic_fetch_xor_Positive_Sequential_Consistency") { SECTION("SYSTEM") { SequentialConsistency::SystemTest(); } } -TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_fetch_min_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); } @@ -151,7 +135,7 @@ TEST_CASE("Unit___hip_atomic_fetch_min_Positive_Sequential_Consistency") { SECTION("SYSTEM") { SequentialConsistency::SystemTest(); } } -TEST_CASE("Unit___hip_atomic_fetch_max_Positive_Sequential_Consistency") { +TEST_CASE(Unit___hip_atomic_fetch_max_Positive_Sequential_Consistency) { SECTION("WAVEFRONT") { SequentialConsistency::Test(); } diff --git a/catch/unit/atomics/unsafeAtomicAdd.cc b/catch/unit/atomics/unsafeAtomicAdd.cc index f36148252..24096d84d 100644 --- a/catch/unit/atomics/unsafeAtomicAdd.cc +++ b/catch/unit/atomics/unsafeAtomicAdd.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "arithmetic_common.hh" @@ -58,7 +42,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_Positive, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); const auto cache_line_size = 128u; @@ -104,7 +88,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_Positive_Multi_Kernel", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_Positive_Multi_Kernel, float, double) { int warp_size = 0; HIP_CHECK(hipDeviceGetAttribute(&warp_size, hipDeviceAttributeWarpSize, 0)); const auto cache_line_size = 128u; @@ -135,7 +119,7 @@ __global__ void unsafe_add_kernel(Type* ptr, Type val) { (void)unsafeAtomicAdd(ptr, val); } -TEMPLATE_TEST_CASE("Unit_unsafe_atomic_add_half_and_bfloat", "", __half2, __hip_bfloat162, __half, +TEMPLATE_TEST_CASE(Unit_unsafe_atomic_add_half_and_bfloat, __half2, __hip_bfloat162, __half, __hip_bfloat16) { auto kernel = unsafe_add_kernel; TestType val; diff --git a/catch/unit/atomics/unsafeAtomicMax.cc b/catch/unit/atomics/unsafeAtomicMax.cc index f3755cd8a..98fb91dc4 100644 --- a/catch/unit/atomics/unsafeAtomicMax.cc +++ b/catch/unit/atomics/unsafeAtomicMax.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "min_max_common.hh" @@ -124,7 +108,7 @@ static void runUnsafeAtomicMaxMultiKernelScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMax_Positive_SameAddress") { +TEST_CASE(Unit_unsafeAtomicMax_Positive_SameAddress) { SECTION("float") { runUnsafeAtomicMaxSameAddressTest(); } SECTION("double") { runUnsafeAtomicMaxSameAddressTest(); } } @@ -141,7 +125,7 @@ TEST_CASE("Unit_unsafeAtomicMax_Positive_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMax_Positive_Adjacent_Addresses") { +TEST_CASE(Unit_unsafeAtomicMax_Positive_Adjacent_Addresses) { SECTION("float") { runUnsafeAtomicMaxAdjacentAddressesTest(); } SECTION("double") { runUnsafeAtomicMaxAdjacentAddressesTest(); } } @@ -158,7 +142,7 @@ TEST_CASE("Unit_unsafeAtomicMax_Positive_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMax_Positive_Scattered_Addresses") { +TEST_CASE(Unit_unsafeAtomicMax_Positive_Scattered_Addresses) { SECTION("float") { runUnsafeAtomicMaxScatteredAddressesTest(); } SECTION("double") { runUnsafeAtomicMaxScatteredAddressesTest(); } } @@ -175,7 +159,7 @@ TEST_CASE("Unit_unsafeAtomicMax_Positive_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMax_Positive_Multi_Kernel_Same_Address") { +TEST_CASE(Unit_unsafeAtomicMax_Positive_Multi_Kernel_Same_Address) { SECTION("float") { runUnsafeAtomicMaxMultiKernelSameAddressTest(); } SECTION("double") { runUnsafeAtomicMaxMultiKernelSameAddressTest(); } } @@ -192,7 +176,7 @@ TEST_CASE("Unit_unsafeAtomicMax_Positive_Multi_Kernel_Same_Address") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMax_Positive_Multi_Kernel_Adjacent_Addresses") { +TEST_CASE(Unit_unsafeAtomicMax_Positive_Multi_Kernel_Adjacent_Addresses) { SECTION("float") { runUnsafeAtomicMaxMultiKernelAdjacentAddressesTest(); } SECTION("double") { runUnsafeAtomicMaxMultiKernelAdjacentAddressesTest(); } } @@ -209,7 +193,7 @@ TEST_CASE("Unit_unsafeAtomicMax_Positive_Multi_Kernel_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMax_Positive_Multi_Kernel_Scattered_Addresses") { +TEST_CASE(Unit_unsafeAtomicMax_Positive_Multi_Kernel_Scattered_Addresses) { SECTION("float") { runUnsafeAtomicMaxMultiKernelScatteredAddressesTest(); } SECTION("double") { runUnsafeAtomicMaxMultiKernelScatteredAddressesTest(); } } diff --git a/catch/unit/atomics/unsafeAtomicMin.cc b/catch/unit/atomics/unsafeAtomicMin.cc index ed8cadb18..c6c238d61 100644 --- a/catch/unit/atomics/unsafeAtomicMin.cc +++ b/catch/unit/atomics/unsafeAtomicMin.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "min_max_common.hh" @@ -124,7 +108,7 @@ static void runUnsafeAtomicMinMultiKernelScatteredAddressesTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMin_Positive_SameAddress") { +TEST_CASE(Unit_unsafeAtomicMin_Positive_SameAddress) { SECTION("float") { runUnsafeAtomicMinSameAddressTest(); } SECTION("double") { runUnsafeAtomicMinSameAddressTest(); } } @@ -141,7 +125,7 @@ TEST_CASE("Unit_unsafeAtomicMin_Positive_SameAddress") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMin_Positive_Adjacent_Addresses") { +TEST_CASE(Unit_unsafeAtomicMin_Positive_Adjacent_Addresses) { SECTION("float") { runUnsafeAtomicMinAdjacentAddressesTest(); } SECTION("double") { runUnsafeAtomicMinAdjacentAddressesTest(); } } @@ -158,7 +142,7 @@ TEST_CASE("Unit_unsafeAtomicMin_Positive_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMin_Positive_Scattered_Addresses") { +TEST_CASE(Unit_unsafeAtomicMin_Positive_Scattered_Addresses) { SECTION("float") { runUnsafeAtomicMinScatteredAddressesTest(); } SECTION("double") { runUnsafeAtomicMinScatteredAddressesTest(); } } @@ -175,7 +159,7 @@ TEST_CASE("Unit_unsafeAtomicMin_Positive_Scattered_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMin_Positive_Multi_Kernel_Same_Address") { +TEST_CASE(Unit_unsafeAtomicMin_Positive_Multi_Kernel_Same_Address) { SECTION("float") { runUnsafeAtomicMinMultiKernelSameAddressTest(); } SECTION("double") { runUnsafeAtomicMinMultiKernelSameAddressTest(); } } @@ -192,7 +176,7 @@ TEST_CASE("Unit_unsafeAtomicMin_Positive_Multi_Kernel_Same_Address") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMin_Positive_Multi_Kernel_Adjacent_Addresses") { +TEST_CASE(Unit_unsafeAtomicMin_Positive_Multi_Kernel_Adjacent_Addresses) { SECTION("float") { runUnsafeAtomicMinMultiKernelAdjacentAddressesTest(); } SECTION("double") { runUnsafeAtomicMinMultiKernelAdjacentAddressesTest(); } } @@ -209,7 +193,7 @@ TEST_CASE("Unit_unsafeAtomicMin_Positive_Multi_Kernel_Adjacent_Addresses") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_unsafeAtomicMin_Positive_Multi_Kernel_Scattered_Addresses") { +TEST_CASE(Unit_unsafeAtomicMin_Positive_Multi_Kernel_Scattered_Addresses) { SECTION("float") { runUnsafeAtomicMinMultiKernelScatteredAddressesTest(); } SECTION("double") { runUnsafeAtomicMinMultiKernelScatteredAddressesTest(); } } diff --git a/catch/unit/c_compilation/CMakeLists.txt b/catch/unit/c_compilation/CMakeLists.txt index ab4f15cba..b6c522e8c 100644 --- a/catch/unit/c_compilation/CMakeLists.txt +++ b/catch/unit/c_compilation/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC hipGetDeviceProp.cc @@ -24,13 +8,16 @@ set(TEST_SRC if(HIP_PLATFORM MATCHES "nvidia") - set(PLATFORM_DEFINE __HIP_PLATFORM_NVIDIA__) + set(PLATFORM_DEFINE __HIP_PLATFORM_NVIDIA__) + add_compile_definitions(__HIP_PLATFORM_NVIDIA__) else() - set(PLATFORM_DEFINE __HIP_PLATFORM_AMD__) + set(PLATFORM_DEFINE __HIP_PLATFORM_AMD__) + add_compile_definitions(__HIP_PLATFORM_AMD__) endif() # Creating Custom object file -add_custom_target(devprop_c_custom +if (HIP_PLATFORM MATCHES "amd") + add_custom_target(devprop_c_custom COMMAND ${CMAKE_C_COMPILER} -c -Wno-deprecated-declarations -x c ${CMAKE_CURRENT_SOURCE_DIR}/hipGetDeviceProp.c -I${HIP_INCLUDE_DIR} @@ -38,6 +25,18 @@ add_custom_target(devprop_c_custom -o hipGetDeviceProp.o BYPRODUCTS hipGetDeviceProp.o ) +else() + add_custom_target(devprop_c_custom + COMMAND ${CMAKE_C_COMPILER} + -c -Wno-deprecated-declarations -x c ${CMAKE_CURRENT_SOURCE_DIR}/hipGetDeviceProp.c + -D${PLATFORM_DEFINE} + -I${HIP_INCLUDE_DIR} + -I${CUDA_INCLUDE_DIR} + -o hipGetDeviceProp.o + BYPRODUCTS hipGetDeviceProp.o +) + +endif() add_library(devprop_c OBJECT IMPORTED) set_property(TARGET devprop_c PROPERTY IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/hipGetDeviceProp.o") @@ -46,5 +45,6 @@ hip_add_exe_to_target(NAME CTests TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests LINKER_LIBS devprop_c) +set_source_files_properties(${TEST_SRC} PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) add_dependencies(CTests devprop_c_custom) diff --git a/catch/unit/c_compilation/hipGetDeviceProp.c b/catch/unit/c_compilation/hipGetDeviceProp.c index fc295561b..1e38cf1e8 100644 --- a/catch/unit/c_compilation/hipGetDeviceProp.c +++ b/catch/unit/c_compilation/hipGetDeviceProp.c @@ -1,21 +1,8 @@ /* - * Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * */ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/c_compilation/hipGetDeviceProp.cc b/catch/unit/c_compilation/hipGetDeviceProp.cc index f7bf6d619..ece93f66a 100644 --- a/catch/unit/c_compilation/hipGetDeviceProp.cc +++ b/catch/unit/c_compilation/hipGetDeviceProp.cc @@ -1,21 +1,8 @@ /* - * Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * */ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include /** @@ -33,7 +20,7 @@ extern "C" int hipGetDeviceProp(); -TEST_CASE("Unit_hipGetDeviceProp_ctest") { +TEST_CASE(Unit_hipGetDeviceProp_ctest) { int result = hipGetDeviceProp(); REQUIRE(result == 1); } diff --git a/catch/unit/callback/CMakeLists.txt b/catch/unit/callback/CMakeLists.txt index 90cf6ab59..bbea88b3d 100644 --- a/catch/unit/callback/CMakeLists.txt +++ b/catch/unit/callback/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms @@ -29,7 +13,7 @@ set(TEST_SRC if(UNIX) set(TEST_SRC ${TEST_SRC} hipKernelNameRefByPtr.cc) - add_custom_target(SimpleKernel.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(SimpleKernel.code COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/SimpleKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/callback/SimpleKernel.code -I${HIP_INCLUDE_DIR} diff --git a/catch/unit/callback/SimpleKernel.cc b/catch/unit/callback/SimpleKernel.cc index 51aa146fc..7eac5137f 100644 --- a/catch/unit/callback/SimpleKernel.cc +++ b/catch/unit/callback/SimpleKernel.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/callback/hipApiName.cc b/catch/unit/callback/hipApiName.cc index b3a0d8d3a..6e0cd3ba0 100644 --- a/catch/unit/callback/hipApiName.cc +++ b/catch/unit/callback/hipApiName.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -45,7 +29,7 @@ const uint32_t kApiNumber{1024}; * - HIP_VERSION >= 5.2 * - Platform specific (AMD) */ -TEST_CASE("Unit_hipApiName_Positive_Basic") { +TEST_CASE(Unit_hipApiName_Positive_Basic) { int valid_api_count = 0; for (uint32_t i = 0; i < kApiNumber; ++i) { const char* api_name = hipApiName(i); @@ -75,7 +59,7 @@ TEST_CASE("Unit_hipApiName_Positive_Basic") { * - HIP_VERSION >= 5.2 * - Platform specific (AMD) */ -TEST_CASE("Unit_hipApiName_Negative_ReservedIds") { +TEST_CASE(Unit_hipApiName_Negative_ReservedIds) { REQUIRE_THAT(hipApiName(std::numeric_limits::min()), Catch::Matchers::Equals(kUnknownApi)); REQUIRE_THAT(hipApiName(std::numeric_limits::max()), diff --git a/catch/unit/callback/hipGetStreamDeviceId.cc b/catch/unit/callback/hipGetStreamDeviceId.cc index c01433679..5ec0e53be 100644 --- a/catch/unit/callback/hipGetStreamDeviceId.cc +++ b/catch/unit/callback/hipGetStreamDeviceId.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -43,7 +27,7 @@ THE SOFTWARE. * - HIP_VERSION >= 5.2 * - Platform specific (AMD) */ -TEST_CASE("Unit_hipGetStreamDeviceId_Positive_Threaded_Basic") { +TEST_CASE(Unit_hipGetStreamDeviceId_Positive_Threaded_Basic) { int id = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(id)); @@ -65,8 +49,7 @@ TEST_CASE("Unit_hipGetStreamDeviceId_Positive_Threaded_Basic") { * - Platform specific (AMD) * - Multithreaded GPU */ -TEST_CASE("Unit_hipGetStreamDeviceId_Positive_Multithreaded_Basic", - "[multigpu]") { +TEST_CASE(Unit_hipGetStreamDeviceId_Positive_Multithreaded_Basic) { const unsigned int max_threads = std::thread::hardware_concurrency(); const int device_count = HipTest::getDeviceCount(); @@ -103,7 +86,7 @@ TEST_CASE("Unit_hipGetStreamDeviceId_Positive_Multithreaded_Basic", * - HIP_VERSION >= 5.2 * - Platform specific (AMD) */ -TEST_CASE("Unit_hipGetStreamDeviceId_Negative_Parameters") { +TEST_CASE(Unit_hipGetStreamDeviceId_Negative_Parameters) { int id = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(id)); diff --git a/catch/unit/callback/hipKernelNameRef.cc b/catch/unit/callback/hipKernelNameRef.cc index ccf835004..9cefd1391 100644 --- a/catch/unit/callback/hipKernelNameRef.cc +++ b/catch/unit/callback/hipKernelNameRef.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -43,7 +27,7 @@ THE SOFTWARE. * - HIP_VERSION >= 5.2 * - Platform specific (AMD) */ -TEST_CASE("Unit_hipKernelNameRef_Positive_Basic") { +TEST_CASE(Unit_hipKernelNameRef_Positive_Basic) { hipModule_t kernel_module{nullptr}; hipFunction_t kernel_function{nullptr}; @@ -65,7 +49,7 @@ TEST_CASE("Unit_hipKernelNameRef_Positive_Basic") { * - HIP_VERSION >= 5.2 * - Platform specific (AMD) */ -TEST_CASE("Unit_hipKernelNameRef_Negative_Parameters") { +TEST_CASE(Unit_hipKernelNameRef_Negative_Parameters) { hipFunction_t kernel_function{nullptr}; REQUIRE(hipKernelNameRef(kernel_function) == nullptr); } diff --git a/catch/unit/callback/hipKernelNameRefByPtr.cc b/catch/unit/callback/hipKernelNameRefByPtr.cc index 841c35932..c9f7fe896 100644 --- a/catch/unit/callback/hipKernelNameRefByPtr.cc +++ b/catch/unit/callback/hipKernelNameRefByPtr.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -45,7 +29,7 @@ __global__ void test_kernel() { return; } * - HIP_VERSION >= 5.2 * - Platform specific (AMD) */ -TEST_CASE("Unit_hipKernelNameRefByPtr_Positive_Basic") { +TEST_CASE(Unit_hipKernelNameRefByPtr_Positive_Basic) { const void* kernel_ptr{reinterpret_cast(&test_kernel)}; StreamGuard stream_guard{Streams::created}; @@ -67,7 +51,7 @@ TEST_CASE("Unit_hipKernelNameRefByPtr_Positive_Basic") { * - HIP_VERSION >= 5.2 * - Platform specific (AMD) */ -TEST_CASE("Unit_hipKernelNameRefByPtr_Positive_StreamNullptr") { +TEST_CASE(Unit_hipKernelNameRefByPtr_Positive_StreamNullptr) { const void* kernel_ptr{reinterpret_cast(&test_kernel)}; StreamGuard stream_guard{Streams::nullstream}; @@ -92,7 +76,7 @@ TEST_CASE("Unit_hipKernelNameRefByPtr_Positive_StreamNullptr") { * - HIP_VERSION >= 5.2 * - Platform specific (AMD) */ -TEST_CASE("Unit_hipKernelNameRefByPtr_Negative_KernelNullptr") { +TEST_CASE(Unit_hipKernelNameRefByPtr_Negative_KernelNullptr) { const void* kernel_ptr{nullptr}; SECTION("stream is nullptr") { diff --git a/catch/unit/channelDescriptor/CMakeLists.txt b/catch/unit/channelDescriptor/CMakeLists.txt index 50970c6ce..d485cd2b2 100644 --- a/catch/unit/channelDescriptor/CMakeLists.txt +++ b/catch/unit/channelDescriptor/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC channel_descriptor.cc diff --git a/catch/unit/channelDescriptor/channel_descriptor.cc b/catch/unit/channelDescriptor/channel_descriptor.cc index 5bd1b2d28..fa0a45fd8 100644 --- a/catch/unit/channelDescriptor/channel_descriptor.cc +++ b/catch/unit/channelDescriptor/channel_descriptor.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "channel_descriptor_common.hh" @@ -45,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_Basic_1D", "", char, unsigned char, uchar1, +TEMPLATE_TEST_CASE(Unit_ChannelDescriptor_Positive_Basic_1D, char, unsigned char, uchar1, signed char, char1, unsigned short, ushort1, short, signed short, short1, int, unsigned int, uint1, signed int, int1, float, float1, long, unsigned long, ulong1, signed long, long1) { @@ -71,7 +58,7 @@ TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_Basic_1D", "", char, unsigne * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_Basic_2D", "", uchar2, char2, ushort2, short2, +TEMPLATE_TEST_CASE(Unit_ChannelDescriptor_Positive_Basic_2D, uchar2, char2, ushort2, short2, uint2, int2, float2, ulong2, long2) { ChannelDescriptorTest2D channel_desc_test; channel_desc_test.Run(); @@ -97,7 +84,7 @@ TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_Basic_2D", "", uchar2, char2 * - HIP_VERSION >= 5.2 * - Available for non-GNUC compilers. */ -TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_Basic_3D", "", uchar3, char3, ushort3, short3, +TEMPLATE_TEST_CASE(Unit_ChannelDescriptor_Positive_Basic_3D, uchar3, char3, ushort3, short3, uint3, int3, float3, ulong3, long3) { ChannelDescriptorTest3D channel_desc_test; channel_desc_test.Run(); @@ -122,7 +109,7 @@ TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_Basic_3D", "", uchar3, char3 * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_Basic_4D", "", uchar4, char4, ushort4, short4, +TEMPLATE_TEST_CASE(Unit_ChannelDescriptor_Positive_Basic_4D, uchar4, char4, ushort4, short4, uint4, int4, float4, ulong4, long4) { ChannelDescriptorTest4D channel_desc_test; channel_desc_test.Run(); @@ -143,7 +130,7 @@ TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_Basic_4D", "", uchar4, char4 * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_FormatNone", "", long long, signed long long, +TEMPLATE_TEST_CASE(Unit_ChannelDescriptor_Positive_FormatNone, long long, signed long long, unsigned long long, longlong1, longlong2, longlong3, longlong4, ulonglong1, ulonglong2, ulonglong3, ulonglong4, double1, double2, double3, double4) { ChannelDescriptorTestNone channel_desc_test; @@ -166,7 +153,7 @@ TEMPLATE_TEST_CASE("Unit_ChannelDescriptor_Positive_FormatNone", "", long long, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_ChannelDescriptor_Positive_16BitFloatingPoint") { +TEST_CASE(Unit_ChannelDescriptor_Positive_16BitFloatingPoint) { int size = static_cast(sizeof(unsigned short) * 8); hipChannelFormatKind kind = hipChannelFormatKindFloat; hipChannelFormatDesc channel_desc{}; diff --git a/catch/unit/channelDescriptor/channel_descriptor_common.hh b/catch/unit/channelDescriptor/channel_descriptor_common.hh index 332075a5b..516209a80 100644 --- a/catch/unit/channelDescriptor/channel_descriptor_common.hh +++ b/catch/unit/channelDescriptor/channel_descriptor_common.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/clock/CMakeLists.txt b/catch/unit/clock/CMakeLists.txt index c181f1a76..479f2c5a5 100644 --- a/catch/unit/clock/CMakeLists.txt +++ b/catch/unit/clock/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms diff --git a/catch/unit/clock/hipClockCheck.cc b/catch/unit/clock/hipClockCheck.cc index 3bf2c4a58..f4a6ec3fb 100644 --- a/catch/unit/clock/hipClockCheck.cc +++ b/catch/unit/clock/hipClockCheck.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -144,7 +131,7 @@ void execute_clock_kernels(void (*kernel)(long long*, long long*, float*, float* REQUIRE(clock_start < clock_end); } -TEST_CASE("Unit_hipClock64_Positive_Basic") { +TEST_CASE(Unit_hipClock64_Positive_Basic) { if (IsGfx11()) { HipTest::HIP_SKIP_TEST("Issue with clock64() function on gfx11 devices!"); return; @@ -166,7 +153,7 @@ TEST_CASE("Unit_hipClock64_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipClock_Positive_Basic") { +TEST_CASE(Unit_hipClock_Positive_Basic) { if (IsGfx11()) { HipTest::HIP_SKIP_TEST("Issue with clock() function on gfx11 devices!"); return; @@ -175,7 +162,7 @@ TEST_CASE("Unit_hipClock_Positive_Basic") { execute_clock_kernels(reduce_c); } -TEST_CASE("Unit_hipWallClock64_Positive_Basic") { execute_clock_kernels(reduce_wc64); } +TEST_CASE(Unit_hipWallClock64_Positive_Basic) { execute_clock_kernels(reduce_wc64); } /** * End doxygen group DeviceLanguageTest. diff --git a/catch/unit/compileAndCaptureOutput.py b/catch/unit/compileAndCaptureOutput.py index 449a0de05..6eadeb90a 100644 --- a/catch/unit/compileAndCaptureOutput.py +++ b/catch/unit/compileAndCaptureOutput.py @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT import subprocess import sys diff --git a/catch/unit/compiler/CMakeLists.txt b/catch/unit/compiler/CMakeLists.txt index 5dbf9a6fc..c07482924 100644 --- a/catch/unit/compiler/CMakeLists.txt +++ b/catch/unit/compiler/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC hipClassKernel.cc diff --git a/catch/unit/compiler/hipClassKernel.cc b/catch/unit/compiler/hipClassKernel.cc index 39cee07da..94f039789 100644 --- a/catch/unit/compiler/hipClassKernel.cc +++ b/catch/unit/compiler/hipClassKernel.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hipClassKernel.h" @@ -34,7 +18,7 @@ __global__ void ovldClassKernel(bool* result_ecd) { result_ecd[tid] = (tfo1.func1(10) == 20) && (tfo1.func1(10, 10) == 30); } -TEST_CASE("Unit_hipClassKernel_Overload_Override") { +TEST_CASE(Unit_hipClassKernel_Overload_Override) { bool *result_ecd, *result_ech; result_ech = AllocateHostMemory(); result_ecd = AllocateDeviceMemory(); @@ -60,7 +44,7 @@ __global__ void friendClassKernel(bool* result_ecd) { result_ecd[tid] = (tfb1.showA() == 10); } -TEST_CASE("Unit_hipClassKernel_Friend") { +TEST_CASE(Unit_hipClassKernel_Friend) { bool* result_ecd; result_ecd = AllocateDeviceMemory(); hipLaunchKernelGGL(friendClassKernel, dim3(BLOCKS), dim3(THREADS_PER_BLOCK), 0, 0, result_ecd); @@ -75,7 +59,7 @@ __global__ void emptyClassKernel(bool* result_ecd) { result_ecd[tid] = (sizeof(testClassEmpty) == 1) && (&ob1 != &ob2); } -TEST_CASE("Unit_hipClassKernel_Empty") { +TEST_CASE(Unit_hipClassKernel_Empty) { bool *result_ecd, *result_ech; result_ech = AllocateHostMemory(); result_ecd = AllocateDeviceMemory(); @@ -94,7 +78,7 @@ __global__ void sizeClassBKernel(bool* result_ecd) { (sizeof(testSizeP3) == 8); } -TEST_CASE("Unit_hipClassKernel_BSize") { +TEST_CASE(Unit_hipClassKernel_BSize) { bool *result_ecd, *result_ech; result_ech = AllocateHostMemory(); result_ecd = AllocateDeviceMemory(); @@ -111,7 +95,7 @@ __global__ void sizeClassKernel(bool* result_ecd) { (sizeof(testSizeDerived2) == 20); } -TEST_CASE("Unit_hipClassKernel_Size") { +TEST_CASE(Unit_hipClassKernel_Size) { bool *result_ecd, *result_ech; result_ech = AllocateHostMemory(); result_ecd = AllocateDeviceMemory(); @@ -131,7 +115,7 @@ __global__ void sizeVirtualClassKernel(bool* result_ecd, refStructSizes structSi (structSizes.sizeOftestSizeDerMulti = sizeof(testSizeDerMulti)); } -TEST_CASE("Unit_hipClassKernel_Virtual") { +TEST_CASE(Unit_hipClassKernel_Virtual) { bool *result_ecd, *result_ech; result_ech = AllocateHostMemory(); result_ecd = AllocateDeviceMemory(); @@ -156,7 +140,7 @@ __global__ void passByValueKernel(testPassByValue obj, bool* result_ecd) { result_ecd[tid] = (obj.exI == 10) && (obj.exC == 'C'); } -TEST_CASE("Unit_hipClassKernel_Value") { +TEST_CASE(Unit_hipClassKernel_Value) { bool *result_ecd, *result_ech; result_ech = AllocateHostMemory(); result_ecd = AllocateDeviceMemory(); diff --git a/catch/unit/compiler/hipClassKernel.h b/catch/unit/compiler/hipClassKernel.h index 674f0c381..50a2b534f 100644 --- a/catch/unit/compiler/hipClassKernel.h +++ b/catch/unit/compiler/hipClassKernel.h @@ -1,24 +1,9 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #ifndef _COMPILER_HIPCLASSKERNEL_H_ #define _COMPILER_HIPCLASSKERNEL_H_ diff --git a/catch/unit/compiler/hipSpirvTest.cc b/catch/unit/compiler/hipSpirvTest.cc index cd54350fd..465cb9e63 100644 --- a/catch/unit/compiler/hipSpirvTest.cc +++ b/catch/unit/compiler/hipSpirvTest.cc @@ -1,28 +1,12 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include __global__ void kernel() { asm volatile("v_nop" ::: "memory"); } // This test case compiles with --offload-arch=amdgcnspirv to verify SPIRV mode -TEST_CASE("Unit_test_spirv_mode") { kernel<<<1, 32>>>(); } \ No newline at end of file +TEST_CASE(Unit_test_spirv_mode) { kernel<<<1, 32>>>(); } \ No newline at end of file diff --git a/catch/unit/compiler/hipSquare.cc b/catch/unit/compiler/hipSquare.cc index dd7dc3dfe..a73eac4e5 100644 --- a/catch/unit/compiler/hipSquare.cc +++ b/catch/unit/compiler/hipSquare.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2024 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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 /* @@ -33,7 +18,7 @@ template __global__ void vector_square(T* C_d, const T* A_d, size_t } } -TEST_CASE("Unit_test_compressed_codeobject") { +TEST_CASE(Unit_test_compressed_codeobject) { float *A_d, *C_d; float *A_h, *C_h; size_t N = 1000000; diff --git a/catch/unit/compiler/hipSquareGenericTarget.cc b/catch/unit/compiler/hipSquareGenericTarget.cc index 35d0d20a6..be20ac693 100644 --- a/catch/unit/compiler/hipSquareGenericTarget.cc +++ b/catch/unit/compiler/hipSquareGenericTarget.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2024 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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 /* @@ -34,9 +19,9 @@ template static __global__ void vector_square_generic(T* C_d, const } #ifdef GENERIC_COMPRESSED -TEST_CASE("Unit_test_generic_target_in_compressed_fatbin") { +TEST_CASE(Unit_test_generic_target_in_compressed_fatbin) { #else -TEST_CASE("Unit_test_generic_target_in_regular_fatbin") { +TEST_CASE(Unit_test_generic_target_in_regular_fatbin) { #endif if (!isGenericTargetSupported()) { fprintf(stderr, "Generic target test is skipped\n"); @@ -97,7 +82,7 @@ TEST_CASE("Unit_test_generic_target_in_regular_fatbin") { #ifndef NO_GENERIC_TARGET_ONLY_TEST #ifdef GENERIC_COMPRESSED -TEST_CASE("Unit_test_generic_target_only_in_compressed_fatbin") { +TEST_CASE(Unit_test_generic_target_only_in_compressed_fatbin) { #ifdef __linux__ const char* cmd = "chmod u+x ./hipSquareGenericTargetOnlyCompressed && ./hipSquareGenericTargetOnlyCompressed"; @@ -105,7 +90,7 @@ TEST_CASE("Unit_test_generic_target_only_in_compressed_fatbin") { const char* cmd = "hipSquareGenericTargetOnlyCompressed.exe"; #endif #else // else GENERIC_COMPRESSED -TEST_CASE("Unit_test_generic_target_only_in_regular_fatbin") { +TEST_CASE(Unit_test_generic_target_only_in_regular_fatbin) { #ifdef __linux__ const char* cmd = "chmod u+x ./hipSquareGenericTargetOnly && ./hipSquareGenericTargetOnly"; #else diff --git a/catch/unit/complex/CMakeLists.txt b/catch/unit/complex/CMakeLists.txt index 21a1d2e2f..74bd8f9ab 100644 --- a/catch/unit/complex/CMakeLists.txt +++ b/catch/unit/complex/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms @@ -35,7 +19,7 @@ hip_add_exe_to_target(NAME ComplexTest TEST_TARGET_NAME build_tests LINKER_LIBS ${LINKER_LIBS}) if(UNIX) -file(GLOB NEGATIVE_TEST_SRC + file(GLOB NEGATIVE_TEST_SRC "complex_make_negative_kernels.cc" "complex_cast_negative_kernels.cc" "complex_negative_kernels_1Arg_float.cc" @@ -45,41 +29,41 @@ file(GLOB NEGATIVE_TEST_SRC "complex_negative_kernels_3Arg.cc" ) -file(COPY ${NEGATIVE_TEST_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src) -set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC}) + file(COPY ${NEGATIVE_TEST_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src) + set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC}) -#add_test(NAME Unit_Device_Complex_make_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# complex_make_negative_kernels.cc 54) -# -#add_test(NAME Unit_Device_Complex_Cast_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# complex_cast_negative_kernels.cc 28) -# -#add_test(NAME Unit_Device_Complex_Unary_float_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# complex_negative_kernels_1Arg_float.cc 62) -# -#add_test(NAME Unit_Device_Complex_Unary_double_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# complex_negative_kernels_1Arg_double.cc 62) -# -#add_test(NAME Unit_Device_Complex_Binary_float_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# complex_negative_kernels_2Arg_float.cc 88) -# -#add_test(NAME Unit_Device_Complex_Binary_double_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# complex_negative_kernels_2Arg_double.cc 88) -# -#add_test(NAME Unit_Device_Complex_hipCfma_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# complex_negative_kernels_3Arg.cc 60) + #add_test(NAME Unit_Device_Complex_make_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # complex_make_negative_kernels.cc 54) + # + #add_test(NAME Unit_Device_Complex_Cast_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # complex_cast_negative_kernels.cc 28) + # + #add_test(NAME Unit_Device_Complex_Unary_float_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # complex_negative_kernels_1Arg_float.cc 62) + # + #add_test(NAME Unit_Device_Complex_Unary_double_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # complex_negative_kernels_1Arg_double.cc 62) + # + #add_test(NAME Unit_Device_Complex_Binary_float_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # complex_negative_kernels_2Arg_float.cc 88) + # + #add_test(NAME Unit_Device_Complex_Binary_double_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # complex_negative_kernels_2Arg_double.cc 88) + # + #add_test(NAME Unit_Device_Complex_hipCfma_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # complex_negative_kernels_3Arg.cc 60) endif() diff --git a/catch/unit/complex/complex.cc b/catch/unit/complex/complex.cc index 5619f79ae..af3b42e47 100644 --- a/catch/unit/complex/complex.cc +++ b/catch/unit/complex/complex.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "complex_function_common.hh" #include "complex_cast_negative_kernels_rtc.hh" @@ -50,7 +37,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_Complex_Unary_Device_Sanity_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_Complex_Unary_Device_Sanity_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input_r = GENERATE(-4.75, 0, 1.75); decltype(TestType().x) input_i = GENERATE(-4.75, 0, 1.75); @@ -83,7 +70,7 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_Unary_Device_Sanity_Positive", "", hipFl * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_Complex_Unary_Host_Sanity_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_Complex_Unary_Host_Sanity_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input_r = GENERATE(-4.75, 0, 1.75); decltype(TestType().x) input_i = GENERATE(-4.75, 0, 1.75); @@ -115,7 +102,7 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_Unary_Host_Sanity_Positive", "", hipFloa * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_Complex_Binary_Device_Sanity_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_Complex_Binary_Device_Sanity_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input1_r = GENERATE(-4.75, 0, 1.75); decltype(TestType().x) input1_i = GENERATE(-4.75, 0, 1.75); @@ -149,7 +136,7 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_Binary_Device_Sanity_Positive", "", hipF * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_Complex_Binary_Host_Sanity_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_Complex_Binary_Host_Sanity_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input1_r = GENERATE(-4.75, 0, 1.75); decltype(TestType().x) input1_i = GENERATE(-4.75, 0, 1.75); @@ -179,7 +166,7 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_Binary_Host_Sanity_Positive", "", hipFlo * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_Complex_hipCfma_Device_Sanity_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_Complex_hipCfma_Device_Sanity_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input1_r = GENERATE(-4.75, 0, 1.75); decltype(TestType().x) input1_i = GENERATE(-4.75, 0, 1.75); @@ -208,7 +195,7 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_hipCfma_Device_Sanity_Positive", "", hip * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_Complex_hipCfma_Host_Sanity_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_Complex_hipCfma_Host_Sanity_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input1_r = GENERATE(-4.75, 0, 1.75); decltype(TestType().x) input1_i = GENERATE(-4.75, 0, 1.75); @@ -237,7 +224,7 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_hipCfma_Host_Sanity_Positive", "", hipFl * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_make_Complex_Device_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_make_Complex_Device_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input_r = GENERATE(-0.25, 0, 0.25); decltype(TestType().x) input_i = GENERATE(-1.75, 0, 1.75); @@ -266,7 +253,7 @@ TEMPLATE_TEST_CASE("Unit_Device_make_Complex_Device_Positive", "", hipFloatCompl * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_make_Complex_Host_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_make_Complex_Host_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input_r = GENERATE(-0.25, 0, 0.25); decltype(TestType().x) input_i = GENERATE(-1.75, 0, 1.75); @@ -291,7 +278,7 @@ TEMPLATE_TEST_CASE("Unit_Device_make_Complex_Host_Positive", "", hipFloatComplex * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_make_hipComplex_Device_Positive") { +TEST_CASE(Unit_Device_make_hipComplex_Device_Positive) { float input_r = GENERATE(-0.25, 0, 0.25); float input_i = GENERATE(-1.75, 0, 1.75); @@ -319,7 +306,7 @@ TEST_CASE("Unit_Device_make_hipComplex_Device_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_make_hipComplex_Host_Positive") { +TEST_CASE(Unit_Device_make_hipComplex_Host_Positive) { float input_r = GENERATE(-0.25, 0, 0.25); float input_i = GENERATE(-1.75, 0, 1.75); @@ -343,7 +330,7 @@ TEST_CASE("Unit_Device_make_hipComplex_Host_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_Complex_Cast_Device_Sanity_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_Complex_Cast_Device_Sanity_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input_r = GENERATE(-0.25, 0, 0.25); decltype(TestType().x) input_i = GENERATE(-1.75, 0, 1.75); @@ -376,7 +363,7 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_Cast_Device_Sanity_Positive", "", hipFlo * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_Complex_Cast_Host_Sanity_Positive", "", hipFloatComplex, +TEMPLATE_TEST_CASE(Unit_Device_Complex_Cast_Host_Sanity_Positive, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input_r = GENERATE(-0.25, 0, 0.25); decltype(TestType().x) input_i = GENERATE(-1.75, 0, 1.75); @@ -401,7 +388,7 @@ TEMPLATE_TEST_CASE("Unit_Device_Complex_Cast_Host_Sanity_Positive", "", hipFloat * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_Complex_Constructor_Host", "", hipFloatComplex, hipDoubleComplex) { +TEMPLATE_TEST_CASE(Unit_Device_Complex_Constructor_Host, hipFloatComplex, hipDoubleComplex) { decltype(TestType().x) input_r = GENERATE(-0.25, 0.25); TestType input{input_r}; diff --git a/catch/unit/complex/complex_basic_common.hh b/catch/unit/complex/complex_basic_common.hh index f2471ea74..16966ba60 100644 --- a/catch/unit/complex/complex_basic_common.hh +++ b/catch/unit/complex/complex_basic_common.hh @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #pragma once #include diff --git a/catch/unit/complex/complex_cast_negative_kernels.cc b/catch/unit/complex/complex_cast_negative_kernels.cc index 23b070020..66cc5c8de 100644 --- a/catch/unit/complex/complex_cast_negative_kernels.cc +++ b/catch/unit/complex/complex_cast_negative_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/complex/complex_cast_negative_kernels_rtc.hh b/catch/unit/complex/complex_cast_negative_kernels_rtc.hh index c2ef7bef8..bf4b9f777 100644 --- a/catch/unit/complex/complex_cast_negative_kernels_rtc.hh +++ b/catch/unit/complex/complex_cast_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/complex/complex_function_common.hh b/catch/unit/complex/complex_function_common.hh index 2cecfc9b2..14cbcbce5 100644 --- a/catch/unit/complex/complex_function_common.hh +++ b/catch/unit/complex/complex_function_common.hh @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #pragma once #include "complex_basic_common.hh" diff --git a/catch/unit/complex/complex_make_negative_kernels.cc b/catch/unit/complex/complex_make_negative_kernels.cc index e18943f6f..d3ec062d9 100644 --- a/catch/unit/complex/complex_make_negative_kernels.cc +++ b/catch/unit/complex/complex_make_negative_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/complex/complex_make_negative_kernels_rtc.hh b/catch/unit/complex/complex_make_negative_kernels_rtc.hh index c643d02c0..15ff0b576 100644 --- a/catch/unit/complex/complex_make_negative_kernels_rtc.hh +++ b/catch/unit/complex/complex_make_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/complex/complex_negative_kernels_1Arg_double.cc b/catch/unit/complex/complex_negative_kernels_1Arg_double.cc index 31ff6ce5b..e756d6953 100644 --- a/catch/unit/complex/complex_negative_kernels_1Arg_double.cc +++ b/catch/unit/complex/complex_negative_kernels_1Arg_double.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/complex/complex_negative_kernels_1Arg_float.cc b/catch/unit/complex/complex_negative_kernels_1Arg_float.cc index 381ea35c0..5c4158074 100644 --- a/catch/unit/complex/complex_negative_kernels_1Arg_float.cc +++ b/catch/unit/complex/complex_negative_kernels_1Arg_float.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/complex/complex_negative_kernels_1Arg_rtc.hh b/catch/unit/complex/complex_negative_kernels_1Arg_rtc.hh index 14b84d6bb..56e693db1 100644 --- a/catch/unit/complex/complex_negative_kernels_1Arg_rtc.hh +++ b/catch/unit/complex/complex_negative_kernels_1Arg_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/complex/complex_negative_kernels_2Arg_double.cc b/catch/unit/complex/complex_negative_kernels_2Arg_double.cc index c3e29c812..5546f8c0e 100644 --- a/catch/unit/complex/complex_negative_kernels_2Arg_double.cc +++ b/catch/unit/complex/complex_negative_kernels_2Arg_double.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/complex/complex_negative_kernels_2Arg_float.cc b/catch/unit/complex/complex_negative_kernels_2Arg_float.cc index 5979155ae..1974172a5 100644 --- a/catch/unit/complex/complex_negative_kernels_2Arg_float.cc +++ b/catch/unit/complex/complex_negative_kernels_2Arg_float.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/complex/complex_negative_kernels_2Arg_rtc.hh b/catch/unit/complex/complex_negative_kernels_2Arg_rtc.hh index f3576a1ec..5f5566c4c 100644 --- a/catch/unit/complex/complex_negative_kernels_2Arg_rtc.hh +++ b/catch/unit/complex/complex_negative_kernels_2Arg_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/complex/complex_negative_kernels_3Arg.cc b/catch/unit/complex/complex_negative_kernels_3Arg.cc index ce26e50af..e5e0b407b 100644 --- a/catch/unit/complex/complex_negative_kernels_3Arg.cc +++ b/catch/unit/complex/complex_negative_kernels_3Arg.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/complex/complex_negative_kernels_3Arg_rtc.hh b/catch/unit/complex/complex_negative_kernels_3Arg_rtc.hh index caf12a31c..7d3bedcf1 100644 --- a/catch/unit/complex/complex_negative_kernels_3Arg_rtc.hh +++ b/catch/unit/complex/complex_negative_kernels_3Arg_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/context/CMakeLists.txt b/catch/unit/context/CMakeLists.txt index 3ab58901b..b9b57b377 100644 --- a/catch/unit/context/CMakeLists.txt +++ b/catch/unit/context/CMakeLists.txt @@ -1,23 +1,7 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. -# Common Tests - Test independent of all platforms +# SPDX-License-Identifier: MIT + set(TEST_SRC hipDrvGetPCIBusId.cc hipDrvMemcpy.cc diff --git a/catch/unit/context/hipCtxActivate.cc b/catch/unit/context/hipCtxActivate.cc index 5a959b02a..ba55b1d2e 100644 --- a/catch/unit/context/hipCtxActivate.cc +++ b/catch/unit/context/hipCtxActivate.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/context/hipCtxNotSupported.cc b/catch/unit/context/hipCtxNotSupported.cc index cf6392bc0..d2066df99 100644 --- a/catch/unit/context/hipCtxNotSupported.cc +++ b/catch/unit/context/hipCtxNotSupported.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -34,7 +21,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipDevicePrimaryCtxSetFlags_Negative") { +TEST_CASE(Unit_hipDevicePrimaryCtxSetFlags_Negative) { hipDevice_t dev; unsigned int flags = 0; SECTION("Negative device index") { @@ -64,7 +51,7 @@ TEST_CASE("Unit_hipDevicePrimaryCtxSetFlags_Negative") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipDeviceAPIs_not_supported") { +TEST_CASE(Unit_hipDeviceAPIs_not_supported) { hipDevice_t device; int numDevices = -1; HIP_CHECK(hipDeviceGet(&device, 0)); @@ -104,7 +91,7 @@ TEST_CASE("Unit_hipDeviceAPIs_not_supported") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipCtxGetSetCacheConfig_not_supported") { +TEST_CASE(Unit_hipCtxGetSetCacheConfig_not_supported) { hipFuncCache_t cacheConfig; SECTION("hipCtxSetCacheConfig_not_supported") { SECTION("Invalid enum value") { @@ -143,7 +130,7 @@ TEST_CASE("Unit_hipCtxGetSetCacheConfig_not_supported") { * - Textures supported on device * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipCtxGetSetSharedMemConfig_not_supported") { +TEST_CASE(Unit_hipCtxGetSetSharedMemConfig_not_supported) { hipSharedMemConfig config; config = hipSharedMemBankSizeEightByte; SECTION("hipCtxSetSharedMemConfig_not_supported") { @@ -169,7 +156,7 @@ TEST_CASE("Unit_hipCtxGetSetSharedMemConfig_not_supported") { * - Textures supported on device * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipCtxPeerAccess_not_supported") { +TEST_CASE(Unit_hipCtxPeerAccess_not_supported) { hipCtx_t peerCtx = nullptr; unsigned int flags = 0; SECTION("hipCtxEnablePeerAccess_not_supported") { @@ -193,7 +180,7 @@ TEST_CASE("Unit_hipCtxPeerAccess_not_supported") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipCtxAPIs_not_supported") { +TEST_CASE(Unit_hipCtxAPIs_not_supported) { SECTION("hipCtxGetFlags_not_supported") { unsigned int flags = 0x100; auto res = hipCtxGetFlags(&flags); @@ -230,7 +217,7 @@ TEST_CASE("Unit_hipCtxAPIs_not_supported") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("hipDevicePrimaryCtxGetState_Negative") { +TEST_CASE(hipDevicePrimaryCtxGetState_Negative) { hipDevice_t device; HIP_CHECK(hipDeviceGet(&device, 0)); hipCtx_t primaryCtx = nullptr; diff --git a/catch/unit/context/hipDrvGetPCIBusId.cc b/catch/unit/context/hipDrvGetPCIBusId.cc index 70eecf7ba..305b53f04 100644 --- a/catch/unit/context/hipDrvGetPCIBusId.cc +++ b/catch/unit/context/hipDrvGetPCIBusId.cc @@ -1,23 +1,12 @@ -/*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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include -TEST_CASE("Unit_hipDeviceGetPCIBusId_Functional") { +TEST_CASE(Unit_hipDeviceGetPCIBusId_Functional) { HIP_CHECK(hipInit(0)); hipDevice_t device; HIP_CHECK(hipDeviceGet(&device, 0)); diff --git a/catch/unit/context/hipDrvMemcpy.cc b/catch/unit/context/hipDrvMemcpy.cc index ef16dcadc..85fe01ad2 100644 --- a/catch/unit/context/hipDrvMemcpy.cc +++ b/catch/unit/context/hipDrvMemcpy.cc @@ -1,26 +1,14 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #define LEN 1024 #define SIZE (LEN << 2) -TEST_CASE("Unit_hipDrvMemcpy_Functional") { +TEST_CASE(Unit_hipDrvMemcpy_Functional) { int *A, *B; hipDeviceptr_t Ad, Bd; A = new int[LEN]; diff --git a/catch/unit/context/hipMemsetD8.cc b/catch/unit/context/hipMemsetD8.cc index da2accd73..eee4db8c7 100644 --- a/catch/unit/context/hipMemsetD8.cc +++ b/catch/unit/context/hipMemsetD8.cc @@ -1,26 +1,14 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #define N 1024 constexpr char memsetval = 'b'; -TEST_CASE("Unit_hipMemsetD8_Functional") { +TEST_CASE(Unit_hipMemsetD8_Functional) { size_t Nbytes = N * sizeof(char); char* A_h = new char[Nbytes]; ; diff --git a/catch/unit/cooperativeGrps/CMakeLists.txt b/catch/unit/cooperativeGrps/CMakeLists.txt index c0d2a00e3..9d30eeb19 100644 --- a/catch/unit/cooperativeGrps/CMakeLists.txt +++ b/catch/unit/cooperativeGrps/CMakeLists.txt @@ -1,17 +1,18 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC thread_block.cc thread_block_tile.cc coalesced_group_tiled_partition.cc hipCGThreadBlockType_old.cc - hipCGMultiGridGroupType_old.cc hipCGGridGroupType_old.cc hipCGTiledPartitionType_old.cc hipCGThreadBlockTileTypeShfl_old.cc hipCGCoalescedGroups_old.cc hipLaunchCooperativeKernel_old.cc - hipLaunchCooperativeKernelMultiDevice_old.cc - multi_grid_group.cc coalesced_groups_shfl_down_old.cc coalesced_groups_shfl_up_old.cc coalesced_group.cc @@ -23,18 +24,31 @@ set(TEST_SRC split_barrier.cc ) +set(AMD_TEST_SRC + multi_grid_group.cc + hipCGMultiGridGroupType_old.cc + hipLaunchCooperativeKernelMultiDevice_old.cc +) + if(HIP_PLATFORM STREQUAL "nvidia") - set_source_files_properties(hipCGMultiGridGroupType_old.cc PROPERTIES COMPILE_FLAGS "-D_CG_ABI_EXPERIMENTAL -rdc=true -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80") - set_source_files_properties(hipLaunchCooperativeKernelMultiDevice_old.cc PROPERTIES COMPILE_FLAGS "-D_CG_ABI_EXPERIMENTAL -rdc=true -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80") - set_source_files_properties(multi_grid_group.cc PROPERTIES COMPILE_FLAGS "-D_CG_ABI_EXPERIMENTAL -rdc=true -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80") - set_source_files_properties(cg_ballot.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") - set_source_files_properties(cg_any_all.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") - set_source_files_properties(binary_partition.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") + set(COMPUTE_ARCH "-arch=compute_75") + set(EXPERIMENTAL_ABI "-D_CG_ABI_EXPERIMENTAL") + set(GENCODE_PARAMS "-rdc=true -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=compute_75 -gencode arch=compute_80,code=sm_80") + set_source_files_properties(hipCGMultiGridGroupType_old.cc PROPERTIES COMPILE_FLAGS "${EXPERIMENTAL_ABI} ${GENCODE_PARAMS}") + set_source_files_properties(hipLaunchCooperativeKernelMultiDevice_old.cc PROPERTIES COMPILE_FLAGS "${EXPERIMENTAL_ABI} ${GENCODE_PARAMS}") + set_source_files_properties(multi_grid_group.cc PROPERTIES COMPILE_FLAGS "${EXPERIMENTAL_ABI} ${GENCODE_PARAMS}") + set_source_files_properties(hipCGMultiGridGroupType_old.cc PROPERTIES COMPILE_FLAGS "${EXPERIMENTAL_ABI}") + set_source_files_properties(hipLaunchCooperativeKernelMultiDevice_old.cc PROPERTIES COMPILE_FLAGS "${EXPERIMENTAL_ABI}") + set_source_files_properties(multi_grid_group.cc PROPERTIES COMPILE_FLAGS "${EXPERIMENTAL_ABI}") + set_source_files_properties(cg_ballot.cc PROPERTIES COMPILE_FLAGS "${COMPUTE_ARCH}") + set_source_files_properties(cg_any_all.cc PROPERTIES COMPILE_FLAGS "${COMPUTE_ARCH}") + set_source_files_properties(binary_partition.cc PROPERTIES COMPILE_FLAGS "${COMPUTE_ARCH}") hip_add_exe_to_target(NAME coopGrpTest TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests - LINKER_LIBS "-rdc=true -gencode arch=compute_60,code=sm_60 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80, -gencode arch=compute_86,code=sm_86, -gencode=arch=compute_86,code=compute_86") + TEST_TARGET_NAME build_tests) + set_target_properties(coopGrpTest PROPERTIES CUDA_SEPARABLE_COMPILATION ON) else() + set(${TEST_SRC} ${TEST_SRC} ${AMD_TEST_SRC}) set_source_files_properties(cg_ballot.cc PROPERTIES COMPILE_FLAGS "-DHIP_ENABLE_WARP_SYNC_BUILTINS") set_source_files_properties(cg_any_all.cc PROPERTIES COMPILE_FLAGS "-DHIP_ENABLE_WARP_SYNC_BUILTINS") set_source_files_properties(binary_partition.cc PROPERTIES COMPILE_FLAGS "-DHIP_ENABLE_WARP_SYNC_BUILTINS") diff --git a/catch/unit/cooperativeGrps/binary_partition.cc b/catch/unit/cooperativeGrps/binary_partition.cc index 89c85f67b..edf584541 100644 --- a/catch/unit/cooperativeGrps/binary_partition.cc +++ b/catch/unit/cooperativeGrps/binary_partition.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +31,7 @@ static __global__ void binary_part_tiled_odd_even_val(int* data, int* odd_res, i } } -TEST_CASE("Unit_cg_binary_part") { +TEST_CASE(Unit_cg_binary_part) { const size_t warp_size = getWarpSize(); int *data, *odd_res, *even_res; diff --git a/catch/unit/cooperativeGrps/cg_any_all.cc b/catch/unit/cooperativeGrps/cg_any_all.cc index b9b2a092d..e49b48d4a 100644 --- a/catch/unit/cooperativeGrps/cg_any_all.cc +++ b/catch/unit/cooperativeGrps/cg_any_all.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -42,7 +29,7 @@ __global__ void coop_any_coal_odd_even(unsigned int* data, unsigned int even_val } } -TEST_CASE("Unit_coopgroups_any") { +TEST_CASE(Unit_coopgroups_any) { const size_t warp_size = getWarpSize(); unsigned int *data, *res; @@ -283,7 +270,7 @@ __global__ void coop_all_coal_odd_even(unsigned int* data, unsigned int even_val } } -TEST_CASE("Unit_coopgroups_coal_all") { +TEST_CASE(Unit_coopgroups_coal_all) { const size_t warp_size = getWarpSize(); unsigned int *data, *res; @@ -488,7 +475,7 @@ __global__ void coop_match_any_coal_odd_even(unsigned int* data, unsigned long l } } -TEST_CASE("Unit_coopgroups_match_any_coal") { +TEST_CASE(Unit_coopgroups_match_any_coal) { const size_t warp_size = getWarpSize(); unsigned int* data; @@ -558,7 +545,7 @@ __global__ void coop_match_all_coal_odd_even(unsigned int* data, unsigned long l } } -TEST_CASE("Unit_coopgroups_match_all_coal") { +TEST_CASE(Unit_coopgroups_match_all_coal) { const size_t warp_size = getWarpSize(); unsigned int* data; diff --git a/catch/unit/cooperativeGrps/cg_ballot.cc b/catch/unit/cooperativeGrps/cg_ballot.cc index 4cd0e62e5..8c0dadf1d 100644 --- a/catch/unit/cooperativeGrps/cg_ballot.cc +++ b/catch/unit/cooperativeGrps/cg_ballot.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -42,7 +29,7 @@ __global__ void coop_ballot_coal_alternate(int* data, unsigned long long* d_even } } -TEST_CASE("Unit_coopgroups_ballot") { +TEST_CASE(Unit_coopgroups_ballot) { const size_t warp_size = getWarpSize(); std::vector input; input.reserve(warp_size); @@ -97,7 +84,7 @@ static __global__ void coop_ballot_binary_part_3_5_7(int* data, unsigned long lo res[tid] = part.ballot((val % 7) == 0); } -TEST_CASE("Unit_binary_part_ballot") { +TEST_CASE(Unit_binary_part_ballot) { const size_t warp_size = getWarpSize(); std::vector input; input.reserve(warp_size); diff --git a/catch/unit/cooperativeGrps/cg_common_kernels.hh b/catch/unit/cooperativeGrps/cg_common_kernels.hh index bcfddf68e..047e769e3 100644 --- a/catch/unit/cooperativeGrps/cg_common_kernels.hh +++ b/catch/unit/cooperativeGrps/cg_common_kernels.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/cooperativeGrps/coalesced_group.cc b/catch/unit/cooperativeGrps/coalesced_group.cc index cd605e55f..25d1174a7 100644 --- a/catch/unit/cooperativeGrps/coalesced_group.cc +++ b/catch/unit/cooperativeGrps/coalesced_group.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "cooperative_groups_common.hh" #include "cg_common_kernels.hh" @@ -136,7 +124,7 @@ static uint64_t get_active_mask(unsigned int test_case, size_t warp_size) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Coalesced_Group_Getters_Positive_Basic") { +TEST_CASE(Unit_Coalesced_Group_Getters_Positive_Basic) { const int warp_size = getWarpSize(); const auto blocks = GenerateBlockDimensionsForShuffle(); @@ -219,7 +207,7 @@ TEST_CASE("Unit_Coalesced_Group_Getters_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Coalesced_Group_Getters_Via_Base_Type_Positive_Basic") { +TEST_CASE(Unit_Coalesced_Group_Getters_Via_Base_Type_Positive_Basic) { const int warp_size = getWarpSize(); const auto blocks = GenerateBlockDimensionsForShuffle(); @@ -303,7 +291,7 @@ TEST_CASE("Unit_Coalesced_Group_Getters_Via_Base_Type_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Coalesced_Group_Getters_Via_Non_Member_Functions_Positive_Basic") { +TEST_CASE(Unit_Coalesced_Group_Getters_Via_Non_Member_Functions_Positive_Basic) { const int warp_size = getWarpSize(); const auto blocks = GenerateBlockDimensionsForShuffle(); @@ -453,7 +441,7 @@ template void CoalescedGroupShflUpTestImpl() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Coalesced_Group_Shfl_Up_Positive_Basic", "", int, unsigned int, long, +TEMPLATE_TEST_CASE(Unit_Coalesced_Group_Shfl_Up_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { CoalescedGroupShflUpTestImpl(); } @@ -547,7 +535,7 @@ template void CoalescedGroupShflDownTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Coalesced_Group_Shfl_Down_Positive_Basic", "", int, unsigned int, long, +TEMPLATE_TEST_CASE(Unit_Coalesced_Group_Shfl_Down_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { CoalescedGroupShflDownTest(); } @@ -646,7 +634,7 @@ template void CoalescedGroupShflTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Coalesced_Group_Shfl_Positive_Basic", "", int, unsigned int, long, +TEMPLATE_TEST_CASE(Unit_Coalesced_Group_Shfl_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { CoalescedGroupShflTest(); } @@ -791,7 +779,7 @@ template void CoalescedGroupSyncTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Coalesced_Group_Sync_Positive_Basic", "", uint8_t, uint16_t, uint32_t) { +TEMPLATE_TEST_CASE(Unit_Coalesced_Group_Sync_Positive_Basic, uint8_t, uint16_t, uint32_t) { SECTION("Global memory") { CoalescedGroupSyncTest(); } SECTION("Shared memory") { CoalescedGroupSyncTest(); } } diff --git a/catch/unit/cooperativeGrps/coalesced_group_tiled_partition.cc b/catch/unit/cooperativeGrps/coalesced_group_tiled_partition.cc index 7ec3ede84..041c4923e 100644 --- a/catch/unit/cooperativeGrps/coalesced_group_tiled_partition.cc +++ b/catch/unit/cooperativeGrps/coalesced_group_tiled_partition.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "cooperative_groups_common.hh" #include "cg_common_kernels.hh" @@ -125,7 +112,7 @@ __global__ void coalesced_group_tiled_partition_thread_rank_getter(uint64_t* act * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Coalesced_Group_Tiled_Partition_Getters_Positive_Basic") { +TEST_CASE(Unit_Coalesced_Group_Tiled_Partition_Getters_Positive_Basic) { const auto tile_size = GenerateTileSizes(); INFO("Tile size: " << tile_size); auto blocks = GenerateBlockDimensions(); @@ -330,7 +317,7 @@ template static void CoalescedGroupTiledPartitonShflUpTestImpl() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Coalesced_Group_Tiled_Partition_Shfl_Up_Positive_Basic", "", int, +TEMPLATE_TEST_CASE(Unit_Coalesced_Group_Tiled_Partition_Shfl_Up_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { CoalescedGroupTiledPartitonShflUpTestImpl(); @@ -445,7 +432,7 @@ template static void CoalescedGroupTiledPartitonShflDownTestImpl() * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Coalesced_Group_Tiled_Partition_Shfl_Down_Positive_Basic", "", int, +TEMPLATE_TEST_CASE(Unit_Coalesced_Group_Tiled_Partition_Shfl_Down_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { CoalescedGroupTiledPartitonShflDownTestImpl(); @@ -552,7 +539,7 @@ template static void CoalescedGroupTiledPartitonShflTestImpl() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Coalesced_Group_Tiled_Partition_Shfl_Positive_Basic", "", int, +TEMPLATE_TEST_CASE(Unit_Coalesced_Group_Tiled_Partition_Shfl_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { CoalescedGroupTiledPartitonShflTestImpl(); @@ -712,7 +699,7 @@ template void CoalescedGroupTiledPartitionSyncT * - HIP_VERSION >= 5.2 */ uint64_t counter = 0; -TEMPLATE_TEST_CASE("Unit_Coalesced_Group_Tiled_Partition_Sync_Positive_Basic", "", uint8_t, +TEMPLATE_TEST_CASE(Unit_Coalesced_Group_Tiled_Partition_Sync_Positive_Basic, uint8_t, uint16_t, uint32_t) { SECTION("Global memory") { CoalescedGroupTiledPartitionSyncTest(); } SECTION("Shared memory") { CoalescedGroupTiledPartitionSyncTest(); } diff --git a/catch/unit/cooperativeGrps/coalesced_groups_shfl_down_old.cc b/catch/unit/cooperativeGrps/coalesced_groups_shfl_down_old.cc index 7ac0e979e..b8464b6ef 100644 --- a/catch/unit/cooperativeGrps/coalesced_groups_shfl_down_old.cc +++ b/catch/unit/cooperativeGrps/coalesced_groups_shfl_down_old.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2020 - 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Test Description: /* This test implements sum reduction kernel, first with each threads own rank as input and comparing the sum with expected sum output derieved from n(n-1)/2 @@ -241,7 +226,7 @@ static void test_shfl_down() { } -TEST_CASE("Unit_coalesced_groups_shfl_down") { +TEST_CASE(Unit_coalesced_groups_shfl_down) { // Use default device for validating the test int deviceId; ASSERT_EQUAL(hipGetDevice(&deviceId), hipSuccess); diff --git a/catch/unit/cooperativeGrps/coalesced_groups_shfl_up_old.cc b/catch/unit/cooperativeGrps/coalesced_groups_shfl_up_old.cc index 5e515382c..80e6f3aec 100644 --- a/catch/unit/cooperativeGrps/coalesced_groups_shfl_up_old.cc +++ b/catch/unit/cooperativeGrps/coalesced_groups_shfl_up_old.cc @@ -1,24 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Test Description: /* This test implements prefix sum(scan) kernel, first with each threads own rank as input and comparing the sum with expected serial summation output on CPU. @@ -221,7 +206,7 @@ static void test_shfl_up() { } } -TEST_CASE("Unit_coalesced_groups_shfl_up") { +TEST_CASE(Unit_coalesced_groups_shfl_up) { // Use default device for validating the test int deviceId; ASSERT_EQUAL(hipGetDevice(&deviceId), hipSuccess); diff --git a/catch/unit/cooperativeGrps/coalesced_tiled_groups_metagrp.cc b/catch/unit/cooperativeGrps/coalesced_tiled_groups_metagrp.cc index 8a1320d91..4f3ab572b 100644 --- a/catch/unit/cooperativeGrps/coalesced_tiled_groups_metagrp.cc +++ b/catch/unit/cooperativeGrps/coalesced_tiled_groups_metagrp.cc @@ -1,24 +1,9 @@ /* -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 -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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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 #include @@ -69,7 +54,7 @@ static __global__ void kernel_tiledgrp_threadblk(int* mgrpSize, int* mgrpRank) { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_tiled_groups_metagrp_basic") { +TEST_CASE(Unit_tiled_groups_metagrp_basic) { int *mgrpSize_d = nullptr, *mgrpRank_d = nullptr; int *mgrpSize_h = nullptr, *mgrpRank_h = nullptr; mgrpSize_h = new int[total_elem]; @@ -107,7 +92,7 @@ TEST_CASE("Unit_tiled_groups_metagrp_basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_coalesced_groups_metagrp_basic") { +TEST_CASE(Unit_coalesced_groups_metagrp_basic) { int *mgrpSize_d = nullptr, *mgrpRank_d = nullptr; int *mgrpSize_h = nullptr, *mgrpRank_h = nullptr; mgrpSize_h = new int[total_elem]; diff --git a/catch/unit/cooperativeGrps/cooperative_groups_common.hh b/catch/unit/cooperativeGrps/cooperative_groups_common.hh index 17ab44f84..6cab3e566 100644 --- a/catch/unit/cooperativeGrps/cooperative_groups_common.hh +++ b/catch/unit/cooperativeGrps/cooperative_groups_common.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/cooperativeGrps/grid_group.cc b/catch/unit/cooperativeGrps/grid_group.cc index 01a0b9c21..c7c155e7f 100644 --- a/catch/unit/cooperativeGrps/grid_group.cc +++ b/catch/unit/cooperativeGrps/grid_group.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "cooperative_groups_common.hh" #include @@ -112,7 +100,7 @@ static __global__ void sync_kernel(unsigned int* atomic_val, unsigned int* per_l * - HIP_VERSION >= 5.2 * - Device supports cooperative launch */ -TEST_CASE("Unit_Grid_Group_Getters_Positive_Basic") { +TEST_CASE(Unit_Grid_Group_Getters_Positive_Basic) { int device; hipDeviceProp_t device_properties; HIP_CHECK(hipGetDevice(&device)); @@ -192,7 +180,7 @@ TEST_CASE("Unit_Grid_Group_Getters_Positive_Basic") { * - HIP_VERSION >= 5.2 * - Device supports cooperative launch */ -TEST_CASE("Unit_Grid_Group_Getters_Via_Non_Member_Functions_Positive_Basic") { +TEST_CASE(Unit_Grid_Group_Getters_Via_Non_Member_Functions_Positive_Basic) { int device; hipDeviceProp_t device_properties; HIP_CHECK(hipGetDevice(&device)); @@ -261,7 +249,7 @@ TEST_CASE("Unit_Grid_Group_Getters_Via_Non_Member_Functions_Positive_Basic") { * - HIP_VERSION >= 5.2 * - Device supports cooperative launch */ -TEST_CASE("Unit_Grid_Group_Sync_Positive_Basic") { +TEST_CASE(Unit_Grid_Group_Sync_Positive_Basic) { int device; hipDeviceProp_t device_properties; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/cooperativeGrps/hipCGCoalescedGroups_old.cc b/catch/unit/cooperativeGrps/hipCGCoalescedGroups_old.cc index 4c7d2f592..207cbcba7 100644 --- a/catch/unit/cooperativeGrps/hipCGCoalescedGroups_old.cc +++ b/catch/unit/cooperativeGrps/hipCGCoalescedGroups_old.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2020 - 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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -472,7 +456,7 @@ static void test_shfl_broadcast() { } } -TEST_CASE("Unit_coalesced_groups") { +TEST_CASE(Unit_coalesced_groups) { // Use default device for validating the test int deviceId; HIP_CHECK(hipGetDevice(&deviceId)); diff --git a/catch/unit/cooperativeGrps/hipCGGridGroupType_old.cc b/catch/unit/cooperativeGrps/hipCGGridGroupType_old.cc index 026b087a3..41c5fbd4e 100644 --- a/catch/unit/cooperativeGrps/hipCGGridGroupType_old.cc +++ b/catch/unit/cooperativeGrps/hipCGGridGroupType_old.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2020 - 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -323,7 +308,7 @@ template static void test_cg_grid_group_type(F kernel_func, int blo HIP_CHECK(hipHostFree(group_dim_host)); } -TEST_CASE("Unit_hipCGGridGroupType_Basic") { +TEST_CASE(Unit_hipCGGridGroupType_Basic) { // Use default device for validating the test int device; hipDeviceProp_t device_properties; @@ -368,7 +353,7 @@ TEST_CASE("Unit_hipCGGridGroupType_Basic") { } } -TEST_CASE("Unit_hipCGGridGroupType_DataSharing") { +TEST_CASE(Unit_hipCGGridGroupType_DataSharing) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(device)); @@ -448,7 +433,7 @@ TEST_CASE("Unit_hipCGGridGroupType_DataSharing") { free(host_mem_2); } -TEST_CASE("Unit_hipCGGridGroupType_Barrier") { +TEST_CASE(Unit_hipCGGridGroupType_Barrier) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(device)); diff --git a/catch/unit/cooperativeGrps/hipCGMultiGridGroupType_old.cc b/catch/unit/cooperativeGrps/hipCGMultiGridGroupType_old.cc index 050402689..0132f9727 100644 --- a/catch/unit/cooperativeGrps/hipCGMultiGridGroupType_old.cc +++ b/catch/unit/cooperativeGrps/hipCGMultiGridGroupType_old.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2020 - 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -378,7 +363,7 @@ template static void test_cg_multi_grid_group_type(F kernel_func, i } } -TEST_CASE("Unit_hipCGMultiGridGroupType_Basic", "[multigpu]") { +TEST_CASE(Unit_hipCGMultiGridGroupType_Basic) { int num_devices = 0; HIP_CHECK(hipGetDeviceCount(&num_devices)); num_devices = min(num_devices, MaxGPUs); @@ -425,7 +410,7 @@ TEST_CASE("Unit_hipCGMultiGridGroupType_Basic", "[multigpu]") { } } -TEST_CASE("Unit_hipCGMultiGridGroupType_Barrier", "[multigpu]") { +TEST_CASE(Unit_hipCGMultiGridGroupType_Barrier) { int num_devices = 0; uint32_t loops = GENERATE(1, 2, 3, 4); uint32_t warps = GENERATE(4, 8, 16, 32); diff --git a/catch/unit/cooperativeGrps/hipCGThreadBlockTileTypeShfl_old.cc b/catch/unit/cooperativeGrps/hipCGThreadBlockTileTypeShfl_old.cc index 14dd68116..6c1316757 100644 --- a/catch/unit/cooperativeGrps/hipCGThreadBlockTileTypeShfl_old.cc +++ b/catch/unit/cooperativeGrps/hipCGThreadBlockTileTypeShfl_old.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2020 - 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -176,7 +161,7 @@ template static void test_group_partition(TiledGroupShf delete[] expected_result; } -TEST_CASE("Unit_hipCGThreadBlockTileType_Shfl") { +TEST_CASE(Unit_hipCGThreadBlockTileType_Shfl) { // Use default device for validating the test int device; hipDeviceProp_t device_properties; diff --git a/catch/unit/cooperativeGrps/hipCGThreadBlockType_old.cc b/catch/unit/cooperativeGrps/hipCGThreadBlockType_old.cc index 87ec21d74..187479df1 100644 --- a/catch/unit/cooperativeGrps/hipCGThreadBlockType_old.cc +++ b/catch/unit/cooperativeGrps/hipCGThreadBlockType_old.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2020 - 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -190,7 +175,7 @@ static void test_cg_thread_block_type(ThreadBlockTypeTests test_type, int block_ } -TEST_CASE("Unit_hipCGThreadBlockType") { +TEST_CASE(Unit_hipCGThreadBlockType) { // Use default device for validating the test int device; hipDeviceProp_t device_properties; diff --git a/catch/unit/cooperativeGrps/hipCGTiledPartitionType_old.cc b/catch/unit/cooperativeGrps/hipCGTiledPartitionType_old.cc index 1818c12f7..70d6b4a07 100644 --- a/catch/unit/cooperativeGrps/hipCGTiledPartitionType_old.cc +++ b/catch/unit/cooperativeGrps/hipCGTiledPartitionType_old.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2020 - 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Test Description: /* This test implements sum reduction kernel, first with each threads own rank as input and comparing the sum with expected sum output derieved from n(n-1)/2 @@ -338,7 +323,7 @@ static void test_group_partition_nested(unsigned int outer_tile_size, } } -TEST_CASE("Unit_hipCGThreadBlockTileType") { +TEST_CASE(Unit_hipCGThreadBlockTileType) { // Use default device for validating the test int device; hipDeviceProp_t device_properties; diff --git a/catch/unit/cooperativeGrps/hipLaunchCooperativeKernelMultiDevice_old.cc b/catch/unit/cooperativeGrps/hipLaunchCooperativeKernelMultiDevice_old.cc index bac936ae0..4aee72fcf 100644 --- a/catch/unit/cooperativeGrps/hipLaunchCooperativeKernelMultiDevice_old.cc +++ b/catch/unit/cooperativeGrps/hipLaunchCooperativeKernelMultiDevice_old.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2020 - 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Test Description: /*The general idea of the application is to test how multi-GPU Cooperative Groups kernel launches to a stream interact with other things that may be @@ -133,7 +121,7 @@ __global__ void test_gws(uint* buf, uint buf_size, unsigned long long* tmp_buf, } } -TEST_CASE("Unit_hipLaunchCooperativeKernelMultiDevice_Basic", "[multigpu]") { +TEST_CASE(Unit_hipLaunchCooperativeKernelMultiDevice_Basic) { constexpr uint num_kernel_args = 4; int device_num = 0; diff --git a/catch/unit/cooperativeGrps/hipLaunchCooperativeKernel_old.cc b/catch/unit/cooperativeGrps/hipLaunchCooperativeKernel_old.cc index 1a2de5a2b..afab8dcff 100644 --- a/catch/unit/cooperativeGrps/hipLaunchCooperativeKernel_old.cc +++ b/catch/unit/cooperativeGrps/hipLaunchCooperativeKernel_old.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2020 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -62,7 +46,7 @@ __global__ void test_gws(int* buf, size_t buf_size, unsigned long long* tmp_buf, } } -TEST_CASE("Unit_hipLaunchCooperativeKernel_Basic") { +TEST_CASE(Unit_hipLaunchCooperativeKernel_Basic) { // Use default device for validating the test int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/cooperativeGrps/hip_cg_common.hh b/catch/unit/cooperativeGrps/hip_cg_common.hh index a041c3d67..b0a5b71da 100644 --- a/catch/unit/cooperativeGrps/hip_cg_common.hh +++ b/catch/unit/cooperativeGrps/hip_cg_common.hh @@ -1,24 +1,8 @@ /* -Copyright (c) 2020 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/cooperativeGrps/multi_grid_group.cc b/catch/unit/cooperativeGrps/multi_grid_group.cc index 1c337db86..c27988a65 100644 --- a/catch/unit/cooperativeGrps/multi_grid_group.cc +++ b/catch/unit/cooperativeGrps/multi_grid_group.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "cooperative_groups_common.hh" #include "cg_common_kernels.hh" @@ -154,7 +142,7 @@ static void get_multi_grid_dims(dim3& grid_dim, dim3& block_dim, unsigned int de * - HIP_VERSION >= 5.2 * - Devices support cooperative multi device launch */ -TEST_CASE("Unit_Multi_Grid_Group_Getters_Positive_Basic", "[multigpu]") { +TEST_CASE(Unit_Multi_Grid_Group_Getters_Positive_Basic) { int num_devices = 0; HIP_CHECK(hipGetDeviceCount(&num_devices)); num_devices = min(num_devices, kMaxGPUs); @@ -302,7 +290,7 @@ TEST_CASE("Unit_Multi_Grid_Group_Getters_Positive_Basic", "[multigpu]") { * - HIP_VERSION >= 5.2 * - Devices support cooperative multi device launch */ -TEST_CASE("Unit_Multi_Grid_Group_Getters_Positive_Base_Type", "[multigpu]") { +TEST_CASE(Unit_Multi_Grid_Group_Getters_Positive_Base_Type) { int num_devices = 0; HIP_CHECK(hipGetDeviceCount(&num_devices)); num_devices = min(num_devices, kMaxGPUs); @@ -423,8 +411,7 @@ TEST_CASE("Unit_Multi_Grid_Group_Getters_Positive_Base_Type", "[multigpu]") { * - HIP_VERSION >= 5.2 * - Devices support cooperative multi device launch */ -TEST_CASE("Unit_Multi_Grid_Group_Getters_Positive_Non_Member_Functions", - "[multigpu]") { +TEST_CASE(Unit_Multi_Grid_Group_Getters_Positive_Non_Member_Functions) { int num_devices = 0; HIP_CHECK(hipGetDeviceCount(&num_devices)); num_devices = min(num_devices, kMaxGPUs); @@ -536,7 +523,7 @@ TEST_CASE("Unit_Multi_Grid_Group_Getters_Positive_Non_Member_Functions", * - HIP_VERSION >= 5.2 * - Devices support cooperative multi device launch */ -TEST_CASE("Unit_Multi_Grid_Group_Positive_Sync", "[multigpu]") { +TEST_CASE(Unit_Multi_Grid_Group_Positive_Sync) { CHECK_IMAGE_SUPPORT int num_devices = 0; HIP_CHECK(hipGetDeviceCount(&num_devices)); diff --git a/catch/unit/cooperativeGrps/split_barrier.cc b/catch/unit/cooperativeGrps/split_barrier.cc index f7376b660..8d6619f6d 100644 --- a/catch/unit/cooperativeGrps/split_barrier.cc +++ b/catch/unit/cooperativeGrps/split_barrier.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/cooperativeGrps/thread_block.cc b/catch/unit/cooperativeGrps/thread_block.cc index 93233060a..3397a4257 100644 --- a/catch/unit/cooperativeGrps/thread_block.cc +++ b/catch/unit/cooperativeGrps/thread_block.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "cooperative_groups_common.hh" #include "cg_common_kernels.hh" @@ -49,11 +36,13 @@ static __global__ void thread_block_thread_rank_getter(unsigned int* thread_rank thread_ranks[thread_rank_in_grid()] = group.thread_rank(); } +#if HT_AMD template static __global__ void thread_block_block_rank_getter(unsigned int* block_ranks) { const BaseType group = cg::this_thread_block(); block_ranks[thread_rank_in_grid()] = group.block_rank(); } +#endif static __global__ void thread_block_group_indices_getter(dim3* group_indices) { group_indices[thread_rank_in_grid()] = cg::this_thread_block().group_index(); @@ -85,7 +74,7 @@ static __global__ void thread_block_non_member_thread_rank_getter(unsigned int* * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Thread_Block_Getters_Positive_Basic") { +TEST_CASE(Unit_Thread_Block_Getters_Positive_Basic) { const auto blocks = GenerateBlockDimensions(); const auto threads = GenerateThreadDimensions(); if (blocks.x <= 0 || blocks.y <= 0 || blocks.z <= 0 || threads.x <= 0 || threads.y <= 0 || @@ -117,8 +106,10 @@ TEST_CASE("Unit_Thread_Block_Getters_Positive_Basic") { HIP_CHECK(hipMemcpy(uint_arr.ptr(), uint_arr_dev.ptr(), grid.thread_count_ * sizeof(*uint_arr.ptr()), hipMemcpyDeviceToHost)); HIP_CHECK(hipDeviceSynchronize()); +#if HT_AMD thread_block_block_rank_getter<<>>(uint_arr_dev.ptr()); HIP_CHECK(hipGetLastError()); +#endif // Validate thread_block.thread_rank() values ArrayAllOf(uint_arr.ptr(), grid.thread_count_, @@ -173,7 +164,7 @@ TEST_CASE("Unit_Thread_Block_Getters_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Thread_Block_Getters_Via_Base_Type_Positive_Basic") { +TEST_CASE(Unit_Thread_Block_Getters_Via_Base_Type_Positive_Basic) { const auto blocks = GenerateBlockDimensions(); const auto threads = GenerateThreadDimensions(); if (blocks.x <= 0 || blocks.y <= 0 || blocks.z <= 0 || threads.x <= 0 || threads.y <= 0 || @@ -224,7 +215,7 @@ TEST_CASE("Unit_Thread_Block_Getters_Via_Base_Type_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Thread_Block_Getters_Via_Non_Member_Functions_Positive_Basic") { +TEST_CASE(Unit_Thread_Block_Getters_Via_Non_Member_Functions_Positive_Basic) { const auto blocks = GenerateBlockDimensions(); const auto threads = GenerateThreadDimensions(); if (blocks.x <= 0 || blocks.y <= 0 || blocks.z <= 0 || threads.x <= 0 || threads.y <= 0 || @@ -374,7 +365,7 @@ template void ThreadBlockSyncTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Thread_Block_Sync_Positive_Basic", "", uint8_t, uint16_t, uint32_t) { +TEMPLATE_TEST_CASE(Unit_Thread_Block_Sync_Positive_Basic, uint8_t, uint16_t, uint32_t) { SECTION("Global memory") { ThreadBlockSyncTest(); } SECTION("Shared memory") { ThreadBlockSyncTest(); } } diff --git a/catch/unit/cooperativeGrps/thread_block_tile.cc b/catch/unit/cooperativeGrps/thread_block_tile.cc index 1eb4d290b..891f3eaf7 100644 --- a/catch/unit/cooperativeGrps/thread_block_tile.cc +++ b/catch/unit/cooperativeGrps/thread_block_tile.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "cooperative_groups_common.hh" #include "cg_common_kernels.hh" @@ -120,7 +107,7 @@ template void BlockPartitionGettersBasicTes * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Thread_Block_Tile_Getters_Positive_Basic") { +TEST_CASE(Unit_Thread_Block_Tile_Getters_Positive_Basic) { BlockPartitionGettersBasicTest(); } @@ -137,7 +124,7 @@ TEST_CASE("Unit_Thread_Block_Tile_Getters_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Thread_Block_Tile_Dynamic_Getters_Positive_Basic") { +TEST_CASE(Unit_Thread_Block_Tile_Dynamic_Getters_Positive_Basic) { BlockPartitionGettersBasicTest(); } @@ -203,7 +190,7 @@ template void BlockTileShflUpTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Thread_Block_Tile_Shfl_Up_Positive_Basic", "", int, unsigned int, long, +TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Shfl_Up_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { BlockTileShflUpTest(); } @@ -282,7 +269,7 @@ template void BlockTileShflDownTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Thread_Block_Tile_Shfl_Down_Positive_Basic", "", int, unsigned int, long, +TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Shfl_Down_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { BlockTileShflDownTest(); } @@ -356,7 +343,7 @@ template void BlockTileShflXORTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Thread_Block_Tile_Shfl_XOR_Positive_Basic", "", int, unsigned int, long, +TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Shfl_XOR_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { BlockTileShflXORTest(); } @@ -436,7 +423,7 @@ template void BlockTileShflTest() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Thread_Block_Tile_Shfl_Positive_Basic", "", int, unsigned int, long, +TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Shfl_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { BlockTileShflTest(); } @@ -550,7 +537,7 @@ template void BlockTileSy * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Thread_Block_Tile_Sync_Positive_Basic", "", uint8_t, uint16_t, uint32_t) { +TEMPLATE_TEST_CASE(Unit_Thread_Block_Tile_Sync_Positive_Basic, uint8_t, uint16_t, uint32_t) { SECTION("Global memory") { BlockTileSyncTest(); } SECTION("Shared memory") { BlockTileSyncTest(); } } diff --git a/catch/unit/device/CMakeLists.txt b/catch/unit/device/CMakeLists.txt index a20f9dc3c..790352076 100644 --- a/catch/unit/device/CMakeLists.txt +++ b/catch/unit/device/CMakeLists.txt @@ -1,9 +1,12 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC hipChooseDevice.cc hipDeviceComputeCapability.cc hipDeviceGetByPCIBusId.cc - hipDeviceGetLimit_old.cc hipDeviceGetName.cc hipDeviceGetPCIBusId.cc hipDeviceSetGetCacheConfig.cc @@ -21,7 +24,6 @@ set(TEST_SRC hipDeviceCanAccessPeer.cc hipDeviceEnableDisablePeerAccess.cc hipExtGetLinkTypeAndHopCount.cc - hipDeviceSetLimit_old.cc hipDeviceSetGetLimit.cc hipDeviceSetGetSharedMemConfig.cc hipDeviceReset.cc @@ -50,24 +52,20 @@ if(UNIX) endif() add_executable(getDeviceCount EXCLUDE_FROM_ALL getDeviceCount_exe.cc) -set_source_files_properties(getDeviceCount_exe.cc PROPERTIES LANGUAGE HIP) -set_target_properties(getDeviceCount PROPERTIES LINKER_LANGUAGE HIP) -target_link_libraries(getDeviceCount hip::host hip::device) +set_source_files_properties(getDeviceCount_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS getDeviceCount) +target_link_libraries(getDeviceCount ${GPGPU_LINKER_LIBRARIES}) add_executable(chkUUIDFrmChildProc_Exe EXCLUDE_FROM_ALL chkUUIDFrmChildProc_Exe.cc) add_executable(chkUUIDInGrandChild_Exe EXCLUDE_FROM_ALL chkUUIDInGrandChild_Exe.cc) add_executable(setuuidGetDevCount EXCLUDE_FROM_ALL setuuidGetDevCount_Exe.cc) -set_source_files_properties(chkUUIDFrmChildProc_Exe.cc PROPERTIES LANGUAGE HIP) -set_source_files_properties(chkUUIDInGrandChild_Exe.cc PROPERTIES LANGUAGE HIP) -set_source_files_properties(setuuidGetDevCount_Exe.cc PROPERTIES LANGUAGE HIP) -set_target_properties(chkUUIDFrmChildProc_Exe PROPERTIES LINKER_LANGUAGE HIP) -set_target_properties(chkUUIDInGrandChild_Exe PROPERTIES LINKER_LANGUAGE HIP) -set_target_properties(setuuidGetDevCount PROPERTIES LINKER_LANGUAGE HIP) -target_link_libraries(chkUUIDFrmChildProc_Exe hip::host hip::device) -target_link_libraries(chkUUIDInGrandChild_Exe hip::host hip::device) -target_link_libraries(setuuidGetDevCount hip::host hip::device) +set_source_files_properties(chkUUIDFrmChildProc_Exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +set_source_files_properties(chkUUIDInGrandChild_Exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +set_source_files_properties(setuuidGetDevCount_Exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +target_link_libraries(chkUUIDFrmChildProc_Exe ${GPGPU_LINKER_LIBRARIES}) +target_link_libraries(chkUUIDInGrandChild_Exe ${GPGPU_LINKER_LIBRARIES}) +target_link_libraries(setuuidGetDevCount ${GPGPU_LINKER_LIBRARIES}) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS chkUUIDFrmChildProc_Exe @@ -78,23 +76,19 @@ if(UNIX) add_executable(getUUIDfrmRocinfo EXCLUDE_FROM_ALL getUUIDfrmRocinfo_Exe.cc) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS getUUIDfrmRocinfo) add_dependencies(build_tests getUUIDfrmRocinfo) - set_source_files_properties(getUUIDfrmRocinfo_Exe.cc PROPERTIES LANGUAGE HIP) - set_target_properties(getUUIDfrmRocinfo PROPERTIES LINKER_LANGUAGE HIP) - target_link_libraries(getUUIDfrmRocinfo hip::host hip::device) + set_source_files_properties(getUUIDfrmRocinfo_Exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) endif() add_executable(multipleUUID EXCLUDE_FROM_ALL multipleUUID_Exe.cc) add_executable(setEnvInChildProc EXCLUDE_FROM_ALL setEnvInChildProc_Exe.cc) add_executable(uuidList EXCLUDE_FROM_ALL uuidList.cc) -set_source_files_properties(multipleUUID_Exe.cc PROPERTIES LANGUAGE HIP) -set_source_files_properties(setEnvInChildProc_Exe.cc PROPERTIES LANGUAGE HIP) -set_source_files_properties(uuidList.cc PROPERTIES LANGUAGE HIP) -set_target_properties(multipleUUID PROPERTIES LINKER_LANGUAGE HIP) -set_target_properties(setEnvInChildProc PROPERTIES LINKER_LANGUAGE HIP) -set_target_properties(uuidList PROPERTIES LINKER_LANGUAGE HIP) -target_link_libraries(multipleUUID hip::host hip::device) -target_link_libraries(setEnvInChildProc hip::host hip::device) -target_link_libraries(uuidList hip::host hip::device) +set_source_files_properties(multipleUUID_Exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +set_source_files_properties(setEnvInChildProc_Exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +set_source_files_properties(uuidList.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +target_link_libraries(multipleUUID ${GPGPU_LINKER_LIBRARIES}) +target_link_libraries(setEnvInChildProc ${GPGPU_LINKER_LIBRARIES}) +target_link_libraries(uuidList ${GPGPU_LINKER_LIBRARIES}) + set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS multipleUUID @@ -121,7 +115,6 @@ if(HIP_PLATFORM MATCHES "amd") add_executable(hipDeviceSetGetScratchExe EXCLUDE_FROM_ALL hipDeviceSetGetScratchExe.cc) add_dependencies(DeviceTest hipDeviceSetGetScratchExe) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipDeviceSetGetScratchExe) - set_source_files_properties(hipDeviceSetGetScratchExe.cc PROPERTIES LANGUAGE HIP) - set_target_properties(hipDeviceSetGetScratchExe PROPERTIES LINKER_LANGUAGE HIP) - target_link_libraries(hipDeviceSetGetScratchExe hip::host hip::device) + set_source_files_properties(hipDeviceSetGetScratchExe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) endif() + diff --git a/catch/unit/device/ResetUUIDInChild_Exe.cc b/catch/unit/device/ResetUUIDInChild_Exe.cc index c68a3cf02..b940c7343 100644 --- a/catch/unit/device/ResetUUIDInChild_Exe.cc +++ b/catch/unit/device/ResetUUIDInChild_Exe.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #ifdef _WIN64 diff --git a/catch/unit/device/chkUUIDFrmChildProc_Exe.cc b/catch/unit/device/chkUUIDFrmChildProc_Exe.cc index 623739a10..8909a22e4 100644 --- a/catch/unit/device/chkUUIDFrmChildProc_Exe.cc +++ b/catch/unit/device/chkUUIDFrmChildProc_Exe.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include int main(int argc, char** argv) { diff --git a/catch/unit/device/chkUUIDInGrandChild_Exe.cc b/catch/unit/device/chkUUIDInGrandChild_Exe.cc index 2b43ee3f0..66fe1688c 100644 --- a/catch/unit/device/chkUUIDInGrandChild_Exe.cc +++ b/catch/unit/device/chkUUIDInGrandChild_Exe.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/device/getDeviceCount_exe.cc b/catch/unit/device/getDeviceCount_exe.cc index 233406467..7b4cb0d7f 100644 --- a/catch/unit/device/getDeviceCount_exe.cc +++ b/catch/unit/device/getDeviceCount_exe.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/device/getUUIDfrmRocinfo_Exe.cc b/catch/unit/device/getUUIDfrmRocinfo_Exe.cc index 53b0948d7..c047f907c 100644 --- a/catch/unit/device/getUUIDfrmRocinfo_Exe.cc +++ b/catch/unit/device/getUUIDfrmRocinfo_Exe.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #ifdef __linux__ diff --git a/catch/unit/device/hipChooseDevice.cc b/catch/unit/device/hipChooseDevice.cc index 25ec3026d..363ebd296 100644 --- a/catch/unit/device/hipChooseDevice.cc +++ b/catch/unit/device/hipChooseDevice.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -41,7 +25,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipChooseDevice_ValidateDevId") { +TEST_CASE(Unit_hipChooseDevice_ValidateDevId) { hipDeviceProp_t prop; HIP_CHECK(hipGetDeviceProperties(&prop, 0)); int numDevices = 0; @@ -67,7 +51,7 @@ TEST_CASE("Unit_hipChooseDevice_ValidateDevId") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipChooseDevice_NegTst") { +TEST_CASE(Unit_hipChooseDevice_NegTst) { hipDeviceProp_t prop; int dev = -1; diff --git a/catch/unit/device/hipDeviceAPUCheck.cc b/catch/unit/device/hipDeviceAPUCheck.cc index 07eb03aa5..3ef093851 100644 --- a/catch/unit/device/hipDeviceAPUCheck.cc +++ b/catch/unit/device/hipDeviceAPUCheck.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -41,7 +25,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipDeviceAPUCheck") { +TEST_CASE(Unit_hipDeviceAPUCheck) { hipDeviceProp_t prop; HIP_CHECK(hipGetDeviceProperties(&prop, 0)); if (!prop.integrated) { diff --git a/catch/unit/device/hipDeviceCanAccessPeer.cc b/catch/unit/device/hipDeviceCanAccessPeer.cc index 098f9bffa..38174c920 100644 --- a/catch/unit/device/hipDeviceCanAccessPeer.cc +++ b/catch/unit/device/hipDeviceCanAccessPeer.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -43,7 +27,7 @@ THE SOFTWARE. * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceCanAccessPeer_positive") { +TEST_CASE(Unit_hipDeviceCanAccessPeer_positive) { int canAccessPeer = 0; int deviceCount = HipTest::getGeviceCount(); if (deviceCount < 2) { @@ -87,7 +71,7 @@ TEST_CASE("Unit_hipDeviceCanAccessPeer_positive") { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceCanAccessPeer_negative") { +TEST_CASE(Unit_hipDeviceCanAccessPeer_negative) { int canAccessPeer = 0; int deviceCount = HipTest::getGeviceCount(); if (deviceCount < 2) { diff --git a/catch/unit/device/hipDeviceComputeCapability.cc b/catch/unit/device/hipDeviceComputeCapability.cc index ce3954880..9ec2a3572 100644 --- a/catch/unit/device/hipDeviceComputeCapability.cc +++ b/catch/unit/device/hipDeviceComputeCapability.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -46,7 +33,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceComputeCapability_Negative") { +TEST_CASE(Unit_hipDeviceComputeCapability_Negative) { int major, minor, numDevices; hipDevice_t device; @@ -88,7 +75,7 @@ TEST_CASE("Unit_hipDeviceComputeCapability_Negative") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceComputeCapability_ValidateVersion") { +TEST_CASE(Unit_hipDeviceComputeCapability_ValidateVersion) { int major, minor; hipDevice_t device; int numDevices = -1; diff --git a/catch/unit/device/hipDeviceEnableDisablePeerAccess.cc b/catch/unit/device/hipDeviceEnableDisablePeerAccess.cc index 63e30cba9..b1c429bb3 100644 --- a/catch/unit/device/hipDeviceEnableDisablePeerAccess.cc +++ b/catch/unit/device/hipDeviceEnableDisablePeerAccess.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -46,7 +30,7 @@ THE SOFTWARE. * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceEnableDisablePeerAccess_positive", "[multigpu]") { +TEST_CASE(Unit_hipDeviceEnableDisablePeerAccess_positive) { int canAccessPeer = 0; int deviceCount = HipTest::getGeviceCount(); if (deviceCount < 2) { @@ -95,7 +79,7 @@ TEST_CASE("Unit_hipDeviceEnableDisablePeerAccess_positive", "[multigpu]") { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceEnablePeerAccess_negative", "[multigpu]") { +TEST_CASE(Unit_hipDeviceEnablePeerAccess_negative) { int deviceCount = HipTest::getGeviceCount(); if (deviceCount < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -159,7 +143,7 @@ TEST_CASE("Unit_hipDeviceEnablePeerAccess_negative", "[multigpu]") { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceDisablePeerAccess_negative", "[multigpu]") { +TEST_CASE(Unit_hipDeviceDisablePeerAccess_negative) { int deviceCount = HipTest::getGeviceCount(); if (deviceCount < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); diff --git a/catch/unit/device/hipDeviceGetByPCIBusId.cc b/catch/unit/device/hipDeviceGetByPCIBusId.cc index c1db31c34..f40e272ab 100644 --- a/catch/unit/device/hipDeviceGetByPCIBusId.cc +++ b/catch/unit/device/hipDeviceGetByPCIBusId.cc @@ -1,20 +1,7 @@ /* - * Copyright (c) 2021 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ @@ -42,7 +29,7 @@ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetByPCIBusId_Functional") { +TEST_CASE(Unit_hipDeviceGetByPCIBusId_Functional) { char pciBusId[SIZE]{}; int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); @@ -80,7 +67,7 @@ TEST_CASE("Unit_hipDeviceGetByPCIBusId_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetByPCIBusId_NegativeNullChk") { +TEST_CASE(Unit_hipDeviceGetByPCIBusId_NegativeNullChk) { int device = -1; hipError_t ret; char pciBusIdstr[SIZE]{}; @@ -106,7 +93,7 @@ TEST_CASE("Unit_hipDeviceGetByPCIBusId_NegativeNullChk") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetByPCIBusId_NegativeInputString") { +TEST_CASE(Unit_hipDeviceGetByPCIBusId_NegativeInputString) { int device = -1; hipError_t ret; ret = hipDeviceGetByPCIBusId(&device, ""); @@ -129,7 +116,7 @@ TEST_CASE("Unit_hipDeviceGetByPCIBusId_NegativeInputString") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetByPCIBusId_WrongBusID") { +TEST_CASE(Unit_hipDeviceGetByPCIBusId_WrongBusID) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); HIP_ASSERT(deviceCount != 0); diff --git a/catch/unit/device/hipDeviceGetDefaultMemPool.cc b/catch/unit/device/hipDeviceGetDefaultMemPool.cc index 2e02741ce..9a3dc84ba 100644 --- a/catch/unit/device/hipDeviceGetDefaultMemPool.cc +++ b/catch/unit/device/hipDeviceGetDefaultMemPool.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -42,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetDefaultMemPool_Positive_Basic") { +TEST_CASE(Unit_hipDeviceGetDefaultMemPool_Positive_Basic) { const int device = GENERATE(range(0, HipTest::getDeviceCount())); int mem_pool_support = 0; @@ -75,7 +59,7 @@ TEST_CASE("Unit_hipDeviceGetDefaultMemPool_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetDefaultMemPool_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceGetDefaultMemPool_Negative_Parameters) { hipMemPool_t mem_pool; SECTION("mem_pool == nullptr") { diff --git a/catch/unit/device/hipDeviceGetLimit_old.cc b/catch/unit/device/hipDeviceGetLimit_old.cc deleted file mode 100644 index cdcd2746b..000000000 --- a/catch/unit/device/hipDeviceGetLimit_old.cc +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/** - * @addtogroup hipDeviceGetLimit hipDeviceGetLimit - * @{ - * @ingroup DeviceTest - * `hipDeviceGetLimit(size_t* pValue, enum hipLimit_t limit)` - - * Get Resource limits of current device. - */ - -#include - -/** - * Test Description - * ------------------------ - * - Validates handling of invalid arguments: - * -# When output pointer to the limit value is `nullptr` - * - Expected output: do not return `hipSuccess` - * -# When limit enum is out of bounds - * - Expected output: do not return `hipSuccess` - * Test source - * ------------------------ - * - unit/device/hipDeviceGetLimit.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_hipDeviceGetLimit_NegTst") { - size_t Value = 0; - - SECTION("NULL check") { - REQUIRE_FALSE(hipDeviceGetLimit(nullptr, hipLimitMallocHeapSize) == hipSuccess); - } - - SECTION("Invalid Input Flag") { - REQUIRE_FALSE(hipDeviceGetLimit(&Value, static_cast(0xff)) == hipSuccess); - } -} - -/** - * Test Description - * ------------------------ - * - Validate that returned limit value for Malloc Heap size is valid. - * Test source - * ------------------------ - * - unit/device/hipDeviceGetLimit.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_hipDeviceGetLimit_CheckValidityOfOutputVal") { - size_t Value = 0; - - REQUIRE(hipDeviceGetLimit(&Value, hipLimitMallocHeapSize) == hipSuccess); - REQUIRE_FALSE(Value <= 0); -} - -/** - * End doxygen group DeviceTest. - * @} - */ diff --git a/catch/unit/device/hipDeviceGetName.cc b/catch/unit/device/hipDeviceGetName.cc index a294ba018..88f1d5d83 100644 --- a/catch/unit/device/hipDeviceGetName.cc +++ b/catch/unit/device/hipDeviceGetName.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022 - 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -55,7 +42,7 @@ constexpr size_t LEN = 256; * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetName_NegTst") { +TEST_CASE(Unit_hipDeviceGetName_NegTst) { std::array name; int numDevices = 0; @@ -114,7 +101,7 @@ TEST_CASE("Unit_hipDeviceGetName_NegTst") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetName_CheckPropName") { +TEST_CASE(Unit_hipDeviceGetName_CheckPropName) { int numDevices = 0; std::array name; hipDevice_t device; @@ -142,7 +129,7 @@ TEST_CASE("Unit_hipDeviceGetName_CheckPropName") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetName_PartialFill") { +TEST_CASE(Unit_hipDeviceGetName_PartialFill) { #if HT_AMD HipTest::HIP_SKIP_TEST("EXSWCPHIPT-108"); return; @@ -210,8 +197,7 @@ static inline std::vector parseVisibleDevices() { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipDeviceName_gcnArchName_And_rocm_agent_enumerator", - "[multigpu]") { +TEST_CASE(Unit_hipDeviceName_gcnArchName_And_rocm_agent_enumerator) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount <= 0) { diff --git a/catch/unit/device/hipDeviceGetPCIBusId.cc b/catch/unit/device/hipDeviceGetPCIBusId.cc index cf11f8379..6f2febd2d 100644 --- a/catch/unit/device/hipDeviceGetPCIBusId.cc +++ b/catch/unit/device/hipDeviceGetPCIBusId.cc @@ -1,20 +1,7 @@ /* - * Copyright (c) 2021 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* @@ -56,7 +43,7 @@ void getPciBusId(int deviceCount, char** hipDeviceList) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetPCIBusId_Check_PciBusID_WithAttr") { +TEST_CASE(Unit_hipDeviceGetPCIBusId_Check_PciBusID_WithAttr) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); REQUIRE_FALSE(deviceCount == 0); @@ -102,7 +89,7 @@ TEST_CASE("Unit_hipDeviceGetPCIBusId_Check_PciBusID_WithAttr") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetPCIBusId_Negative_PartialFill") { +TEST_CASE(Unit_hipDeviceGetPCIBusId_Negative_PartialFill) { std::array busID; const int device = GENERATE(range(0, HipTest::getDeviceCount())); @@ -147,7 +134,7 @@ TEST_CASE("Unit_hipDeviceGetPCIBusId_Negative_PartialFill") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetPCIBusId_NegTst") { +TEST_CASE(Unit_hipDeviceGetPCIBusId_NegTst) { char pciBusId[MAX_DEVICE_LENGTH]; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/device/hipDeviceGetUuid.cc b/catch/unit/device/hipDeviceGetUuid.cc index 12c0fcce9..dadd552d3 100644 --- a/catch/unit/device/hipDeviceGetUuid.cc +++ b/catch/unit/device/hipDeviceGetUuid.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022-2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -66,7 +53,7 @@ std::atomic tState{1}; // 0:fail, 1:pass, 2:skip * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetUuid_Positive") { +TEST_CASE(Unit_hipDeviceGetUuid_Positive) { hipDevice_t device; hipUUID uuid{0}; bool uuidValid = false; @@ -104,7 +91,7 @@ TEST_CASE("Unit_hipDeviceGetUuid_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetUuid_Negative") { +TEST_CASE(Unit_hipDeviceGetUuid_Negative) { int numDevices = 0; hipDevice_t device; hipUUID uuid; @@ -150,7 +137,7 @@ static inline std::vector parseVisibleDevices() { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipDeviceGetUuid_From_RocmInfo", "[multigpu]") { +TEST_CASE(Unit_hipDeviceGetUuid_From_RocmInfo) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); assert(deviceCount > 0); @@ -224,8 +211,7 @@ TEST_CASE("Unit_hipDeviceGetUuid_From_RocmInfo", "[multigpu]") { */ // Guarding it against NVIDIA as this test is faling on it. #if HT_AMD -TEST_CASE("Unit_hipDeviceGetUuid_VerifyUuidFrm_hipGetDeviceProperties", - "[multigpu]") { +TEST_CASE(Unit_hipDeviceGetUuid_VerifyUuidFrm_hipGetDeviceProperties) { int deviceCount = 0; hipDevice_t device; hipDeviceProp_t prop; @@ -314,7 +300,7 @@ auto getUUIDlistWithoutRocmInfo() { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_Uuid_FntlTstsFor_SetEnv_HIP_VISIBLE_DEVICES") { +TEST_CASE(Unit_Uuid_FntlTstsFor_SetEnv_HIP_VISIBLE_DEVICES) { std::map uuid_map; auto getNthElem = [&uuid_map](int pos) { return std::next(uuid_map.begin(), pos)->second; @@ -552,7 +538,7 @@ void setEnv() { * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_UUID_setEnv_Thread") { +TEST_CASE(Unit_UUID_setEnv_Thread) { // Create Thread one std::thread t1(setEnv); t1.join(); diff --git a/catch/unit/device/hipDeviceReset.cc b/catch/unit/device/hipDeviceReset.cc index 9079d340c..8dc0b5f0f 100644 --- a/catch/unit/device/hipDeviceReset.cc +++ b/catch/unit/device/hipDeviceReset.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -46,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceReset_Positive_Basic") { +TEST_CASE(Unit_hipDeviceReset_Positive_Basic) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(device)); @@ -108,7 +93,7 @@ TEST_CASE("Unit_hipDeviceReset_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceReset_Positive_Threaded") { +TEST_CASE(Unit_hipDeviceReset_Positive_Threaded) { HIP_CHECK(hipSetDevice(0)); INFO("Current device is: " << 0); HIP_CHECK(hipDeviceReset()); diff --git a/catch/unit/device/hipDeviceSetGetCacheConfig.cc b/catch/unit/device/hipDeviceSetGetCacheConfig.cc index dea4f4b42..7053f33af 100644 --- a/catch/unit/device/hipDeviceSetGetCacheConfig.cc +++ b/catch/unit/device/hipDeviceSetGetCacheConfig.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -46,7 +31,7 @@ constexpr std::array kCacheConfigs{ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceSetCacheConfig_Positive_Basic") { +TEST_CASE(Unit_hipDeviceSetCacheConfig_Positive_Basic) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(device)); INFO("Current device is: " << device); @@ -81,7 +66,7 @@ TEST_CASE("Unit_hipDeviceSetCacheConfig_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetCacheConfig_Positive_Default") { +TEST_CASE(Unit_hipDeviceGetCacheConfig_Positive_Default) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(device)); INFO("Current device is: " << device); diff --git a/catch/unit/device/hipDeviceSetGetLimit.cc b/catch/unit/device/hipDeviceSetGetLimit.cc index a7ba45374..dadc46414 100644 --- a/catch/unit/device/hipDeviceSetGetLimit.cc +++ b/catch/unit/device/hipDeviceSetGetLimit.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2023 ~ 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -54,7 +38,7 @@ void DeviceSetLimitTest(hipLimit_t limit) { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipDeviceSetLimit_Positive_StackSize") { DeviceSetLimitTest(hipLimitStackSize); } +TEST_CASE(Unit_hipDeviceSetLimit_Positive_StackSize) { DeviceSetLimitTest(hipLimitStackSize); } #if HT_NVIDIA @@ -71,7 +55,7 @@ __device__ __managed__ bool stop = false; * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipDeviceSetLimit_Positive_PrintfFifoSize") { +TEST_CASE(Unit_hipDeviceSetLimit_Positive_PrintfFifoSize) { DeviceSetLimitTest(hipLimitPrintfFifoSize); } @@ -91,7 +75,7 @@ __global__ void PrintfKernel() { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipDeviceSetLimit_Negative_PrintfFifoSize") { +TEST_CASE(Unit_hipDeviceSetLimit_Negative_PrintfFifoSize) { PrintfKernel<<<1, 1>>>(); HIP_CHECK_ERROR(hipDeviceSetLimit(hipLimitPrintfFifoSize, 1024), hipErrorInvalidValue); stop = true; @@ -110,7 +94,7 @@ TEST_CASE("Unit_hipDeviceSetLimit_Negative_PrintfFifoSize") { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipDeviceSetLimit_Positive_MallocHeapSize") { +TEST_CASE(Unit_hipDeviceSetLimit_Positive_MallocHeapSize) { DeviceSetLimitTest(hipLimitMallocHeapSize); } @@ -130,7 +114,7 @@ __global__ void MallocKernel() { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipDeviceSetLimit_Negative_MallocHeapSize") { +TEST_CASE(Unit_hipDeviceSetLimit_Negative_MallocHeapSize) { MallocKernel<<<1, 1>>>(); HIP_CHECK_ERROR(hipDeviceSetLimit(hipLimitMallocHeapSize, 1024), hipErrorInvalidValue); stop = true; @@ -151,7 +135,7 @@ TEST_CASE("Unit_hipDeviceSetLimit_Negative_MallocHeapSize") { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipDeviceSetLimit_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceSetLimit_Negative_Parameters) { #if HT_AMD HIP_CHECK_ERROR(hipDeviceSetLimit(static_cast(-1), 1024), hipErrorUnsupportedLimit); #else @@ -183,7 +167,7 @@ TEST_CASE("Unit_hipDeviceSetLimit_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetLimit_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceGetLimit_Negative_Parameters) { SECTION("nullptr") { HIP_CHECK_ERROR(hipDeviceGetLimit(nullptr, hipLimitStackSize), hipErrorInvalidValue); } @@ -230,7 +214,7 @@ bool isSetScratchLimitSupported() { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_Negative") { +TEST_CASE(Unit_hipDeviceGetSetLimit_Scratch_Negative) { size_t value = 0; SECTION("With hipLimitRange") { HIP_CHECK_ERROR(hipDeviceGetLimit(&value, hipLimitRange), hipErrorInvalidValue); @@ -260,7 +244,7 @@ TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_Negative") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_SetMinAndMaxAsCurrent") { +TEST_CASE(Unit_hipDeviceGetSetLimit_Scratch_SetMinAndMaxAsCurrent) { if (!isSetScratchLimitSupported()) { HipTest::HIP_SKIP_TEST( "Set Scratch Limit Not Supported on Current Device." @@ -300,7 +284,7 @@ TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_SetMinAndMaxAsCurrent") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_DecreaseIncrease") { +TEST_CASE(Unit_hipDeviceGetSetLimit_Scratch_DecreaseIncrease) { if (!isSetScratchLimitSupported()) { HipTest::HIP_SKIP_TEST( "Set Scratch Limit Not Supported on Current Device." @@ -379,7 +363,7 @@ __global__ void addOneKernelUseScratch(int* arr) { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_SetBeforeKernelLaunch") { +TEST_CASE(Unit_hipDeviceGetSetLimit_Scratch_SetBeforeKernelLaunch) { if (!isSetScratchLimitSupported()) { HipTest::HIP_SKIP_TEST( "Set Scratch Limit Not Supported on Current Device." @@ -462,7 +446,7 @@ void getMinMaxCurrentAndSetCurrent() { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_MultiDevice", "[multigpu]") { +TEST_CASE(Unit_hipDeviceGetSetLimit_Scratch_MultiDevice) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount < 2) { @@ -498,7 +482,7 @@ TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_MultiDevice", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_InThread") { +TEST_CASE(Unit_hipDeviceGetSetLimit_Scratch_InThread) { if (!isSetScratchLimitSupported()) { HipTest::HIP_SKIP_TEST( "Set Scratch Limit Not Supported on Current Device." @@ -524,7 +508,7 @@ TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_InThread") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_InChildProcess") { +TEST_CASE(Unit_hipDeviceGetSetLimit_Scratch_InChildProcess) { if (!isSetScratchLimitSupported()) { HipTest::HIP_SKIP_TEST( "Set Scratch Limit Not Supported on Current Device." @@ -570,7 +554,7 @@ void getScratchCurrent(size_t checkValue) { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDeviceGetSetLimit_Scratch_SetGetThreads") { +TEST_CASE(Unit_hipDeviceGetSetLimit_Scratch_SetGetThreads) { if (!isSetScratchLimitSupported()) { HipTest::HIP_SKIP_TEST( "Set Scratch Limit Not Supported on Current Device." diff --git a/catch/unit/device/hipDeviceSetGetMemPool.cc b/catch/unit/device/hipDeviceSetGetMemPool.cc index 2ab99509f..70ed6b7d4 100644 --- a/catch/unit/device/hipDeviceSetGetMemPool.cc +++ b/catch/unit/device/hipDeviceSetGetMemPool.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -72,7 +56,7 @@ static inline hipMemPool_t CreateMemPool(const int device) { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceSetMemPool_Positive_Basic") { +TEST_CASE(Unit_hipDeviceSetMemPool_Positive_Basic) { const int device = GENERATE(range(0, HipTest::getDeviceCount())); if (!CheckMemPoolSupport(device)) { @@ -103,7 +87,7 @@ TEST_CASE("Unit_hipDeviceSetMemPool_Positive_Basic") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceSetMemPool_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceSetMemPool_Negative_Parameters) { hipMemPool_t mem_pool; HIP_CHECK(hipDeviceGetDefaultMemPool(&mem_pool, 0)); @@ -145,7 +129,7 @@ TEST_CASE("Unit_hipDeviceSetMemPool_Negative_Parameters") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Default") { +TEST_CASE(Unit_hipDeviceGetMemPool_Positive_Default) { const int device = GENERATE(range(0, HipTest::getDeviceCount())); if (!CheckMemPoolSupport(device)) { @@ -173,7 +157,7 @@ TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Default") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Basic") { +TEST_CASE(Unit_hipDeviceGetMemPool_Positive_Basic) { const int device = GENERATE(range(0, HipTest::getDeviceCount())); if (!CheckMemPoolSupport(device)) { @@ -203,7 +187,7 @@ TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Basic") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Threaded") { +TEST_CASE(Unit_hipDeviceGetMemPool_Positive_Threaded) { class HipDeviceGetMemPoolTest : public ThreadedZigZagTest { public: void TestPart2() { @@ -248,7 +232,7 @@ TEST_CASE("Unit_hipDeviceGetMemPool_Positive_Threaded") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetMemPool_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceGetMemPool_Negative_Parameters) { hipMemPool_t mem_pool; SECTION("mem_pool == nullptr") { diff --git a/catch/unit/device/hipDeviceSetGetScratchExe.cc b/catch/unit/device/hipDeviceSetGetScratchExe.cc index c5b8d6bf2..201841023 100644 --- a/catch/unit/device/hipDeviceSetGetScratchExe.cc +++ b/catch/unit/device/hipDeviceSetGetScratchExe.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/device/hipDeviceSetGetSharedMemConfig.cc b/catch/unit/device/hipDeviceSetGetSharedMemConfig.cc index ca8df7458..a1dc35640 100644 --- a/catch/unit/device/hipDeviceSetGetSharedMemConfig.cc +++ b/catch/unit/device/hipDeviceSetGetSharedMemConfig.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +33,7 @@ constexpr std::array kMemConfigs{ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceSetSharedMemConfig_Positive_Basic") { +TEST_CASE(Unit_hipDeviceSetSharedMemConfig_Positive_Basic) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); const auto mem_config = GENERATE(from_range(std::begin(kMemConfigs), std::end(kMemConfigs))); HIP_CHECK(hipSetDevice(device)); @@ -71,7 +56,7 @@ TEST_CASE("Unit_hipDeviceSetSharedMemConfig_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceSetSharedMemConfig_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceSetSharedMemConfig_Negative_Parameters) { HIP_CHECK_ERROR(hipDeviceSetSharedMemConfig(static_cast(-1)), hipErrorInvalidValue); } @@ -100,7 +85,7 @@ TEST_CASE("Unit_hipDeviceSetSharedMemConfig_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetSharedMemConfig_Positive_Default") { +TEST_CASE(Unit_hipDeviceGetSharedMemConfig_Positive_Default) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(device)); INFO("Current device is " << device); @@ -122,7 +107,7 @@ TEST_CASE("Unit_hipDeviceGetSharedMemConfig_Positive_Default") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetSharedMemConfig_Positive_Basic") { +TEST_CASE(Unit_hipDeviceGetSharedMemConfig_Positive_Basic) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); const auto mem_config = GENERATE(from_range(std::begin(kMemConfigs), std::end(kMemConfigs))); HIP_CHECK(hipSetDevice(device)); @@ -156,7 +141,7 @@ TEST_CASE("Unit_hipDeviceGetSharedMemConfig_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetSharedMemConfig_Positive_Threaded") { +TEST_CASE(Unit_hipDeviceGetSharedMemConfig_Positive_Threaded) { class HipDeviceGetSharedMemConfigTest : public ThreadedZigZagTest { public: @@ -202,6 +187,6 @@ TEST_CASE("Unit_hipDeviceGetSharedMemConfig_Positive_Threaded") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetSharedMemConfig_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceGetSharedMemConfig_Negative_Parameters) { HIP_CHECK_ERROR(hipDeviceGetSharedMemConfig(nullptr), hipErrorInvalidValue); } diff --git a/catch/unit/device/hipDeviceSetLimit_old.cc b/catch/unit/device/hipDeviceSetLimit_old.cc deleted file mode 100644 index 9ccf71bdc..000000000 --- a/catch/unit/device/hipDeviceSetLimit_old.cc +++ /dev/null @@ -1,107 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -#include - -/** - * @addtogroup hipDeviceSetLimit hipDeviceSetLimit - * @{ - * @ingroup DeviceTest - * `hipDeviceSetLimit(enum hipLimit_t limit, size_t value)` - - * Set Resource limits of current device. - */ - -// Currently the HIGHER_VALUE is fixed to 16 KB based on currently -// set maximum value for hipLimitStackSize. In future, this value -// might need to change to avoid test case failure. In the same way -// LOWER_VALUE is empirically determined. -#define HIGHER_VALUE (16 * 1024) // 16 KB -#define LOWER_VALUE (512) // 512 bytes - -/** - * hipDeviceSetLimit tests => - */ -static bool testSetLimitFunc(hipLimit_t limit_to_test) { - size_t value = 0; - size_t setValue = LOWER_VALUE; - // Set Value to low Value. - HIP_CHECK(hipDeviceSetLimit(limit_to_test, setValue)); - HIP_CHECK(hipDeviceGetLimit(&value, limit_to_test)); - // The returned value could be rounded to maximum or minimum - REQUIRE(value >= LOWER_VALUE); - // Set Value to High value. - setValue = HIGHER_VALUE; - HIP_CHECK(hipDeviceSetLimit(limit_to_test, setValue)); - HIP_CHECK(hipDeviceGetLimit(&value, limit_to_test)); - // The returned value could be rounded to maximum or minimum - REQUIRE(value >= HIGHER_VALUE); - return true; -} - -/** - * Test Description - * ------------------------ - * - Sets different values for the resource limits. - * Test source - * ------------------------ - * - unit/device/hipDeviceSetLimit.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_hipDeviceSetLimit_SetGet", "[multigpu]") { - size_t value = 0; - // Scenario1 - SECTION("Set Get Test hipLimitStackSize") { - REQUIRE(true == testSetLimitFunc(hipLimitStackSize)); - } -#if HT_NVIDIA - // Scenario2 - SECTION("Set Get Test hipLimitPrintfFifoSize") { - REQUIRE(true == testSetLimitFunc(hipLimitPrintfFifoSize)); - } - // Scenario3 - SECTION("Set Get Test hipLimitMallocHeapSize") { - REQUIRE(true == testSetLimitFunc(hipLimitMallocHeapSize)); - } -#endif - // Scenario4 - SECTION("Multi device Set-Get test for all flags") { - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - for (int dev = 0; dev < numDevices; dev++) { - HIP_CHECK(hipSetDevice(dev)); - REQUIRE(true == testSetLimitFunc(hipLimitStackSize)); -#if HT_NVIDIA - REQUIRE(true == testSetLimitFunc(hipLimitPrintfFifoSize)); - REQUIRE(true == testSetLimitFunc(hipLimitMallocHeapSize)); -#endif - } - } - // Scenario5 - SECTION("Negative Scenario: Invalid Flag") { - HIP_CHECK(hipDeviceGetLimit(&value, hipLimitMallocHeapSize)); - REQUIRE(hipErrorInvalidValue == hipDeviceSetLimit(static_cast(0xffff), value / 2)); - } -} - -/** - * End doxygen group DeviceTest. - * @} - */ diff --git a/catch/unit/device/hipDeviceSynchronize.cc b/catch/unit/device/hipDeviceSynchronize.cc index c7e1864e9..1188f50ff 100644 --- a/catch/unit/device/hipDeviceSynchronize.cc +++ b/catch/unit/device/hipDeviceSynchronize.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -60,7 +44,7 @@ static __global__ void Iter(int* Ad, int num) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceSynchronize_Positive_Empty_Streams") { +TEST_CASE(Unit_hipDeviceSynchronize_Positive_Empty_Streams) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(device)); INFO("Current device: " << device); @@ -83,7 +67,7 @@ TEST_CASE("Unit_hipDeviceSynchronize_Positive_Empty_Streams") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceSynchronize_Positive_Nullstream") { +TEST_CASE(Unit_hipDeviceSynchronize_Positive_Nullstream) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(device)); INFO("Current device: " << device); @@ -115,7 +99,7 @@ TEST_CASE("Unit_hipDeviceSynchronize_Positive_Nullstream") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceSynchronize_Functional") { +TEST_CASE(Unit_hipDeviceSynchronize_Functional) { int* A[NUM_STREAMS]; int* Ad[NUM_STREAMS]; hipStream_t stream[NUM_STREAMS]; diff --git a/catch/unit/device/hipDeviceTotalMem.cc b/catch/unit/device/hipDeviceTotalMem.cc index 67addedda..6f7e763eb 100644 --- a/catch/unit/device/hipDeviceTotalMem.cc +++ b/catch/unit/device/hipDeviceTotalMem.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -44,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceTotalMem_NegTst") { +TEST_CASE(Unit_hipDeviceTotalMem_NegTst) { #if HT_NVIDIA HIP_CHECK(hipInit(0)); #endif @@ -79,7 +66,7 @@ TEST_CASE("Unit_hipDeviceTotalMem_NegTst") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceTotalMem_ValidateTotalMem") { +TEST_CASE(Unit_hipDeviceTotalMem_ValidateTotalMem) { size_t totMem; int numDevices = 0; @@ -115,7 +102,7 @@ TEST_CASE("Unit_hipDeviceTotalMem_ValidateTotalMem") { * - Multi-device test * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceTotalMem_NonSelectedDevice", "[multigpu]") { +TEST_CASE(Unit_hipDeviceTotalMem_NonSelectedDevice) { auto deviceCount = HipTest::getDeviceCount(); if (deviceCount < 2) { HipTest::HIP_SKIP_TEST("Multi Device Test, will not run on single gpu systems. Skipping."); diff --git a/catch/unit/device/hipDriverGetVersion.cc b/catch/unit/device/hipDriverGetVersion.cc index a8a9fca32..acc5117f4 100644 --- a/catch/unit/device/hipDriverGetVersion.cc +++ b/catch/unit/device/hipDriverGetVersion.cc @@ -1,23 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -41,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDriverGetVersion_Positive") { +TEST_CASE(Unit_hipDriverGetVersion_Positive) { int driverVersion = -1; HIP_CHECK(hipDriverGetVersion(&driverVersion)); REQUIRE(driverVersion > 0); @@ -61,7 +46,7 @@ TEST_CASE("Unit_hipDriverGetVersion_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDriverGetVersion_Negative") { +TEST_CASE(Unit_hipDriverGetVersion_Negative) { // If initialization is attempted with nullptr, error shall be reported HIP_CHECK_ERROR(hipDriverGetVersion(nullptr), hipErrorInvalidValue); } diff --git a/catch/unit/device/hipExtGetLinkTypeAndHopCount.cc b/catch/unit/device/hipExtGetLinkTypeAndHopCount.cc index ddc145beb..9617b1987 100644 --- a/catch/unit/device/hipExtGetLinkTypeAndHopCount.cc +++ b/catch/unit/device/hipExtGetLinkTypeAndHopCount.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -45,7 +29,7 @@ THE SOFTWARE. * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipExtGetLinkTypeAndHopCount_Positive_Basic") { +TEST_CASE(Unit_hipExtGetLinkTypeAndHopCount_Positive_Basic) { const auto device1 = GENERATE(range(0, HipTest::getDeviceCount())); const auto device2 = GENERATE(range(0, HipTest::getDeviceCount())); @@ -107,7 +91,7 @@ TEST_CASE("Unit_hipExtGetLinkTypeAndHopCount_Positive_Basic") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipExtGetLinkTypeAndHopCount_Negative_Parameters") { +TEST_CASE(Unit_hipExtGetLinkTypeAndHopCount_Negative_Parameters) { uint32_t link_type, hop_count; SECTION("same device") { HIP_CHECK_ERROR(hipExtGetLinkTypeAndHopCount(0, 0, &link_type, &hop_count), diff --git a/catch/unit/device/hipGetDeviceAttribute.cc b/catch/unit/device/hipGetDeviceAttribute.cc index fc479fd41..fb4772a7a 100644 --- a/catch/unit/device/hipGetDeviceAttribute.cc +++ b/catch/unit/device/hipGetDeviceAttribute.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022 - 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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #ifdef __linux__ @@ -79,7 +66,7 @@ static hipError_t test_hipDeviceGetHdpAddress(int deviceId, hipDeviceAttribute_t * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetDeviceAttribute_CheckAttrValues") { +TEST_CASE(Unit_hipGetDeviceAttribute_CheckAttrValues) { int deviceId; HIP_CHECK(hipGetDevice(&deviceId)); hipDeviceProp_t props; @@ -213,7 +200,7 @@ TEST_CASE("Unit_hipGetDeviceAttribute_CheckAttrValues") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetAttribute_NegTst") { +TEST_CASE(Unit_hipDeviceGetAttribute_NegTst) { int deviceCount = 0; int pi = -1; HIP_CHECK(hipGetDeviceCount(&deviceCount)); @@ -408,47 +395,6 @@ void printAttributes(const AttributeToStringMap& attributes, const int device std::flush(std::cout); } -/** - * Test Description - * ------------------------ - * - Print out all device attributes in agreed upon format. - * Test source - * ------------------------ - * - unit/device/hipGetDeviceAttribute.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Print_Out_Attributes") { - const auto device = GENERATE(range(0, HipTest::getDeviceCount())); - hipDeviceProp_t properties; - HIP_CHECK(hipGetDeviceProperties(&properties, device)); - - std::cout << std::left; - std::cout << std::setw(kW) << "device#: " << device << "\n"; - std::cout << std::setw(kW) << "name: " << properties.name << "\n"; - - printAttributes(kCommonAttributes, device); - -#if HT_NVIDIA - std::cout << "\nCUDA only\n"; - std::cout << std::setw(kW) - << "--------------------------------------------------------------------------------" - << "\n"; - printAttributes(kCudaOnlyAttributes, device); -#endif - -#if HT_AMD - std::cout << "\nAMD only\n"; - std::cout << std::setw(kW) - << "--------------------------------------------------------------------------------" - << "\n"; - printAttributes(kAmdOnlyAttributes, device); -#endif - - std::flush(std::cout); -} - /** * Test Description * ------------------------ @@ -460,7 +406,7 @@ TEST_CASE("Print_Out_Attributes") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetDeviceAttribute_hipDevAttrHostRegisterSupported") { +TEST_CASE(Unit_hipGetDeviceAttribute_hipDevAttrHostRegisterSupported) { hipError_t ret_val; int hipDevAttr = 0; ret_val = hipDeviceGetAttribute(&hipDevAttr, hipDeviceAttributeHostRegisterSupported, 0); diff --git a/catch/unit/device/hipGetDeviceCount.cc b/catch/unit/device/hipGetDeviceCount.cc index 8ed0191e2..3432117b9 100644 --- a/catch/unit/device/hipGetDeviceCount.cc +++ b/catch/unit/device/hipGetDeviceCount.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -42,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetDeviceCount_NegTst") { +TEST_CASE(Unit_hipGetDeviceCount_NegTst) { REQUIRE_FALSE(hipGetDeviceCount(nullptr) == hipSuccess); } @@ -59,7 +43,7 @@ TEST_CASE("Unit_hipGetDeviceCount_NegTst") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetDeviceCount_HideDevices") { +TEST_CASE(Unit_hipGetDeviceCount_HideDevices) { int deviceCount = HipTest::getDeviceCount(); if (deviceCount < 2) { HipTest::HIP_SKIP_TEST("This test requires more than 2 GPUs. Skipping."); @@ -81,21 +65,6 @@ TEST_CASE("Unit_hipGetDeviceCount_HideDevices") { } } -/** - * Test Description - * ------------------------ - * - Prints device count to the standard output. - * Test source - * ------------------------ - * - unit/device/hipGetDeviceCount.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Print_Out_Device_Count") { - std::cout << "Device Count: " << HipTest::getDeviceCount() << std::endl; -} - /** * End doxygen group DeviceTest. * @} diff --git a/catch/unit/device/hipGetDeviceProperties.cc b/catch/unit/device/hipGetDeviceProperties.cc index dc01b7167..12a130ae9 100644 --- a/catch/unit/device/hipGetDeviceProperties.cc +++ b/catch/unit/device/hipGetDeviceProperties.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2022-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -148,7 +132,7 @@ static void validateDeviceMacro(int* archProp_h, hipDeviceProp_t* prop) { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetDeviceProperties_ArchPropertiesTst", "[multigpu]") { +TEST_CASE(Unit_hipGetDeviceProperties_ArchPropertiesTst) { int *archProp_h, *archProp_d; archProp_h = new int[NUM_OF_ARCHPROP]; hipDeviceProp_t prop; @@ -195,7 +179,7 @@ TEST_CASE("Unit_hipGetDeviceProperties_ArchPropertiesTst", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetDeviceProperties_NegTst") { +TEST_CASE(Unit_hipGetDeviceProperties_NegTst) { hipDeviceProp_t prop; SECTION("props is nullptr") { @@ -214,213 +198,6 @@ TEST_CASE("Unit_hipGetDeviceProperties_NegTst") { } } -/** - * Test Description - * ------------------------ - * - Print out all properties in agreed upon format. - * Test source - * ------------------------ - * - unit/device/hipGetDeviceProperties.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Print_Out_Properties") { - constexpr int w = 42; - const auto device = GENERATE(range(0, HipTest::getDeviceCount())); - - hipDeviceProp_t properties; - HIP_CHECK(hipGetDeviceProperties(&properties, device)); - - std::cout << std::left; - std::cout << std::setw(w) << "device#: " << device << "\n"; - std::cout << std::setw(w) << "name: " << std::string(properties.name, 256) << "\n"; - std::cout << std::setw(w) << "totalGlobalMem: " << properties.totalGlobalMem << "\n"; - std::cout << std::setw(w) << "sharedMemPerBlock: " << properties.sharedMemPerBlock << "\n"; - std::cout << std::setw(w) << "regsPerBlock: " << properties.regsPerBlock << "\n"; - std::cout << std::setw(w) << "warpSize: " << properties.warpSize << "\n"; - std::cout << std::setw(w) << "maxThreadsPerBlock: " << properties.maxThreadsPerBlock << "\n"; - std::cout << std::setw(w) << "maxThreadsDim.x: " << properties.maxThreadsDim[0] << "\n"; - std::cout << std::setw(w) << "maxThreadsDim.y: " << properties.maxThreadsDim[1] << "\n"; - std::cout << std::setw(w) << "maxThreadsDim.z: " << properties.maxThreadsDim[2] << "\n"; - std::cout << std::setw(w) << "maxGridSize.x: " << properties.maxGridSize[0] << "\n"; - std::cout << std::setw(w) << "maxGridSize.y: " << properties.maxGridSize[1] << "\n"; - std::cout << std::setw(w) << "maxGridSize.z: " << properties.maxGridSize[2] << "\n"; - std::cout << std::setw(w) << "clockRate: " << properties.clockRate << "\n"; - std::cout << std::setw(w) << "memoryClockRate: " << properties.memoryClockRate << "\n"; - std::cout << std::setw(w) << "memoryBusWidth: " << properties.memoryBusWidth << "\n"; - std::cout << std::setw(w) << "totalConstMem: " << properties.totalConstMem << "\n"; - std::cout << std::setw(w) << "major: " << properties.major << "\n"; - std::cout << std::setw(w) << "minor: " << properties.minor << "\n"; - std::cout << std::setw(w) << "multiProcessorCount: " << properties.multiProcessorCount << "\n"; - std::cout << std::setw(w) << "l2CacheSize: " << properties.l2CacheSize << "\n"; - std::cout << std::setw(w) - << "maxThreadsPerMultiProcessor: " << properties.maxThreadsPerMultiProcessor << "\n"; - std::cout << std::setw(w) << "computeMode: " << properties.computeMode << "\n"; - std::cout << std::setw(w) << "concurrentKernels: " << properties.concurrentKernels << "\n"; - std::cout << std::setw(w) << "pciDomainID: " << properties.pciDomainID << "\n"; - std::cout << std::setw(w) << "pciBusID: " << properties.pciBusID << "\n"; - std::cout << std::setw(w) << "pciDeviceID: " << properties.pciDeviceID << "\n"; - std::cout << std::setw(w) << "isMultiGpuBoard: " << properties.isMultiGpuBoard << "\n"; - std::cout << std::setw(w) << "canMapHostMemory: " << properties.canMapHostMemory << "\n"; - std::cout << std::setw(w) << "integrated: " << properties.integrated << "\n"; - std::cout << std::setw(w) << "cooperativeLaunch: " << properties.cooperativeLaunch << "\n"; - std::cout << std::setw(w) - << "cooperativeMultiDeviceLaunch: " << properties.cooperativeMultiDeviceLaunch << "\n"; - std::cout << std::setw(w) << "maxTexture1DLinear: " << properties.maxTexture1DLinear << "\n"; - std::cout << std::setw(w) << "maxTexture1D: " << properties.maxTexture1D << "\n"; - std::cout << std::setw(w) << "maxTexture2D.width: " << properties.maxTexture2D[0] << "\n"; - std::cout << std::setw(w) << "maxTexture2D.height: " << properties.maxTexture2D[1] << "\n"; - std::cout << std::setw(w) << "maxTexture3D.width: " << properties.maxTexture3D[0] << "\n"; - std::cout << std::setw(w) << "maxTexture3D.height: " << properties.maxTexture3D[1] << "\n"; - std::cout << std::setw(w) << "maxTexture3D.depth: " << properties.maxTexture3D[2] << "\n"; - std::cout << std::setw(w) << "memPitch: " << properties.memPitch << "\n"; - std::cout << std::setw(w) << "textureAlignment: " << properties.textureAlignment << "\n"; - std::cout << std::setw(w) << "texturePitchAlignment: " << properties.texturePitchAlignment - << "\n"; - std::cout << std::setw(w) << "kernelExecTimeoutEnabled: " << properties.kernelExecTimeoutEnabled - << "\n"; - std::cout << std::setw(w) << "ECCEnabled: " << properties.ECCEnabled << "\n"; - std::cout << std::setw(w) << "tccDriver: " << properties.tccDriver << "\n"; - std::cout << std::setw(w) << "managedMemory: " << properties.managedMemory << "\n"; - std::cout << std::setw(w) - << "directManagedMemAccessFromHost: " << properties.directManagedMemAccessFromHost - << "\n"; - std::cout << std::setw(w) << "concurrentManagedAccess: " << properties.concurrentManagedAccess - << "\n"; - std::cout << std::setw(w) << "pageableMemoryAccess: " << properties.pageableMemoryAccess << "\n"; - std::cout << std::setw(w) << "pageableMemoryAccessUsesHostPageTables: " - << properties.pageableMemoryAccessUsesHostPageTables << "\n"; - -#if HT_AMD - std::cout << std::setw(w) << "gcnArchName: " << std::string(properties.gcnArchName, 256) << "\n"; - std::cout << std::setw(w) << "asicRevision: " << properties.asicRevision << "\n"; - std::cout << std::setw(w) - << "arch.hasGlobalInt32Atomics: " << properties.arch.hasGlobalInt32Atomics << "\n"; - std::cout << std::setw(w) - << "arch.hasGlobalFloatAtomicExch: " << properties.arch.hasGlobalFloatAtomicExch - << "\n"; - std::cout << std::setw(w) - << "arch.hasSharedInt32Atomics: " << properties.arch.hasSharedInt32Atomics << "\n"; - std::cout << std::setw(w) - << "arch.hasSharedFloatAtomicExch: " << properties.arch.hasSharedFloatAtomicExch - << "\n"; - std::cout << std::setw(w) << "arch.hasFloatAtomicAdd: " << properties.arch.hasFloatAtomicAdd - << "\n"; - std::cout << std::setw(w) - << "arch.hasGlobalInt64Atomics: " << properties.arch.hasGlobalInt64Atomics << "\n"; - std::cout << std::setw(w) - << "arch.hasSharedInt64Atomics: " << properties.arch.hasSharedInt64Atomics << "\n"; - std::cout << std::setw(w) << "arch.hasDoubles: " << properties.arch.hasDoubles << "\n"; - std::cout << std::setw(w) << "arch.hasWarpVote: " << properties.arch.hasWarpVote << "\n"; - std::cout << std::setw(w) << "arch.hasWarpBallot: " << properties.arch.hasWarpBallot << "\n"; - std::cout << std::setw(w) << "arch.hasWarpShuffle: " << properties.arch.hasWarpShuffle << "\n"; - std::cout << std::setw(w) << "arch.hasFunnelShift: " << properties.arch.hasFunnelShift << "\n"; - std::cout << std::setw(w) << "arch.hasThreadFenceSystem: " << properties.arch.hasThreadFenceSystem - << "\n"; - std::cout << std::setw(w) << "arch.hasSyncThreadsExt: " << properties.arch.hasSyncThreadsExt - << "\n"; - std::cout << std::setw(w) << "arch.hasSurfaceFuncs: " << properties.arch.hasSurfaceFuncs << "\n"; - std::cout << std::setw(w) << "arch.has3dGrid: " << properties.arch.has3dGrid << "\n"; - std::cout << std::setw(w) - << "arch.hasDynamicParallelism: " << properties.arch.hasDynamicParallelism << "\n"; - std::cout << std::setw(w) << "isLargeBar: " << properties.isLargeBar << "\n"; - std::cout << std::setw(w) - << "maxSharedMemoryPerMultiProcessor: " << properties.maxSharedMemoryPerMultiProcessor - << "\n"; - std::cout << std::setw(w) << "hdpMemFlushCntl: " << properties.hdpMemFlushCntl << "\n"; - std::cout << std::setw(w) << "hdpRegFlushCntl: " << properties.hdpRegFlushCntl << "\n"; - std::cout << std::setw(w) << "clockInstructionRate: " << properties.clockInstructionRate << "\n"; - std::cout << std::setw(w) << "cooperativeMultiDeviceUnmatchedFunc: " - << properties.cooperativeMultiDeviceUnmatchedFunc << "\n"; - std::cout << std::setw(w) << "cooperativeMultiDeviceUnmatchedGridDim: " - << properties.cooperativeMultiDeviceUnmatchedGridDim << "\n"; - std::cout << std::setw(w) << "cooperativeMultiDeviceUnmatchedBlockDim: " - << properties.cooperativeMultiDeviceUnmatchedBlockDim << "\n"; - std::cout << std::setw(w) << "cooperativeMultiDeviceUnmatchedSharedMem: " - << properties.cooperativeMultiDeviceUnmatchedSharedMem << "\n"; -#endif - std::flush(std::cout); -} - -/** - * Test Description - * ------------------------ - * - Print out all properties in agreed upon format. - * Test source - * ------------------------ - * - unit/device/hipGetDeviceProperties.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ -TEST_CASE("Print_Out_Properties_6.0") { - constexpr int w = 42; - const auto device = GENERATE(range(0, HipTest::getDeviceCount())); - - hipDeviceProp_t properties; - HIP_CHECK(hipGetDeviceProperties(&properties, device)); - - std::cout << std::left; - std::cout << std::setw(w) << "New Attributes added in Rocm 6.0" << "\n"; -#if HT_AMD - std::cout << std::setw(w) << "uuid: " << properties.uuid.bytes << "\n"; -#endif - std::cout << std::setw(w) << "maxTexture1DLayered.width: " << properties.maxTexture1DLayered[0] - << "\n"; - std::cout << std::setw(w) << "maxTexture1DLayered.height: " << properties.maxTexture1DLayered[1] - << "\n"; - std::cout << std::setw(w) << "maxTexture2DLayered.width: " << properties.maxTexture2DLayered[0] - << "\n"; - std::cout << std::setw(w) << "maxTexture2DLayered.height: " << properties.maxTexture2DLayered[1] - << "\n"; - std::cout << std::setw(w) << "maxTexture2DLayered.depth: " << properties.maxTexture2DLayered[2] - << "\n"; - std::cout << std::setw(w) << "maxTexture2DGather.width: " << properties.maxTexture2DGather[0] - << "\n"; - std::cout << std::setw(w) << "maxTexture2DGather.height: " << properties.maxTexture2DGather[1] - << "\n"; - std::cout << std::setw(w) << "maxTexture2DLinear.width: " << properties.maxTexture2DLinear[0] - << "\n"; - std::cout << std::setw(w) << "maxTexture2DLinear.height: " << properties.maxTexture2DLinear[1] - << "\n"; - std::cout << std::setw(w) << "maxTexture2DLinear.depth: " << properties.maxTexture2DLinear[2] - << "\n"; - std::cout << std::setw(w) << "maxSurface1D: " << properties.maxSurface1D << "\n"; - std::cout << std::setw(w) << "maxSurface1DLayered.width: " << properties.maxSurface1DLayered[0] - << "\n"; - std::cout << std::setw(w) << "maxSurface1DLayered.height: " << properties.maxSurface1DLayered[1] - << "\n"; - std::cout << std::setw(w) << "maxSurface2D.width: " << properties.maxSurface2D[0] << "\n"; - std::cout << std::setw(w) << "maxSurface2D.height: " << properties.maxSurface2D[1] << "\n"; - std::cout << std::setw(w) << "maxSurface2DLayered.width: " << properties.maxSurface2DLayered[0] - << "\n"; - std::cout << std::setw(w) << "maxSurface2DLayered.height: " << properties.maxSurface2DLayered[1] - << "\n"; - std::cout << std::setw(w) << "maxSurface2DLayered.depth: " << properties.maxSurface2DLayered[2] - << "\n"; - std::cout << std::setw(w) << "maxSurface3D.width: " << properties.maxSurface3D[0] << "\n"; - std::cout << std::setw(w) << "maxSurface3D.height: " << properties.maxSurface3D[1] << "\n"; - std::cout << std::setw(w) << "maxSurface3D.depth: " << properties.maxSurface3D[2] << "\n"; - std::cout << std::setw(w) << "maxSurfaceCubemap: " << properties.maxSurfaceCubemap << "\n"; - std::cout << std::setw(w) - << "maxSurfaceCubemapLayered.width: " << properties.maxSurfaceCubemapLayered[0] << "\n"; - std::cout << std::setw(w) - << "maxSurfaceCubemapLayered.height: " << properties.maxSurfaceCubemapLayered[1] - << "\n"; - std::cout << std::setw(w) << "surfaceAlignment: " << properties.surfaceAlignment << "\n"; - std::cout << std::setw(w) << "unifiedAddressing: " << properties.unifiedAddressing << "\n"; - std::cout << std::setw(w) << "asyncEngineCount: " << properties.asyncEngineCount << "\n"; - std::cout << std::setw(w) - << "computePreemptionSupported: " << properties.computePreemptionSupported << "\n"; - std::cout << std::setw(w) << "regsPerMultiprocessor: " << properties.regsPerMultiprocessor - << "\n"; - std::cout << std::setw(w) - << "sharedMemPerMultiprocessor: " << properties.sharedMemPerMultiprocessor << "\n"; - - std::flush(std::cout); -} - /** * End doxygen group DeviceTest. * @} diff --git a/catch/unit/device/hipGetDriverEntryPoint.cc b/catch/unit/device/hipGetDriverEntryPoint.cc index 7679a797f..d9604b83f 100644 --- a/catch/unit/device/hipGetDriverEntryPoint.cc +++ b/catch/unit/device/hipGetDriverEntryPoint.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -44,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipGetDriverEntryPoint_Positive") { +TEST_CASE(Unit_hipGetDriverEntryPoint_Positive) { void* funcPtr = nullptr; hipDriverEntryPointQueryResult status; @@ -90,7 +77,7 @@ TEST_CASE("Unit_hipGetDriverEntryPoint_Positive") { * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipGetDriverEntryPoint_Negative") { +TEST_CASE(Unit_hipGetDriverEntryPoint_Negative) { void* funcPtr = nullptr; hipDriverEntryPointQueryResult status; @@ -136,7 +123,7 @@ TEST_CASE("Unit_hipGetDriverEntryPoint_Negative") { * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipGetDriverEntryPoint_spt_Positive") { +TEST_CASE(Unit_hipGetDriverEntryPoint_spt_Positive) { void* funcPtr = nullptr; hipDriverEntryPointQueryResult status; @@ -182,7 +169,7 @@ TEST_CASE("Unit_hipGetDriverEntryPoint_spt_Positive") { * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipGetDriverEntryPoint_spt_Negative") { +TEST_CASE(Unit_hipGetDriverEntryPoint_spt_Negative) { void* funcPtr = nullptr; hipDriverEntryPointQueryResult status; diff --git a/catch/unit/device/hipGetProcAddressDevMgmt.cc b/catch/unit/device/hipGetProcAddressDevMgmt.cc index cad02d315..352ed2352 100644 --- a/catch/unit/device/hipGetProcAddressDevMgmt.cc +++ b/catch/unit/device/hipGetProcAddressDevMgmt.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -50,7 +38,7 @@ void CreateMemPool(int device, hipMemPool_t& mem_pool) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_ValidateDeviceApis") { +TEST_CASE(Unit_hipGetProcAddress_ValidateDeviceApis) { void* hipGetDeviceCount_ptr = nullptr; void* hipRuntimeGetVersion_ptr = nullptr; void* hipDeviceGetLimit_ptr = nullptr; @@ -372,7 +360,7 @@ TEST_CASE("Unit_hipGetProcAddress_ValidateDeviceApis") { * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_PeerDeviceAccessAPIs", "[multigpu]") { +TEST_CASE(Unit_hipGetProcAddress_PeerDeviceAccessAPIs) { void* hipDeviceCanAccessPeer_ptr = nullptr; void* hipSetDevice_ptr = nullptr; void* hipGetDevice_ptr = nullptr; @@ -453,7 +441,7 @@ bool CheckMemPoolSupport(const int device) { return true; } -TEST_CASE("Unit_hipGetProcAddress_SetGetMemPoolAPIs", "[multigpu]") { +TEST_CASE(Unit_hipGetProcAddress_SetGetMemPoolAPIs) { void* hipDeviceSetMemPool_ptr = nullptr; void* hipDeviceGetMemPool_ptr = nullptr; int currentHipVersion = 0; diff --git a/catch/unit/device/hipGetProcAddressHelpers.hh b/catch/unit/device/hipGetProcAddressHelpers.hh index 1eb0a5615..dacc32dff 100644 --- a/catch/unit/device/hipGetProcAddressHelpers.hh +++ b/catch/unit/device/hipGetProcAddressHelpers.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #ifndef CATCH_UNIT_DEVICE_HIPGETPROCADDRESSHELPERS_HH_ #define CATCH_UNIT_DEVICE_HIPGETPROCADDRESSHELPERS_HH_ diff --git a/catch/unit/device/hipGetProcAddressIpcApis.cc b/catch/unit/device/hipGetProcAddressIpcApis.cc index cf016ea3f..61c219480 100644 --- a/catch/unit/device/hipGetProcAddressIpcApis.cc +++ b/catch/unit/device/hipGetProcAddressIpcApis.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -40,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_IPC_Memory") { +TEST_CASE(Unit_hipGetProcAddress_IPC_Memory) { int N = 40; int Nbytes = N * sizeof(int); @@ -137,7 +124,7 @@ TEST_CASE("Unit_hipGetProcAddress_IPC_Memory") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_IPC_Event") { +TEST_CASE(Unit_hipGetProcAddress_IPC_Event) { int fd[2]; REQUIRE(pipe(fd) == 0); diff --git a/catch/unit/device/hipGetSetDeviceFlags.cc b/catch/unit/device/hipGetSetDeviceFlags.cc index 4e605d46d..c5bbaf6de 100644 --- a/catch/unit/device/hipGetSetDeviceFlags.cc +++ b/catch/unit/device/hipGetSetDeviceFlags.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetSetDeviceFlags_NullptrFlag") { +TEST_CASE(Unit_hipGetSetDeviceFlags_NullptrFlag) { HIP_CHECK_ERROR(hipGetDeviceFlags(nullptr), hipErrorInvalidValue); } @@ -80,7 +67,7 @@ std::array getValidFlags() { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetSetDeviceFlags_ValidFlag") { +TEST_CASE(Unit_hipGetSetDeviceFlags_ValidFlag) { auto validFlags = getValidFlags(); unsigned int flag = 0; @@ -101,7 +88,7 @@ TEST_CASE("Unit_hipGetSetDeviceFlags_ValidFlag") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetSetDeviceFlags_SetThenGet") { +TEST_CASE(Unit_hipGetSetDeviceFlags_SetThenGet) { auto validFlags = getValidFlags(); auto devNo = GENERATE(range(0, HipTest::getDeviceCount())); @@ -132,7 +119,7 @@ TEST_CASE("Unit_hipGetSetDeviceFlags_SetThenGet") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetSetDeviceFlags_Threaded") { +TEST_CASE(Unit_hipGetSetDeviceFlags_Threaded) { auto validFlags = getValidFlags(); auto devNo = GENERATE(range(0, HipTest::getDeviceCount())); @@ -182,7 +169,7 @@ TEST_CASE("Unit_hipGetSetDeviceFlags_Threaded") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetDeviceFlags_Positive_Context") { +TEST_CASE(Unit_hipGetDeviceFlags_Positive_Context) { auto validFlags = getValidFlags(); const unsigned int flags = GENERATE_COPY(from_range(std::begin(validFlags), std::end(validFlags))); @@ -232,7 +219,7 @@ TEST_CASE("Unit_hipGetDeviceFlags_Positive_Context") { * - Platform specific (NVIDIA) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetSetDeviceFlags_InvalidFlag") { +TEST_CASE(Unit_hipGetSetDeviceFlags_InvalidFlag) { const unsigned int invalidFlag = GENERATE(0xb011, // schedule flags should not overlap 0xb101, // schedule flags should not overlap 0xb110, // schedule flags should not overlap diff --git a/catch/unit/device/hipInit.cc b/catch/unit/device/hipInit.cc index 0fbacdb3e..78851f95b 100644 --- a/catch/unit/device/hipInit.cc +++ b/catch/unit/device/hipInit.cc @@ -1,23 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -41,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipInit_Positive") { +TEST_CASE(Unit_hipInit_Positive) { HIP_CHECK(hipInit(0)); // Verify that HIP runtime is successfully initialized by calling a HIP API @@ -63,7 +48,7 @@ TEST_CASE("Unit_hipInit_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipInit_Negative") { +TEST_CASE(Unit_hipInit_Negative) { // If initialization is attempted with invalid flag, error shall be reported unsigned int invalid_flag = 1; HIP_CHECK_ERROR(hipInit(invalid_flag), hipErrorInvalidValue); diff --git a/catch/unit/device/hipIpcCloseMemHandle.cc b/catch/unit/device/hipIpcCloseMemHandle.cc index ef2ec1f38..98037fe11 100644 --- a/catch/unit/device/hipIpcCloseMemHandle.cc +++ b/catch/unit/device/hipIpcCloseMemHandle.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -53,7 +37,7 @@ THE SOFTWARE. * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcCloseMemHandle_Positive_Reference_Counting") { +TEST_CASE(Unit_hipIpcCloseMemHandle_Positive_Reference_Counting) { int fd[2]; REQUIRE(pipe(fd) == 0); @@ -118,7 +102,7 @@ TEST_CASE("Unit_hipIpcCloseMemHandle_Positive_Reference_Counting") { * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcCloseMemHandle_Negative_Close_In_Originating_Process") { +TEST_CASE(Unit_hipIpcCloseMemHandle_Negative_Close_In_Originating_Process) { void* ptr; hipIpcMemHandle_t handle; HIP_CHECK(hipMalloc(&ptr, 1024)); diff --git a/catch/unit/device/hipIpcGetMemHandle.cc b/catch/unit/device/hipIpcGetMemHandle.cc index d85f4c030..f516ec473 100644 --- a/catch/unit/device/hipIpcGetMemHandle.cc +++ b/catch/unit/device/hipIpcGetMemHandle.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcGetMemHandle_Positive_Unique_Handles_Separate_Allocations") { +TEST_CASE(Unit_hipIpcGetMemHandle_Positive_Unique_Handles_Separate_Allocations) { void *ptr1, *ptr2; hipIpcMemHandle_t handle1, handle2; HIP_CHECK(hipMalloc(&ptr1, 1024)); @@ -76,7 +60,7 @@ TEST_CASE("Unit_hipIpcGetMemHandle_Positive_Unique_Handles_Separate_Allocations" * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcGetMemHandle_Negative_Handle_For_Freed_Memory") { +TEST_CASE(Unit_hipIpcGetMemHandle_Negative_Handle_For_Freed_Memory) { void* ptr; hipIpcMemHandle_t handle; HIP_CHECK(hipMalloc(&ptr, 1024)); @@ -98,7 +82,7 @@ TEST_CASE("Unit_hipIpcGetMemHandle_Negative_Handle_For_Freed_Memory") { * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcGetMemHandle_Negative_Out_Of_Bound_Pointer") { +TEST_CASE(Unit_hipIpcGetMemHandle_Negative_Out_Of_Bound_Pointer) { int* ptr; constexpr size_t n = 1024; hipIpcMemHandle_t handle; diff --git a/catch/unit/device/hipIpcOpenMemHandle.cc b/catch/unit/device/hipIpcOpenMemHandle.cc index 3beeaa717..5dc9ed1db 100644 --- a/catch/unit/device/hipIpcOpenMemHandle.cc +++ b/catch/unit/device/hipIpcOpenMemHandle.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -52,7 +36,7 @@ THE SOFTWARE. * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcOpenMemHandle_Negative_Open_In_Creating_Process") { +TEST_CASE(Unit_hipIpcOpenMemHandle_Negative_Open_In_Creating_Process) { hipDeviceptr_t ptr1, ptr2; hipIpcMemHandle_t handle; HIP_CHECK(hipMalloc(reinterpret_cast(&ptr1), 1024)); @@ -78,7 +62,7 @@ TEST_CASE("Unit_hipIpcOpenMemHandle_Negative_Open_In_Creating_Process") { * - Host specific (LINUX) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipIpcOpenMemHandle_Negative_Open_In_Two_Contexts_Same_Device") { +TEST_CASE(Unit_hipIpcOpenMemHandle_Negative_Open_In_Two_Contexts_Same_Device) { int fd[2]; REQUIRE(pipe(fd) == 0); diff --git a/catch/unit/device/hipRuntimeGetVersion.cc b/catch/unit/device/hipRuntimeGetVersion.cc index 96e779723..0e0d0ba58 100644 --- a/catch/unit/device/hipRuntimeGetVersion.cc +++ b/catch/unit/device/hipRuntimeGetVersion.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -42,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipRuntimeGetVersion_Positive") { +TEST_CASE(Unit_hipRuntimeGetVersion_Positive) { int runtimeVersion = -1; HIP_CHECK(hipRuntimeGetVersion(&runtimeVersion)); REQUIRE(runtimeVersion > 0); @@ -62,7 +49,7 @@ TEST_CASE("Unit_hipRuntimeGetVersion_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipRuntimeGetVersion_Negative") { +TEST_CASE(Unit_hipRuntimeGetVersion_Negative) { // If initialization is attempted with nullptr, error shall be reported CHECK_FALSE(hipRuntimeGetVersion(nullptr) == hipSuccess); } diff --git a/catch/unit/device/hipSetGetDevice.cc b/catch/unit/device/hipSetGetDevice.cc index db740cc65..19f224563 100644 --- a/catch/unit/device/hipSetGetDevice.cc +++ b/catch/unit/device/hipSetGetDevice.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -44,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipSetDevice_BasicSetGet", "[multigpu]") { +TEST_CASE(Unit_hipSetDevice_BasicSetGet) { int numDevices = 0; int device{}; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -73,7 +58,7 @@ TEST_CASE("Unit_hipSetDevice_BasicSetGet", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetSetDevice_MultiThreaded", "[multigpu]") { +TEST_CASE(Unit_hipGetSetDevice_MultiThreaded) { auto maxThreads = std::thread::hardware_concurrency(); auto deviceCount = HipTest::getDeviceCount(); @@ -126,7 +111,7 @@ TEST_CASE("Unit_hipGetSetDevice_MultiThreaded", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipSetGetDevice_Positive_Threaded_Basic", "[multigpu]") { +TEST_CASE(Unit_hipSetGetDevice_Positive_Threaded_Basic) { class HipSetGetDeviceThreadedTest : public ThreadedZigZagTest { public: void TestPart1() { HIP_CHECK(hipSetDevice(0)); } @@ -181,7 +166,7 @@ TEST_CASE("Unit_hipSetGetDevice_Positive_Threaded_Basic", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipSetGetDevice_Negative") { +TEST_CASE(Unit_hipSetGetDevice_Negative) { SECTION("Get Device - nullptr") { HIP_CHECK_ERROR(hipGetDevice(nullptr), hipErrorInvalidValue); } SECTION("Set Device - -1") { HIP_CHECK_ERROR(hipSetDevice(-1), hipErrorInvalidDevice); } @@ -243,7 +228,7 @@ TEST_CASE("Unit_hipSetGetDevice_Negative") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGet_Negative") { +TEST_CASE(Unit_hipDeviceGet_Negative) { // TODO enable after EXSWCPHIPT-104 is fixed #if HT_NVIDIA HIP_CHECK(hipInit(0)); diff --git a/catch/unit/device/hipSetValidDevices.cc b/catch/unit/device/hipSetValidDevices.cc index 5990e059f..4cb4c1e76 100644 --- a/catch/unit/device/hipSetValidDevices.cc +++ b/catch/unit/device/hipSetValidDevices.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -99,7 +83,7 @@ static void performOperations() { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipSetValidDevices_Negative") { +TEST_CASE(Unit_hipSetValidDevices_Negative) { auto totalDevices = HipTest::getDeviceCount(); int device_arr1[] = {0}; int device_arr2[] = {totalDevices}; @@ -130,7 +114,7 @@ TEST_CASE("Unit_hipSetValidDevices_Negative") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipSetValidDevices_Negative_Length_Lessthan_DeviceArrSize") { +TEST_CASE(Unit_hipSetValidDevices_Negative_Length_Lessthan_DeviceArrSize) { int deviceCount = HipTest::getDeviceCount(); SECTION("length < 0 and valid dev arr") { @@ -158,7 +142,7 @@ TEST_CASE("Unit_hipSetValidDevices_Negative_Length_Lessthan_DeviceArrSize") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipSetValidDevices_Positive_Basic", "[multigpu]") { +TEST_CASE(Unit_hipSetValidDevices_Positive_Basic) { int totalDevices = HipTest::getDeviceCount(); if (totalDevices < 2) { HipTest::HIP_SKIP_TEST("This test requires 2 or more GPUs. Skipping."); @@ -212,7 +196,7 @@ TEST_CASE("Unit_hipSetValidDevices_Positive_Basic", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipSetValidDevices_WithAllDevicesInSystem") { +TEST_CASE(Unit_hipSetValidDevices_WithAllDevicesInSystem) { int deviceCount; HIP_CHECK(hipGetDeviceCount(&deviceCount)); @@ -260,7 +244,7 @@ TEST_CASE("Unit_hipSetValidDevices_WithAllDevicesInSystem") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipSetValidDevices_Positive_Cases") { +TEST_CASE(Unit_hipSetValidDevices_Positive_Cases) { int deviceCount = HipTest::getDeviceCount(); if (deviceCount < 2) { HipTest::HIP_SKIP_TEST("Skipping, as this test requires more than 2 GPUs"); @@ -316,7 +300,7 @@ TEST_CASE("Unit_hipSetValidDevices_Positive_Cases") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipSetValidDevices_MultiProcess") { +TEST_CASE(Unit_hipSetValidDevices_MultiProcess) { int deviceCount = HipTest::getDeviceCount(); if (deviceCount < 2) { HipTest::HIP_SKIP_TEST("Skipping, as this test requires more than 2 GPUs"); @@ -382,7 +366,7 @@ void launchFunction(int deviceId) { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipSetValidDevices_MultiThread") { +TEST_CASE(Unit_hipSetValidDevices_MultiThread) { int deviceCount = HipTest::getDeviceCount(); if (deviceCount < 2) { HipTest::HIP_SKIP_TEST("Skipping, as this test requires more than 2 GPUs"); @@ -424,7 +408,7 @@ TEST_CASE("Unit_hipSetValidDevices_MultiThread") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipSetValidDevices_with_hipMemcpyPeer") { +TEST_CASE(Unit_hipSetValidDevices_with_hipMemcpyPeer) { int deviceCount = HipTest::getDeviceCount(); if (deviceCount < 2) { HipTest::HIP_SKIP_TEST("Skipping, as this test requires more than 2 GPUs"); diff --git a/catch/unit/device/multipleUUID_Exe.cc b/catch/unit/device/multipleUUID_Exe.cc index 9b0d14f40..1022ae34c 100644 --- a/catch/unit/device/multipleUUID_Exe.cc +++ b/catch/unit/device/multipleUUID_Exe.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include diff --git a/catch/unit/device/passUUIDToGrandChild_Exe.cc b/catch/unit/device/passUUIDToGrandChild_Exe.cc index 0bbdc0974..2e697be63 100644 --- a/catch/unit/device/passUUIDToGrandChild_Exe.cc +++ b/catch/unit/device/passUUIDToGrandChild_Exe.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include int main(int argc, char** argv) { diff --git a/catch/unit/device/setEnvInChildProc_Exe.cc b/catch/unit/device/setEnvInChildProc_Exe.cc index 7242c00a0..700d0e7fa 100644 --- a/catch/unit/device/setEnvInChildProc_Exe.cc +++ b/catch/unit/device/setEnvInChildProc_Exe.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #ifdef _WIN64 diff --git a/catch/unit/device/setuuidGetDevCount_Exe.cc b/catch/unit/device/setuuidGetDevCount_Exe.cc index 171347b59..417a1cec8 100644 --- a/catch/unit/device/setuuidGetDevCount_Exe.cc +++ b/catch/unit/device/setuuidGetDevCount_Exe.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include int main() { int devCount = 0; diff --git a/catch/unit/device/uuidList.cc b/catch/unit/device/uuidList.cc index a76e1871c..047630129 100644 --- a/catch/unit/device/uuidList.cc +++ b/catch/unit/device/uuidList.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include diff --git a/catch/unit/deviceLib/AtomicAdd_Coherent_withnoUnsafeflag.cc b/catch/unit/deviceLib/AtomicAdd_Coherent_withnoUnsafeflag.cc index 258ccff12..da89e4c20 100644 --- a/catch/unit/deviceLib/AtomicAdd_Coherent_withnoUnsafeflag.cc +++ b/catch/unit/deviceLib/AtomicAdd_Coherent_withnoUnsafeflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on FineGrainMemory 1. The following test scenario verifies @@ -46,7 +32,7 @@ Output: atomicAdd API would work and the 0/P is INITIAL_VAL + INC_VAL global_atomic_cmpswap instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_AtomicAdd_Coherentwithnounsafeflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_AtomicAdd_Coherentwithnounsafeflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/AtomicAdd_Coherent_withoutflag.cc b/catch/unit/deviceLib/AtomicAdd_Coherent_withoutflag.cc index 7502739a4..aa3ff0218 100644 --- a/catch/unit/deviceLib/AtomicAdd_Coherent_withoutflag.cc +++ b/catch/unit/deviceLib/AtomicAdd_Coherent_withoutflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on FineGrainMemory 1. The following test scenario verifies @@ -44,7 +30,7 @@ Output: atomicAdd API would work and the 0/P is INITIAL_VAL + INC_VAL global_atomic_cmpswap instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_AtomicAdd_Coherentwithoutflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_AtomicAdd_Coherentwithoutflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/AtomicAdd_Coherent_withunsafeflag.cc b/catch/unit/deviceLib/AtomicAdd_Coherent_withunsafeflag.cc index 7621fc9be..5375f73bd 100644 --- a/catch/unit/deviceLib/AtomicAdd_Coherent_withunsafeflag.cc +++ b/catch/unit/deviceLib/AtomicAdd_Coherent_withunsafeflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on FineGrainMemory 1. The following test scenario verifies @@ -45,7 +31,7 @@ Output: atomicAdd API would return 0 and the 0/P is 5 global_atomic_cmpswap instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_AtomicAdd_CoherentwithUnsafeflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_AtomicAdd_CoherentwithUnsafeflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/AtomicAdd_NonCoherent_withnoUnsafeflag.cc b/catch/unit/deviceLib/AtomicAdd_NonCoherent_withnoUnsafeflag.cc index dd996ade5..2b144882b 100644 --- a/catch/unit/deviceLib/AtomicAdd_NonCoherent_withnoUnsafeflag.cc +++ b/catch/unit/deviceLib/AtomicAdd_NonCoherent_withnoUnsafeflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on CoarseGrainMemory 1. The following test scenario verifies @@ -44,7 +30,7 @@ Output: atomicAdd API would work and the 0/P is INITIAL_VAL + INC_VAL global_atomic_cmpswap instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_AtomicAdd_NonCoherentwithnounsafeflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_AtomicAdd_NonCoherentwithnounsafeflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/AtomicAdd_NonCoherent_withoutflag.cc b/catch/unit/deviceLib/AtomicAdd_NonCoherent_withoutflag.cc index 99ed02987..3c96c9233 100644 --- a/catch/unit/deviceLib/AtomicAdd_NonCoherent_withoutflag.cc +++ b/catch/unit/deviceLib/AtomicAdd_NonCoherent_withoutflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on CoarseGrainMemory 1. The following test scenario verifies @@ -45,7 +31,7 @@ Output: atomicAdd API would work and the 0/P is INITIAL_VAL + INC_VAL global_atomic_cmpswap instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_AtomicAdd_NonCoherentwithoutflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_AtomicAdd_NonCoherentwithoutflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/AtomicAdd_NonCoherent_withunsafeflag.cc b/catch/unit/deviceLib/AtomicAdd_NonCoherent_withunsafeflag.cc index c8706fa16..ddbd73f1e 100644 --- a/catch/unit/deviceLib/AtomicAdd_NonCoherent_withunsafeflag.cc +++ b/catch/unit/deviceLib/AtomicAdd_NonCoherent_withunsafeflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on CoarseGrainMemory 1. The following test scenario verifies @@ -44,7 +30,7 @@ Output: atomicAdd API would work and the 0/P is 15 global_atomic_add_float/double instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_AtomicAdd_NonCoherentwithUnsafeflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_AtomicAdd_NonCoherentwithUnsafeflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/Atomic_func.cc b/catch/unit/deviceLib/Atomic_func.cc index 4063aba3c..72d955a4c 100644 --- a/catch/unit/deviceLib/Atomic_func.cc +++ b/catch/unit/deviceLib/Atomic_func.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -78,7 +65,7 @@ static void launchAtomicFunction(int* Hptr, int val, int TestToRun) { HIP_CHECK(hipFree(dptr)); } -TEST_CASE("Unit_AtomicFunctions_Inc") { +TEST_CASE(Unit_AtomicFunctions_Inc) { int* Hptr{nullptr}; int val; // Allocate Host memory @@ -98,7 +85,7 @@ TEST_CASE("Unit_AtomicFunctions_Inc") { free(Hptr); } -TEST_CASE("Unit_AtomicFunctions_Dec") { +TEST_CASE(Unit_AtomicFunctions_Dec) { int* Hptr{nullptr}; int val; // Allocate Host memory diff --git a/catch/unit/deviceLib/AtomicsWithRandomActiveLanesInWavefront.cc b/catch/unit/deviceLib/AtomicsWithRandomActiveLanesInWavefront.cc index fa7043b2b..113b8f3f3 100644 --- a/catch/unit/deviceLib/AtomicsWithRandomActiveLanesInWavefront.cc +++ b/catch/unit/deviceLib/AtomicsWithRandomActiveLanesInWavefront.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ // Testcase Description: // Verifies working of following Global Atomic Operations: @@ -790,7 +777,7 @@ for INT and UNSIGNED INT types // 6. atomicOr // 7. atomicXor */ -TEST_CASE("Unit_AtomicsWithRandomActiveLanesInWavefront_UniformInteger") { +TEST_CASE(Unit_AtomicsWithRandomActiveLanesInWavefront_UniformInteger) { SECTION("test for int") { runIntTest(); } SECTION("test for unsigned int") { runIntTest(); } } @@ -803,7 +790,7 @@ for FLOAT types // 3. atomicMax // 4. atomicMin */ -TEST_CASE("Unit_AtomicsWithRandomActiveLanesInWavefront_UniformFloat") { +TEST_CASE(Unit_AtomicsWithRandomActiveLanesInWavefront_UniformFloat) { SECTION("test for float") { runFloatTest(); } } @@ -818,7 +805,7 @@ for INT and UNSIGNED INT types // 6. atomicOr // 7. atomicXor */ -TEST_CASE("Unit_AtomicsWithRandomActiveLanesInWavefront_DivergentInteger") { +TEST_CASE(Unit_AtomicsWithRandomActiveLanesInWavefront_DivergentInteger) { SECTION("test for int") { runDivIntTest(); } SECTION("test for unsigned int") { runDivIntTest(); } } @@ -831,6 +818,6 @@ for FLOAT types // 3. atomicMax // 4. atomicMin */ -TEST_CASE("Unit_AtomicsWithRandomActiveLanesInWavefront_DivergentFloat") { +TEST_CASE(Unit_AtomicsWithRandomActiveLanesInWavefront_DivergentFloat) { SECTION("test for float") { runDivFloatTest(); } } \ No newline at end of file diff --git a/catch/unit/deviceLib/BuiltIns_fadd.cc b/catch/unit/deviceLib/BuiltIns_fadd.cc deleted file mode 100644 index eb15320be..000000000 --- a/catch/unit/deviceLib/BuiltIns_fadd.cc +++ /dev/null @@ -1,298 +0,0 @@ -/* - Copyright (c) 2021 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. - */ -/* -This testfile verifies __builtin_amdgcn_global_atomic_fadd_f64 API scenarios -1. AtomicAdd on Coherent Memory -2. AtomicAdd on Non-Coherent Memory -3. AtomicAdd on Coherent Memory with RTC -4. AtomicAdd on Non-Coherent Memory with RTC -*/ - -#include -#include -#include -#include - -#define INC_VAL 10 -#define INITIAL_VAL 5 -__global__ void AtomicAdd_GlobalMem(double* addr, double* result) { - double inc_val = 10; - *result = unsafeAtomicAdd(addr, inc_val); -} -static constexpr auto AtomicAddGlobalMem{ - R"( -extern "C" -__global__ void AtomicAdd_GlobalMem(double* addr, double* result) { - double inc_val = 10; - *result = unsafeAtomicAdd(addr, inc_val); -} -)"}; -/* -This test verifies the built in atomic add API on Coherent Memory -Input: A_h with INITIAL_VAL -Output: A_h will not get updated with Coherent Memory - A_h will be INITIAL_VAL - ret value would be 0, B_h would be 0 -*/ -TEST_CASE("Unit_BuiltInAtomicAdd_CoherentGlobalMem") { - hipDeviceProp_t prop; - int device; - HIP_CHECK(hipGetDevice(&device)); - HIP_CHECK(hipGetDeviceProperties(&prop, device)); - std::string gfxName(prop.gcnArchName); - if (CheckIfFeatSupported(CTFeatures::CT_FEATURE_FINEGRAIN_HWSUPPORT, gfxName)) { - if (prop.canMapHostMemory != 1) { - SUCCEED("Does support HostPinned Memory"); - } else { - double *A_h, *result_h, *result; - double* A_d; - HIP_CHECK( - hipHostMalloc(reinterpret_cast(&A_h), sizeof(double), hipHostMallocCoherent)); - HIP_CHECK(hipHostMalloc(reinterpret_cast(&result_h), sizeof(double), - hipHostMallocCoherent)); - A_h[0] = INITIAL_VAL; - HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&A_d), A_h, 0)); - HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&result), result_h, 0)); - std::cout << "test" << std::endl; - hipLaunchKernelGGL(AtomicAdd_GlobalMem, dim3(1), dim3(1), 0, 0, A_d, result); - HIP_CHECK(hipGetLastError()); - std::cout << "test 1" << std::endl; - HIP_CHECK(hipDeviceSynchronize()); - if ((gfxName == "gfx90a" || gfxName.find("gfx90a:")) == 0) { - REQUIRE(A_h[0] == INITIAL_VAL); - REQUIRE(*result_h == 0); - } else { - REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL); - REQUIRE(*result_h == INITIAL_VAL); - } - HIP_CHECK(hipHostFree(A_h)); - HIP_CHECK(hipFree(result)); - } - } else { - SUCCEED( - "Memory model feature is only supported for gfx90a, gfx942, gfx950," - "Hence skipping the testcase for this GPU " - << device); - } -} - -/* -This test verifies the built in atomic add API on Non-Coherent Memory -Input: A_h with INITIAL_VAL -Output: A_h will not get updated with Coherent Memory - A_h will be INITIAL_VAL+INC_VAL - B_h would be initial value of A_h, B_h would be INITIAL_VAL -*/ -TEST_CASE("Unit_BuiltInAtomicAdd_NonCoherentGlobalMem") { - hipDeviceProp_t prop; - int device; - HIP_CHECK(hipGetDevice(&device)); - HIP_CHECK(hipGetDeviceProperties(&prop, device)); - std::string gfxName(prop.gcnArchName); - if (CheckIfFeatSupported(CTFeatures::CT_FEATURE_FINEGRAIN_HWSUPPORT, gfxName)) { - if (prop.canMapHostMemory != 1) { - SUCCEED("Does not support HostPinned Memory"); - } else { - double *A_h, *result, *B_h; - double* A_d; - HIP_CHECK( - hipHostMalloc(reinterpret_cast(&A_h), sizeof(double), hipHostMallocNonCoherent)); - B_h = reinterpret_cast(malloc(sizeof(double))); - HIP_CHECK(hipMalloc(reinterpret_cast(&result), sizeof(double))); - A_h[0] = INITIAL_VAL; - HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&A_d), A_h, 0)); - hipLaunchKernelGGL(AtomicAdd_GlobalMem, dim3(1), dim3(1), 0, 0, static_cast(A_d), - static_cast(result)); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost)); - REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL); - REQUIRE(*B_h == INITIAL_VAL); - HIP_CHECK(hipHostFree(A_h)); - HIP_CHECK(hipFree(result)); - free(B_h); - } - } else { - SUCCEED( - "Memory model feature is only supported for gfx90a, gfx942, gfx950" - "Hence skipping the testcase for GPU-0"); - } -} -/* -This test verifies the built in atomic add API on Coherent Memory with RTC -Input: A_h with INITIAL_VAL -Output: A_h will not get updated with Coherent Memory - A_h will be INITIAL_VAL - ret value would be 0, B_h would be 0 -*/ -TEST_CASE("Unit_BuiltInAtomicAdd_CoherentGlobalMemWithRtc") { - hipDeviceProp_t prop; - int device; - HIP_CHECK(hipGetDevice(&device)); - HIP_CHECK(hipGetDeviceProperties(&prop, device)); - std::string gfxName(prop.gcnArchName); - if (CheckIfFeatSupported(CTFeatures::CT_FEATURE_FINEGRAIN_HWSUPPORT, gfxName)) { - if (prop.canMapHostMemory != 1) { - SUCCEED("Does not support HostPinned Memory"); - } else { - hiprtcProgram prog; - hiprtcCreateProgram(&prog, // prog - AtomicAddGlobalMem, // buffer - "kernel.cu", // name - 0, nullptr, nullptr); - std::string sarg = std::string("--gpu-architecture=") + prop.gcnArchName; - const char* options[] = {sarg.c_str()}; - hiprtcResult compileResult{hiprtcCompileProgram(prog, 1, options)}; - - size_t logSize; - HIPRTC_CHECK(hiprtcGetProgramLogSize(prog, &logSize)); - if (logSize) { - std::string log(logSize, '\0'); - HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); - INFO(log); - } - - REQUIRE(compileResult == HIPRTC_SUCCESS); - size_t codeSize; - HIPRTC_CHECK(hiprtcGetCodeSize(prog, &codeSize)); - - std::vector code(codeSize); - HIPRTC_CHECK(hiprtcGetCode(prog, code.data())); - HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); - - hipModule_t module; - hipFunction_t fmaxkernel; - HIP_CHECK(hipModuleLoadData(&module, code.data())); - HIP_CHECK(hipModuleGetFunction(&fmaxkernel, module, "AtomicAdd_GlobalMem")); - double *A_h, *result, *B_h; - double* A_d; - HIP_CHECK( - hipHostMalloc(reinterpret_cast(&A_h), sizeof(double), hipHostMallocCoherent)); - B_h = reinterpret_cast(malloc(sizeof(double))); - HIP_CHECK(hipMalloc(reinterpret_cast(&result), sizeof(double))); - A_h[0] = INITIAL_VAL; - HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&A_d), A_h, 0)); - struct { - double* p; - double* res; - } args_f{A_d, result}; - auto size = sizeof(args_f); - void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f, HIP_LAUNCH_PARAM_BUFFER_SIZE, - &size, HIP_LAUNCH_PARAM_END}; - HIP_CHECK(hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0, nullptr, nullptr, config_d)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost)); - if ((gfxName == "gfx90a" || gfxName.find("gfx90a:")) == 0) { - REQUIRE(A_h[0] == INITIAL_VAL); - REQUIRE(*B_h == 0); - } else { - REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL); - REQUIRE(*B_h == INITIAL_VAL); - } - HIP_CHECK(hipHostFree(A_h)); - HIP_CHECK(hipFree(result)); - free(B_h); - } - } else { - SUCCEED( - "Memory model feature is only supported for gfx90a, gfx942, gfx950," - "Hence skipping the testcase for this GPU " - << device); - } -} - -/* -This test verifies the built in atomic add API on Non-Coherent Memory -Input: A_h with INITIAL_VAL -Output: A_h will not get updated with Coherent Memory - A_h will be INITIAL_VAL+INC_VAL - B_h would be initial value of A_h, B_h would be INITIAL_VAL -*/ -TEST_CASE("Unit_BuiltInAtomicAdd_NonCoherentGlobalMemWithRtc") { - hipDeviceProp_t prop; - int device; - HIP_CHECK(hipGetDevice(&device)); - HIP_CHECK(hipGetDeviceProperties(&prop, device)); - std::string gfxName(prop.gcnArchName); - if (CheckIfFeatSupported(CTFeatures::CT_FEATURE_FINEGRAIN_HWSUPPORT, gfxName)) { - if (prop.canMapHostMemory != 1) { - SUCCEED("Does support HostPinned Memory"); - } else { - hiprtcProgram prog; - hiprtcCreateProgram(&prog, // prog - AtomicAddGlobalMem, // buffer - "kernel.cu", // name - 0, nullptr, nullptr); - std::string sarg = std::string("--gpu-architecture=") + prop.gcnArchName; - const char* options[] = {sarg.c_str()}; - hiprtcResult compileResult{hiprtcCompileProgram(prog, 1, options)}; - - size_t logSize; - HIPRTC_CHECK(hiprtcGetProgramLogSize(prog, &logSize)); - if (logSize) { - std::string log(logSize, '\0'); - HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); - WARN(log); - } - - REQUIRE(compileResult == HIPRTC_SUCCESS); - size_t codeSize; - HIPRTC_CHECK(hiprtcGetCodeSize(prog, &codeSize)); - - std::vector code(codeSize); - HIPRTC_CHECK(hiprtcGetCode(prog, code.data())); - HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); - - hipModule_t module; - hipFunction_t fmaxkernel; - HIP_CHECK(hipModuleLoadData(&module, code.data())); - HIP_CHECK(hipModuleGetFunction(&fmaxkernel, module, "AtomicAdd_GlobalMem")); - double *A_h, *result, *B_h; - double* A_d; - HIP_CHECK( - hipHostMalloc(reinterpret_cast(&A_h), sizeof(double), hipHostMallocNonCoherent)); - B_h = reinterpret_cast(malloc(sizeof(double))); - HIP_CHECK(hipMalloc(reinterpret_cast(&result), sizeof(double))); - A_h[0] = INITIAL_VAL; - HIP_CHECK(hipHostGetDevicePointer(reinterpret_cast(&A_d), A_h, 0)); - struct { - double* p; - double* res; - } args_f{A_d, result}; - auto size = sizeof(args_f); - void* config_d[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args_f, HIP_LAUNCH_PARAM_BUFFER_SIZE, - &size, HIP_LAUNCH_PARAM_END}; - HIP_CHECK(hipModuleLaunchKernel(fmaxkernel, 1, 1, 1, 1, 1, 1, 0, nullptr, nullptr, config_d)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipMemcpy(B_h, result, sizeof(double), hipMemcpyDeviceToHost)); - REQUIRE(A_h[0] == INITIAL_VAL + INC_VAL); - REQUIRE(*B_h == INITIAL_VAL); - HIP_CHECK(hipHostFree(A_h)); - HIP_CHECK(hipFree(result)); - free(B_h); - } - } else { - SUCCEED( - "Memory model feature is only supported for gfx90a, gfx942, gfx950," - "Hence skipping the testcase for this GPU " - << device); - } -} diff --git a/catch/unit/deviceLib/BuiltIns_fmax.cc b/catch/unit/deviceLib/BuiltIns_fmax.cc index 5aaba7017..c68ad338d 100644 --- a/catch/unit/deviceLib/BuiltIns_fmax.cc +++ b/catch/unit/deviceLib/BuiltIns_fmax.cc @@ -1,23 +1,9 @@ /* - Copyright (c) 2021 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* This testfile verifies Built fmax API scenarios 1. Builtin fmax on Coherent Memory with memory type as global @@ -74,7 +60,7 @@ Input: A_h with INITIAL_VAL Output: Return val would be 0 and the input value to API will not get updated. A_h would be INITIAL_VAL, B_h is 0 */ -TEST_CASE("Unit_BuiltinAtomics_fmaxCoherentGlobalMem") { +TEST_CASE(Unit_BuiltinAtomics_fmaxCoherentGlobalMem) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); @@ -121,7 +107,7 @@ Output: Return val would be initial val of A_h and the input value of API would be updated with the max value A_h would be 10, B_h would be INITIAL_VAL */ -TEST_CASE("Unit_BuiltinAtomics_fmaxNonCoherentGlobalFlatMem") { +TEST_CASE(Unit_BuiltinAtomics_fmaxNonCoherentGlobalFlatMem) { int mem_type = GENERATE(0, 1); hipDeviceProp_t prop; int device; @@ -172,7 +158,7 @@ Input: A_h with INITIAL_VAL Output: Return val would be 0 and the input value to API will not get updated. A_h would be INITIAL_VAL, B_h is 0 */ -TEST_CASE("Unit_BuiltinAtomicsRTC_fmaxCoherentGlobalMem") { +TEST_CASE(Unit_BuiltinAtomicsRTC_fmaxCoherentGlobalMem) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); @@ -253,7 +239,7 @@ Output: Return val would be initial val of A_h and the input value of API would be updated with the max value A_h would be 10, B_h would be INITIAL_VAL */ -TEST_CASE("Unit_BuiltinAtomicsRTC_fmaxNonCoherentGlobalFlatMem") { +TEST_CASE(Unit_BuiltinAtomicsRTC_fmaxNonCoherentGlobalFlatMem) { int mem_type = GENERATE(0, 1); hipDeviceProp_t prop; int device; diff --git a/catch/unit/deviceLib/BuiltIns_fmin.cc b/catch/unit/deviceLib/BuiltIns_fmin.cc index b32e0e389..c1dfb4c92 100644 --- a/catch/unit/deviceLib/BuiltIns_fmin.cc +++ b/catch/unit/deviceLib/BuiltIns_fmin.cc @@ -1,23 +1,9 @@ /* - Copyright (c) 2021 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* This testfile verifies Built fmin API scenarios 1. Builtin fmin on Coherent Memory with memory type as global @@ -74,7 +60,7 @@ Input: A_h with INITIAL_VAL Output: Return val would be 0 and the input value to API will not get updated. A_h would be INITIAL_VAL, B_h is 0 */ -TEST_CASE("Unit_BuiltinAtomics_fminCoherentGlobalMem") { +TEST_CASE(Unit_BuiltinAtomics_fminCoherentGlobalMem) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); @@ -121,7 +107,7 @@ Output: Return val would be initial val of A_h and the input value of API would be updated with the min value A_h would be INITIAL_VAL, B_h would be INITIAL_VAL */ -TEST_CASE("Unit_BuiltinAtomics_fminNonCoherentGlobalFlatMem") { +TEST_CASE(Unit_BuiltinAtomics_fminNonCoherentGlobalFlatMem) { auto mem_type = GENERATE(0, 1); hipDeviceProp_t prop; int device; @@ -173,7 +159,7 @@ Output: Return val would be 0 and the input value to API will not get updated. A_h would be INITIAL_VAL, B_h is 0 */ -TEST_CASE("Unit_BuiltinAtomicsRTC__fminCoherentGlobalMem") { +TEST_CASE(Unit_BuiltinAtomicsRTC__fminCoherentGlobalMem) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); @@ -255,7 +241,7 @@ Output: Return val would be initial val of A_h and the input value of API would be updated with the max value A_h would be 10, B_h would be INITIAL_VAL */ -TEST_CASE("Unit_BuiltinAtomicsRTC_fminNonCoherentGlobalFlatMem") { +TEST_CASE(Unit_BuiltinAtomicsRTC_fminNonCoherentGlobalFlatMem) { int mem_type = GENERATE(0, 1); hipDeviceProp_t prop; int device; diff --git a/catch/unit/deviceLib/CMakeLists.txt b/catch/unit/deviceLib/CMakeLists.txt index bbe5597b0..f60fbdb29 100644 --- a/catch/unit/deviceLib/CMakeLists.txt +++ b/catch/unit/deviceLib/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(TEST_SRC @@ -38,7 +22,6 @@ set(TEST_SRC DoublePrecisionIntrinsics.cc DoublePrecisionMathDevice.cc DoublePrecisionMathHost.cc - FloatMathPrecise.cc IntegerIntrinsics.cc SinglePrecisionIntrinsics.cc SinglePrecisionMathDevice.cc @@ -100,7 +83,6 @@ set(AMD_ARCH_SPEC_TEST_SRC AtomicAdd_NonCoherent_withunsafeflag.cc BuiltIns_fmax.cc BuiltIns_fmin.cc - BuiltIns_fadd.cc unsafeAtomicAdd_RTC.cc unsafeAtomicAdd_Coherent_withunsafeflag.cc unsafeAtomicAdd_Coherent_withoutflag.cc @@ -118,33 +100,57 @@ set(AMD_GFX1200_SPEC_TEST_SRC fp8_ocp.cc ) -# Note to pass arch use format like -DOFFLOAD_ARCH_STR="--offload-arch=gfx900 --offload-arch=gfx906" -# having space at the start/end of OFFLOAD_ARCH_STR can cause build failures -add_custom_target(kerDevAllocMultCO.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} +if (HIP_PLATFORM MATCHES "amd") + add_custom_target(kerDevAllocMultCO.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kerDevAllocMultCO.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevAllocMultCO.code -I${HIP_INCLUDE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -add_custom_target(kerDevWriteMultCO.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(kerDevWriteMultCO.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kerDevWriteMultCO.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevWriteMultCO.code -I${HIP_INCLUDE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -add_custom_target(kerDevFreeMultCO.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(kerDevFreeMultCO.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kerDevFreeMultCO.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevFreeMultCO.code -I${HIP_INCLUDE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -add_custom_target(kerDevAllocSingleKer.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(kerDevAllocSingleKer.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kerDevAllocSingleKer.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevAllocSingleKer.code -I${HIP_INCLUDE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) - +else() + add_custom_target(kerDevAllocMultCO.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/kerDevAllocMultCO.cc + -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevAllocMultCO.code + -I${HIP_INCLUDE_DIR} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) + add_custom_target(kerDevWriteMultCO.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/kerDevWriteMultCO.cc + -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevWriteMultCO.code + -I${HIP_INCLUDE_DIR} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) + add_custom_target(kerDevFreeMultCO.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/kerDevFreeMultCO.cc + -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevFreeMultCO.code + -I${HIP_INCLUDE_DIR} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) + add_custom_target(kerDevAllocSingleKer.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/kerDevAllocSingleKer.cc + -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/deviceLib/kerDevAllocSingleKer.code + -I${HIP_INCLUDE_DIR} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) +endif() set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/kerDevAllocSingleKer.code) set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/kerDevFreeMultCO.code) set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/kerDevWriteMultCO.code) @@ -176,19 +182,20 @@ function(CheckAcceptedArchs OFFLOAD_ARCH_STR_LOCAL) endfunction() # CheckAcceptedArchs if(HIP_PLATFORM MATCHES "amd") - if (DEFINED OFFLOAD_ARCH_STR) - CheckAcceptedArchs(${OFFLOAD_ARCH_STR}) - elseif(DEFINED $ENV{HCC_AMDGPU_TARGET}) - CheckAcceptedArchs($ENV{HCC_AMDGPU_TARGET}) - else() - set(ARCH_CHECK -1) - set(ARCH_GFX940 -1) - set(ARCH_GFX1200 -1) - endif() - set(TEST_SRC ${TEST_SRC} ${AMD_TEST_SRC}) - set_source_files_properties(bfloat16.cc PROPERTIES COMPILE_FLAGS "-DHIP_ENABLE_WARP_SYNC_BUILTINS") -if(${ARCH_CHECK} GREATER_EQUAL 0) - set(TEST_SRC ${TEST_SRC} ${AMD_ARCH_SPEC_TEST_SRC}) + # Do not enable arch specific tests for ASAN. + if (DEFINED OFFLOAD_ARCH_STR AND NOT (ENABLE_ADDRESS_SANITIZER OR THEROCK_SANITIZER STREQUAL "ASAN" OR THEROCK_SANITIZER STREQUAL "HOST_ASAN")) + CheckAcceptedArchs(${OFFLOAD_ARCH_STR}) + elseif(DEFINED $ENV{HCC_AMDGPU_TARGET}) + CheckAcceptedArchs($ENV{HCC_AMDGPU_TARGET}) + else() + set(ARCH_CHECK -1) + set(ARCH_GFX940 -1) + set(ARCH_GFX1200 -1) + endif() + set(TEST_SRC ${TEST_SRC} ${AMD_TEST_SRC}) + set_source_files_properties(bfloat16.cc PROPERTIES COMPILE_FLAGS "-DHIP_ENABLE_WARP_SYNC_BUILTINS") + if(${ARCH_CHECK} GREATER_EQUAL 0) + set(TEST_SRC ${TEST_SRC} ${AMD_ARCH_SPEC_TEST_SRC}) set_source_files_properties(AtomicAdd_Coherent_withunsafeflag.cc PROPERTIES COMPILE_OPTIONS "-munsafe-fp-atomics") set_source_files_properties(AtomicAdd_NonCoherent_withunsafeflag.cc PROPERTIES COMPILE_OPTIONS "-munsafe-fp-atomics") set_source_files_properties(AtomicAdd_Coherent_withnoUnsafeflag.cc PROPERTIES COMPILE_OPTIONS "-mno-unsafe-fp-atomics") @@ -202,19 +209,19 @@ if(${ARCH_CHECK} GREATER_EQUAL 0) set_property(SOURCE ${AtomicAdd_files} PROPERTY COMPILE_FLAGS --save-temps) file(GLOB unsafeAtomicAdd_files *unsafeAtomicAdd_*_*.cc) set_property(SOURCE ${unsafeAtomicAdd_files} PROPERTY COMPILE_FLAGS --save-temps) -endif() -if(${ARCH_GFX940} GREATER_EQUAL 0) - set(TEST_SRC ${TEST_SRC} ${AMD_GFX940_SPEC_TEST_SRC}) -endif() -if(${ARCH_GFX1200} GREATER_EQUAL 0) - set(TEST_SRC ${TEST_SRC} ${AMD_GFX1200_SPEC_TEST_SRC}) -endif() - hip_add_exe_to_target(NAME UnitDeviceTests + endif() + if(${ARCH_GFX940} GREATER_EQUAL 0) + set(TEST_SRC ${TEST_SRC} ${AMD_GFX940_SPEC_TEST_SRC}) + endif() + if(${ARCH_GFX1200} GREATER_EQUAL 0) + set(TEST_SRC ${TEST_SRC} ${AMD_GFX1200_SPEC_TEST_SRC}) + endif() + hip_add_exe_to_target(NAME UnitDeviceTests TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests LINKER_LIBS hiprtc::hiprtc) elseif(HIP_PLATFORM MATCHES "nvidia") - hip_add_exe_to_target(NAME UnitDeviceTests + hip_add_exe_to_target(NAME UnitDeviceTests TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests COMPILE_OPTIONS --Wno-deprecated-declarations) diff --git a/catch/unit/deviceLib/DoublePrecisionIntrinsics.cc b/catch/unit/deviceLib/DoublePrecisionIntrinsics.cc index 1f671a084..b04139d17 100644 --- a/catch/unit/deviceLib/DoublePrecisionIntrinsics.cc +++ b/catch/unit/deviceLib/DoublePrecisionIntrinsics.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -73,6 +60,6 @@ __device__ void double_precision_intrinsics() { __global__ void compileDoublePrecisionIntrinsics(int) { double_precision_intrinsics(); } -TEST_CASE("Unit_DoublePrecisionIntrinsics") { +TEST_CASE(Unit_DoublePrecisionIntrinsics) { hipLaunchKernelGGL(compileDoublePrecisionIntrinsics, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, 1); } diff --git a/catch/unit/deviceLib/DoublePrecisionMathDevice.cc b/catch/unit/deviceLib/DoublePrecisionMathDevice.cc index a61e31430..1a5c32a4b 100644 --- a/catch/unit/deviceLib/DoublePrecisionMathDevice.cc +++ b/catch/unit/deviceLib/DoublePrecisionMathDevice.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -125,6 +112,6 @@ __device__ void double_precision_math_functions() { __global__ void compileDoublePrecisionMathOnDevice(int) { double_precision_math_functions(); } -TEST_CASE("Unit_DoublePrecisionMathDevice") { +TEST_CASE(Unit_DoublePrecisionMathDevice) { hipLaunchKernelGGL(compileDoublePrecisionMathOnDevice, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, 1); } diff --git a/catch/unit/deviceLib/DoublePrecisionMathHost.cc b/catch/unit/deviceLib/DoublePrecisionMathHost.cc index ea0a630b6..615ef6071 100644 --- a/catch/unit/deviceLib/DoublePrecisionMathHost.cc +++ b/catch/unit/deviceLib/DoublePrecisionMathHost.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -112,4 +99,4 @@ __host__ static void double_precision_math_functions() { #endif } -TEST_CASE("Unit_DoublePrecisionMathHost") { double_precision_math_functions(); } +TEST_CASE(Unit_DoublePrecisionMathHost) { double_precision_math_functions(); } diff --git a/catch/unit/deviceLib/DynamicAllocas.cc b/catch/unit/deviceLib/DynamicAllocas.cc index af0eef950..39e72ddf5 100644 --- a/catch/unit/deviceLib/DynamicAllocas.cc +++ b/catch/unit/deviceLib/DynamicAllocas.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Testcase Description: // Verifies working of following Dyanmic Allocations: // 1. Dynamic Allocas in kernels, @@ -738,7 +726,7 @@ These testcases perform the following scenarios of dynamic allocas // 10. function calls with parameter passing - over aligned // 11. function calls with parameter passing - sandwiched */ -TEST_CASE("Dynamic_Alloca") { +TEST_CASE(Dynamic_Alloca) { SECTION("Kernel Uniform Dynamic Allocas") { runKernelUniformDynamicAllocasTest(); } SECTION("Kernel Divergent Dynamic Allocas") { runKernelDivergentDynamicAllocasTest(); } SECTION("Kernel Multiple Dynamic Allocas") { runKernelMultipleDynamicAllocasTest(); } diff --git a/catch/unit/deviceLib/FloatMathPrecise.cc b/catch/unit/deviceLib/FloatMathPrecise.cc deleted file mode 100644 index 73090a4a2..000000000 --- a/catch/unit/deviceLib/FloatMathPrecise.cc +++ /dev/null @@ -1,125 +0,0 @@ -/* -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 -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 -#include -#include -#include - -__device__ void FloatMathPrecise() { - int iX; - float fX, fY; - - acosf(1.0f); - acoshf(1.0f); - asinf(0.0f); - asinhf(0.0f); - atan2f(0.0f, 1.0f); - atanf(0.0f); - atanhf(0.0f); - cbrtf(0.0f); - fX = ceilf(0.0f); - fX = copysignf(1.0f, -2.0f); - cosf(0.0f); - coshf(0.0f); - cospif(0.0f); - cyl_bessel_i0f(0.0f); - cyl_bessel_i1f(0.0f); - erfcf(0.0f); - erfcinvf(2.0f); - erfcxf(0.0f); - erff(0.0f); - erfinvf(1.0f); - exp10f(0.0f); - exp2f(0.0f); - expf(0.0f); - expm1f(0.0f); - fX = fabsf(1.0f); - fdimf(1.0f, 0.0f); - fdividef(0.0f, 1.0f); - fX = floorf(0.0f); - fmaf(1.0f, 2.0f, 3.0f); - fX = fmaxf(0.0f, 0.0f); - fX = fminf(0.0f, 0.0f); - fmodf(0.0f, 1.0f); - frexpf(0.0f, &iX); - hypotf(1.0f, 0.0f); - ilogbf(1.0f); - isfinite(0.0f); - fX = isinf(0.0f); - fX = isnan(0.0f); - j0f(0.0f); - j1f(0.0f); - jnf(-1.0f, 1.0f); - ldexpf(0.0f, 0); - lgammaf(1.0f); - llrintf(0.0f); - llroundf(0.0f); - log10f(1.0f); - log1pf(-1.0f); - log2f(1.0f); - logbf(1.0f); - logf(1.0f); - lrintf(0.0f); - lroundf(0.0f); - modff(0.0f, &fX); - fX = nanf("1"); - fX = nearbyintf(0.0f); - nextafterf(0.0f, 0.0f); - norm3df(1.0f, 0.0f, 0.0f); - norm4df(1.0f, 0.0f, 0.0f, 0.0f); - normcdff(0.0f); - normcdfinvf(1.0f); - fX = 1.0f; - normf(1, &fX); - powf(1.0f, 0.0f); - rcbrtf(1.0f); - remainderf(2.0f, 1.0f); - remquof(1.0f, 2.0f, &iX); - rhypotf(0.0f, 1.0f); - fY = rintf(1.0f); - rnorm3df(0.0f, 0.0f, 1.0f); - rnorm4df(0.0f, 0.0f, 0.0f, 1.0f); - fX = 1.0f; - rnormf(1, &fX); - fY = roundf(0.0f); - rsqrtf(1.0f); - scalblnf(0.0f, 1); - scalbnf(0.0f, 1); - signbit(1.0f); - sincosf(0.0f, &fX, &fY); - sincospif(0.0f, &fX, &fY); - sinf(0.0f); - sinhf(0.0f); - sinpif(0.0f); - sqrtf(0.0f); - tanf(0.0f); - tanhf(0.0f); - tgammaf(2.0f); - fY = truncf(0.0f); - y0f(1.0f); - y1f(1.0f); - ynf(1, 1.0f); -} - -__global__ void CompileFloatMathPrecise(int) { FloatMathPrecise(); } - -TEST_CASE("Unit_FloatMathPrecise") { - hipLaunchKernelGGL(CompileFloatMathPrecise, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, 1); -} diff --git a/catch/unit/deviceLib/IntegerIntrinsics.cc b/catch/unit/deviceLib/IntegerIntrinsics.cc index 00c5c3c20..632ef3edf 100644 --- a/catch/unit/deviceLib/IntegerIntrinsics.cc +++ b/catch/unit/deviceLib/IntegerIntrinsics.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -60,6 +47,6 @@ __device__ void integer_intrinsics() { __global__ void compileIntegerIntrinsics(int) { integer_intrinsics(); } -TEST_CASE("Unit_IntegerIntrinsics") { +TEST_CASE(Unit_IntegerIntrinsics) { hipLaunchKernelGGL(compileIntegerIntrinsics, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, 1); } diff --git a/catch/unit/deviceLib/SimpleAtomicsTest.cc b/catch/unit/deviceLib/SimpleAtomicsTest.cc index 7dbcf199c..86d144aaf 100644 --- a/catch/unit/deviceLib/SimpleAtomicsTest.cc +++ b/catch/unit/deviceLib/SimpleAtomicsTest.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -255,7 +242,7 @@ template static void runTest() { HIP_CHECK(hipFree(dOData)); } -TEST_CASE("Unit_SimpleAtomicsTest") { +TEST_CASE(Unit_SimpleAtomicsTest) { SECTION("test for int") { runTest(); } SECTION("test for unsigned int") { runTest(); } SECTION("test for float") { runTest(); } diff --git a/catch/unit/deviceLib/SinglePrecisionIntrinsics.cc b/catch/unit/deviceLib/SinglePrecisionIntrinsics.cc index 1362efe4c..119f97472 100644 --- a/catch/unit/deviceLib/SinglePrecisionIntrinsics.cc +++ b/catch/unit/deviceLib/SinglePrecisionIntrinsics.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -93,6 +80,6 @@ __device__ void single_precision_intrinsics() { __global__ void compileSinglePrecisionIntrinsics(int) { single_precision_intrinsics(); } -TEST_CASE("Unit_SinglePrecisionIntrinsics") { +TEST_CASE(Unit_SinglePrecisionIntrinsics) { hipLaunchKernelGGL(compileSinglePrecisionIntrinsics, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, 1); } diff --git a/catch/unit/deviceLib/SinglePrecisionMathDevice.cc b/catch/unit/deviceLib/SinglePrecisionMathDevice.cc index 4cc2a4d6e..cd6227697 100644 --- a/catch/unit/deviceLib/SinglePrecisionMathDevice.cc +++ b/catch/unit/deviceLib/SinglePrecisionMathDevice.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -115,6 +102,6 @@ __device__ void single_precision_math_functions() { __global__ void compileSinglePrecisionMathOnDevice(int) { single_precision_math_functions(); } -TEST_CASE("Unit_SinglePrecisionMathDevice") { +TEST_CASE(Unit_SinglePrecisionMathDevice) { hipLaunchKernelGGL(compileSinglePrecisionMathOnDevice, dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, 1); } diff --git a/catch/unit/deviceLib/SinglePrecisionMathHost.cc b/catch/unit/deviceLib/SinglePrecisionMathHost.cc index 99a75904d..8b51c68fb 100644 --- a/catch/unit/deviceLib/SinglePrecisionMathHost.cc +++ b/catch/unit/deviceLib/SinglePrecisionMathHost.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -108,4 +95,4 @@ __host__ static void single_precision_math_functions() { #endif } -TEST_CASE("Unit_SinglePrecisionMathHost") { single_precision_math_functions(); } +TEST_CASE(Unit_SinglePrecisionMathHost) { single_precision_math_functions(); } diff --git a/catch/unit/deviceLib/anyAll.cc b/catch/unit/deviceLib/anyAll.cc index 9ca8fb082..d6de3f65d 100644 --- a/catch/unit/deviceLib/anyAll.cc +++ b/catch/unit/deviceLib/anyAll.cc @@ -1,36 +1,26 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include __global__ void warpvote(int* device_any, int* device_all, int pshift) { int tid = threadIdx.x + blockIdx.x * blockDim.x; +#if HT_AMD device_any[threadIdx.x >> pshift] = __any(tid - 77); device_all[threadIdx.x >> pshift] = __all(tid - 77); +#else + unsigned mask = 0xFFFFFFFF; + device_any[threadIdx.x >> pshift] = __any_sync(mask, tid - 77); + device_all[threadIdx.x >> pshift] = __all_sync(mask, tid - 77); +#endif } -TEST_CASE("Unit_AnyAll_CompileTest") { +TEST_CASE(Unit_AnyAll_CompileTest) { int warpSize, pshift; hipDeviceProp_t devProp; HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); diff --git a/catch/unit/deviceLib/ballot.cc b/catch/unit/deviceLib/ballot.cc index 91ac4b587..4694b8611 100644 --- a/catch/unit/deviceLib/ballot.cc +++ b/catch/unit/deviceLib/ballot.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -34,12 +18,13 @@ __global__ void gpu_ballot(unsigned int* device_ballot, unsigned Num_Warps_per_B atomicAdd(&device_ballot[warp_num + blockIdx.x * Num_Warps_per_Block], __popcll(__ballot(tid - 245))); #else + unsigned mask = 0xFFFFFFFF; atomicAdd(&device_ballot[warp_num + blockIdx.x * Num_Warps_per_Block], - __popc(__ballot(tid - 245))); + __popc(__ballot_sync(mask, tid - 245))); #endif } -TEST_CASE("Unit_ballot") { +TEST_CASE(Unit_ballot) { unsigned warpSize, pshift; hipDeviceProp_t devProp; HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); diff --git a/catch/unit/deviceLib/bfloat16.cc b/catch/unit/deviceLib/bfloat16.cc index a31fc94a9..b857ed184 100644 --- a/catch/unit/deviceLib/bfloat16.cc +++ b/catch/unit/deviceLib/bfloat16.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -220,7 +204,7 @@ __global__ void bf16_fma(float* in1, float* in2, float plus_y, float* out, size_ } } -TEST_CASE("Unit_bf16_basic") { +TEST_CASE(Unit_bf16_basic) { auto f_in = getAllBF16(); auto max_bf16_num = f_in.size(); @@ -479,7 +463,7 @@ template __global__ void bf16_cvt_to_integral(Type* in, float* o } } -TEMPLATE_TEST_CASE("Unit_bf16_conversion_to_integral_type", , unsigned short, short, int, +TEMPLATE_TEST_CASE(Unit_bf16_conversion_to_integral_type, unsigned short, short, int, unsigned int) { constexpr TestType start = std::is_unsigned::value ? std::numeric_limits::min() @@ -542,7 +526,7 @@ __global__ void bf162_neq(float* in, char* out, size_t size) { } } -TEST_CASE("Unit_bf162_basic") { +TEST_CASE(Unit_bf162_basic) { auto f_in = getAllBF16(); auto max_bf16_num = f_in.size(); @@ -588,7 +572,7 @@ TEST_CASE("Unit_bf162_basic") { } -TEST_CASE("Unit_bf16_operators_host") { +TEST_CASE(Unit_bf16_operators_host) { SECTION("Sanity with 1 and 0") { INFO("1+0 <-> 0+1"); auto bf16_one = HIPRT_ONE_BF16; @@ -654,7 +638,7 @@ TEST_CASE("Unit_bf16_operators_host") { } } -TEST_CASE("Unit_bf162_operators_host") { +TEST_CASE(Unit_bf162_operators_host) { SECTION("Sanity with 1 and 0") { INFO("1+0 <-> 0+1"); __hip_bfloat162 bf162_one = {HIPRT_ONE_BF16, HIPRT_ONE_BF16}; @@ -704,7 +688,7 @@ TEST_CASE("Unit_bf162_operators_host") { // Bunch of tests which make sure we are packaging stuff correctly. // i.e. highs2bfloat lows2bfloat etc and its various combinations -TEST_CASE("Unit_bf16_bf162_convert_tests") { +TEST_CASE(Unit_bf16_bf162_convert_tests) { SECTION("float2->bfloat->float2") { float2 in = {3.0f, 4.0f}; auto bf162 = __float22bfloat162_rn(in); @@ -818,7 +802,7 @@ __global__ void bf16_shfl_sync(float* in, float* out, int size) { } } -TEST_CASE("Unit_bf16_shfl") { +TEST_CASE(Unit_bf16_shfl) { auto warp_size = getWarpSize(); std::vector in; for (size_t i = 1; i <= warp_size; i++) { @@ -903,7 +887,7 @@ __global__ void bf162_shfl_sync(float2* in, float2* out, int size) { } } -TEST_CASE("Unit_bf162_shfl") { +TEST_CASE(Unit_bf162_shfl) { auto warp_size = getWarpSize(); std::vector in; for (size_t i = 1; i <= warp_size; i++) { @@ -1018,7 +1002,7 @@ __global__ void bf16_hrsqrt(float* in, float* out) { out[i] = hrsqrt(bf); } -TEST_CASE("Unit_bf16_value_ops") { +TEST_CASE(Unit_bf16_value_ops) { constexpr size_t size = 32; float *d_in, *d_out; HIP_CHECK(hipMalloc(&d_in, sizeof(float) * size)); @@ -1171,7 +1155,7 @@ __global__ void bf16_htrunc(float* in, float* out) { out[i] = htrunc(bf); } -TEST_CASE("Unit_bf16_floor_ceil") { +TEST_CASE(Unit_bf16_floor_ceil) { constexpr size_t size = 32; float *d_in, *d_out; HIP_CHECK(hipMalloc(&d_in, sizeof(float) * size)); @@ -1261,7 +1245,7 @@ __global__ void bf162_htrunc(float2* in, float2* out) { out[i] = h2trunc(bf); } -TEST_CASE("Unit_bf162_floor_ceil") { +TEST_CASE(Unit_bf162_floor_ceil) { constexpr size_t size = 32; float2 *d_in, *d_out; HIP_CHECK(hipMalloc(&d_in, sizeof(float2) * size)); diff --git a/catch/unit/deviceLib/bitExtract.cc b/catch/unit/deviceLib/bitExtract.cc index 7f751c43a..befe5bd04 100644 --- a/catch/unit/deviceLib/bitExtract.cc +++ b/catch/unit/deviceLib/bitExtract.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -52,7 +36,7 @@ __global__ void HIP_kernel(unsigned int* out32, unsigned int* in32_0, unsigned i out64[x] = __bitextract_u64(in64_0[x], in64_1[x], in64_2[x]); } -TEST_CASE("Unit_bitExtract") { +TEST_CASE(Unit_bitExtract) { using namespace std; unsigned int* hostOut32; diff --git a/catch/unit/deviceLib/bitInsert.cc b/catch/unit/deviceLib/bitInsert.cc index 44dbe5f54..14f80399c 100644 --- a/catch/unit/deviceLib/bitInsert.cc +++ b/catch/unit/deviceLib/bitInsert.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -51,7 +35,7 @@ __global__ void HIP_kernel(unsigned int* out32, unsigned int* in32_0, unsigned i out64[x] = __bitinsert_u64(in64_0[x], in64_1[x], in64_2[x], in64_3[x]); } -TEST_CASE("Unit_bitInsert") { +TEST_CASE(Unit_bitInsert) { using namespace std; unsigned int* hostOut32; diff --git a/catch/unit/deviceLib/brev.cc b/catch/unit/deviceLib/brev.cc index 995aca7df..db3148a11 100644 --- a/catch/unit/deviceLib/brev.cc +++ b/catch/unit/deviceLib/brev.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -68,7 +52,7 @@ __global__ void HIP_kernel(unsigned int* a, unsigned int* b, unsigned long long } } -TEST_CASE("Unit_brev") { +TEST_CASE(Unit_brev) { using namespace std; unsigned int* hostA; unsigned int* hostB; diff --git a/catch/unit/deviceLib/clz.cc b/catch/unit/deviceLib/clz.cc index 5d3d066cb..ed9463f4f 100644 --- a/catch/unit/deviceLib/clz.cc +++ b/catch/unit/deviceLib/clz.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -88,7 +72,7 @@ __global__ void clz_HIP_kernel(unsigned int* a, unsigned int* b, unsigned int* c } } -TEST_CASE("Unit_clz") { +TEST_CASE(Unit_clz) { using namespace std; unsigned int* hostA; diff --git a/catch/unit/deviceLib/defs.h b/catch/unit/deviceLib/defs.h index a1b6a5efd..c648b9215 100644 --- a/catch/unit/deviceLib/defs.h +++ b/catch/unit/deviceLib/defs.h @@ -1,21 +1,9 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #pragma once #define INTERNAL_BUFFER_SIZE 8 diff --git a/catch/unit/deviceLib/deviceAllocCommon.h b/catch/unit/deviceLib/deviceAllocCommon.h index 6b20c3db2..07bdbc2ef 100644 --- a/catch/unit/deviceLib/deviceAllocCommon.h +++ b/catch/unit/deviceLib/deviceAllocCommon.h @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #include diff --git a/catch/unit/deviceLib/deviceAllocation.cc b/catch/unit/deviceLib/deviceAllocation.cc index aede74c66..a5c069c19 100644 --- a/catch/unit/deviceLib/deviceAllocation.cc +++ b/catch/unit/deviceLib/deviceAllocation.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "deviceAllocCommon.h" @@ -873,7 +860,7 @@ static bool TestAllocInDeviceFunc(int test_type) { * using malloc/free in every gpu thread and block for primitive data * types like char, short, int etc. */ -TEST_CASE("Unit_deviceAllocation_Malloc_PerThread_PrimitiveDataType") { +TEST_CASE(Unit_deviceAllocation_Malloc_PerThread_PrimitiveDataType) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -909,7 +896,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_PerThread_PrimitiveDataType") { * using new/delete in every gpu thread and block for primitive data * types like char, short, int etc. */ -TEST_CASE("Unit_deviceAllocation_New_PerThread_PrimitiveDataType") { +TEST_CASE(Unit_deviceAllocation_New_PerThread_PrimitiveDataType) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -944,7 +931,7 @@ TEST_CASE("Unit_deviceAllocation_New_PerThread_PrimitiveDataType") { * Scenario: This test validates device allocation and deallocation * using malloc/free in every gpu thread and block for structure. */ -TEST_CASE("Unit_deviceAllocation_Malloc_PerThread_StructDataType") { +TEST_CASE(Unit_deviceAllocation_Malloc_PerThread_StructDataType) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -962,7 +949,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_PerThread_StructDataType") { * Scenario: This test validates device allocation and deallocation * using new/delete in every gpu thread and block for structure. */ -TEST_CASE("Unit_deviceAllocation_New_PerThread_StructDataType") { +TEST_CASE(Unit_deviceAllocation_New_PerThread_StructDataType) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -981,7 +968,7 @@ TEST_CASE("Unit_deviceAllocation_New_PerThread_StructDataType") { * in 1 thread and access in block for different primitive types like * char, short, int etc. */ -TEST_CASE("Unit_deviceAllocation_InOneThread_AccessInAllThreads") { +TEST_CASE(Unit_deviceAllocation_InOneThread_AccessInAllThreads) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1037,7 +1024,7 @@ TEST_CASE("Unit_deviceAllocation_InOneThread_AccessInAllThreads") { * across multiple kernels for different primitive types like char, short, * int etc. */ -TEST_CASE("Unit_deviceAllocation_Malloc_AcrossKernels") { +TEST_CASE(Unit_deviceAllocation_Malloc_AcrossKernels) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1071,7 +1058,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_AcrossKernels") { * across multiple kernels for different primitive types like char, short, * int etc. */ -TEST_CASE("Unit_deviceAllocation_New_AcrossKernels") { +TEST_CASE(Unit_deviceAllocation_New_AcrossKernels) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1107,7 +1094,7 @@ TEST_CASE("Unit_deviceAllocation_New_AcrossKernels") { * B) This test also validates memory allocation and deallocation through * __device__ functions. */ -TEST_CASE("Unit_deviceAllocation_Malloc_ComplexDataType") { +TEST_CASE(Unit_deviceAllocation_Malloc_ComplexDataType) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1126,7 +1113,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_ComplexDataType") { * B) This test also validates memory allocation and deallocation through * __device__ functions. */ -TEST_CASE("Unit_deviceAllocation_New_ComplexDataType") { +TEST_CASE(Unit_deviceAllocation_New_ComplexDataType) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1141,7 +1128,7 @@ TEST_CASE("Unit_deviceAllocation_New_ComplexDataType") { * Scenario: This test validates device allocation malloc, access and free * across multiple kernels for Union data type. */ -TEST_CASE("Unit_deviceAllocation_Malloc_UnionType") { +TEST_CASE(Unit_deviceAllocation_Malloc_UnionType) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1156,7 +1143,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_UnionType") { * Scenario: This test validates device allocation new, access and delete * across multiple kernels for Union data type. */ -TEST_CASE("Unit_deviceAllocation_New_UnionType") { +TEST_CASE(Unit_deviceAllocation_New_UnionType) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1172,7 +1159,7 @@ TEST_CASE("Unit_deviceAllocation_New_UnionType") { * using malloc/free in every gpu thread and block using Single * Code Object kernel. */ -TEST_CASE("Unit_deviceAllocation_Malloc_SingleCodeObj") { +TEST_CASE(Unit_deviceAllocation_Malloc_SingleCodeObj) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1189,7 +1176,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_SingleCodeObj") { * using new/delete in every gpu thread and block using Single * Code Object kernel. */ -TEST_CASE("Unit_deviceAllocation_New_SingleCodeObj") { +TEST_CASE(Unit_deviceAllocation_New_SingleCodeObj) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1206,7 +1193,7 @@ TEST_CASE("Unit_deviceAllocation_New_SingleCodeObj") { * Scenario: This test validates device allocation and deallocation * using malloc/free in multikernel and multistream environment. */ -TEST_CASE("Unit_deviceAllocation_Malloc_PerThread_MultKerMultStrm") { +TEST_CASE(Unit_deviceAllocation_Malloc_PerThread_MultKerMultStrm) { // malloc()/free() tests SECTION("Test char datatype allocation with malloc") { REQUIRE(true == TestMemoryAcrossMulKernels(TEST_MALLOC_FREE, true)); @@ -1233,7 +1220,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_PerThread_MultKerMultStrm") { * Scenario: This test validates device allocation and deallocation * using new/delete in multikernel and multistream environment. */ -TEST_CASE("Unit_deviceAllocation_New_PerThread_MultKerMultStrm") { +TEST_CASE(Unit_deviceAllocation_New_PerThread_MultKerMultStrm) { // new/delete tests SECTION("Test char datatype allocation with new") { REQUIRE(true == TestMemoryAcrossMulKernels(TEST_NEW_DELETE, true)); @@ -1261,7 +1248,7 @@ TEST_CASE("Unit_deviceAllocation_New_PerThread_MultKerMultStrm") { * Scenario: This test validates device allocation and deallocation * using malloc/free in graph. */ -TEST_CASE("Unit_deviceAllocation_Malloc_PerThread_Graph") { +TEST_CASE(Unit_deviceAllocation_Malloc_PerThread_Graph) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1294,7 +1281,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_PerThread_Graph") { * Scenario: This test validates device allocation and deallocation * using new/delete in graph. */ -TEST_CASE("Unit_deviceAllocation_New_PerThread_Graph") { +TEST_CASE(Unit_deviceAllocation_New_PerThread_Graph) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1327,7 +1314,7 @@ TEST_CASE("Unit_deviceAllocation_New_PerThread_Graph") { * Scenario: This test validates device allocation malloc, access and free * using pointers to device functions. */ -TEST_CASE("Unit_deviceAllocation_Malloc_DeviceFunc") { +TEST_CASE(Unit_deviceAllocation_Malloc_DeviceFunc) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1342,7 +1329,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_DeviceFunc") { * Scenario: This test validates device allocation new, access and delete * using pointers to device functions. */ -TEST_CASE("Unit_deviceAllocation_New_DeviceFunc") { +TEST_CASE(Unit_deviceAllocation_New_DeviceFunc) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1356,7 +1343,7 @@ TEST_CASE("Unit_deviceAllocation_New_DeviceFunc") { /** * Scenario: This test validates device allocation using vitual functions */ -TEST_CASE("Unit_deviceAllocation_VirtualFunction") { +TEST_CASE(Unit_deviceAllocation_VirtualFunction) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1390,7 +1377,7 @@ TEST_CASE("Unit_deviceAllocation_VirtualFunction") { * Scenario: This test validates device allocation malloc, access and free * across multiple kernels launched using threads. */ -TEST_CASE("Unit_deviceAllocation_Malloc_MulKernels_MulThreads") { +TEST_CASE(Unit_deviceAllocation_Malloc_MulKernels_MulThreads) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1423,7 +1410,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_MulKernels_MulThreads") { * Scenario: This test validates device new, access and delete * across multiple kernels launched using threads. */ -TEST_CASE("Unit_deviceAllocation_New_MulKernels_MulThreads") { +TEST_CASE(Unit_deviceAllocation_New_MulKernels_MulThreads) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1459,7 +1446,7 @@ TEST_CASE("Unit_deviceAllocation_New_MulKernels_MulThreads") { * Scenario: This test validates device allocation malloc, access and free * in a single kernel launched using threads. */ -TEST_CASE("Unit_deviceAllocation_Malloc_SingKernels_MulThreads") { +TEST_CASE(Unit_deviceAllocation_Malloc_SingKernels_MulThreads) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1487,7 +1474,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_SingKernels_MulThreads") { * Scenario: This test validates device new, access and delete * in a single kernel launched using threads. */ -TEST_CASE("Unit_deviceAllocation_New_SingKernels_MulThreads") { +TEST_CASE(Unit_deviceAllocation_New_SingKernels_MulThreads) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1516,7 +1503,7 @@ TEST_CASE("Unit_deviceAllocation_New_SingKernels_MulThreads") { * Scenario: This test validates Allocation and Deallocation in multiple * code object kernels defined in different source files. */ -TEST_CASE("Unit_deviceAllocation_Malloc_MulCodeObj") { +TEST_CASE(Unit_deviceAllocation_Malloc_MulCodeObj) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1530,7 +1517,7 @@ TEST_CASE("Unit_deviceAllocation_Malloc_MulCodeObj") { * Scenario: This test validates Allocation and Deallocation in multiple * code object kernels defined in different source files. */ -TEST_CASE("Unit_deviceAllocation_New_MulCodeObj") { +TEST_CASE(Unit_deviceAllocation_New_MulCodeObj) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -1539,3 +1526,19 @@ TEST_CASE("Unit_deviceAllocation_New_MulCodeObj") { } REQUIRE(true == TestAlloc_Load_MultKernels(TEST_NEW_DELETE, INT_MAX)); } + +/** + * @brief Regression test for device allocation interaction with hipDeviceReset. + * Due to implementation details, some device allocations are freed during device destruction. + * When using hipDeviceReset(), memory should not be released twice or leaked. + */ +TEST_CASE("Unit_deviceAllocationFollowedByDeviceReset") { + int pcieAtomic = 0; + HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); + if (!pcieAtomic) { + HipTest::HIP_SKIP_TEST("Device doesn't support pcie atomic, Skipped"); + return; + } + REQUIRE(true == TestAllocInDeviceFunc(TEST_MALLOC_FREE)); + HIP_CHECK(hipDeviceReset()); +} diff --git a/catch/unit/deviceLib/ffs.cc b/catch/unit/deviceLib/ffs.cc index db3d08ea3..879ee5fa1 100644 --- a/catch/unit/deviceLib/ffs.cc +++ b/catch/unit/deviceLib/ffs.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -61,7 +45,7 @@ __global__ void ffs_HIP_kernel(unsigned int* a, unsigned int* b, unsigned int* c } } -TEST_CASE("Unit_ffs") { +TEST_CASE(Unit_ffs) { using namespace std; unsigned int* hostA; diff --git a/catch/unit/deviceLib/floatMath.cc b/catch/unit/deviceLib/floatMath.cc index d13a25130..b9cad8d49 100644 --- a/catch/unit/deviceLib/floatMath.cc +++ b/catch/unit/deviceLib/floatMath.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -49,7 +33,7 @@ __global__ void floatMath(float* In, float* Out) { Out[tid] = __tanf(Out[tid]); } -TEST_CASE("Unit_deviceFunctions_CompileTest") { +TEST_CASE(Unit_deviceFunctions_CompileTest) { float *Ind, *Outd; auto res = hipMalloc((void**)&Ind, SIZE); REQUIRE(res == hipSuccess); diff --git a/catch/unit/deviceLib/floatTM.cc b/catch/unit/deviceLib/floatTM.cc index 2ed208e39..4bcb5210a 100644 --- a/catch/unit/deviceLib/floatTM.cc +++ b/catch/unit/deviceLib/floatTM.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -150,7 +134,7 @@ template void testType(int msize) { } -TEST_CASE("Unit_floatTM") { +TEST_CASE(Unit_floatTM) { constexpr int msize = 100; // double diff --git a/catch/unit/deviceLib/fp16_ops.cc b/catch/unit/deviceLib/fp16_ops.cc index 3b07a362e..809dfd68f 100644 --- a/catch/unit/deviceLib/fp16_ops.cc +++ b/catch/unit/deviceLib/fp16_ops.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -70,7 +54,7 @@ void fp16_arith_cpu(const std::vector& a, const std::vector& b, c[17] = 1.0f / a[17]; } -TEST_CASE("Unit_fp16_arith") { +TEST_CASE(Unit_fp16_arith) { constexpr size_t num_of_ops = 18; constexpr size_t iters = 100; Catch::Generators::RandomFloatingGenerator input1_gen(2.2f, 10.f, /*seed*/ 0x1234); @@ -150,7 +134,7 @@ void fp162_arith_cpu(std::vector& a, std::vector& b, std::vector c[17] = {1.0f / a[17].x, 1.0f / a[17].y}; } -TEST_CASE("Unit_fp162_arith") { +TEST_CASE(Unit_fp162_arith) { constexpr size_t num_of_ops = 18; constexpr size_t iters = 100; Catch::Generators::RandomFloatingGenerator input1_gen(2.2f, 10.f, /* seed */ 0x1234); @@ -187,7 +171,7 @@ TEST_CASE("Unit_fp162_arith") { } } -TEST_CASE("Unit_fp16_host_operations") { +TEST_CASE(Unit_fp16_host_operations) { std::vector f_a, f_b; f_a.reserve(50); f_b.reserve(50); @@ -288,7 +272,7 @@ TEST_CASE("Unit_fp16_host_operations") { } } -TEST_CASE("Unit_half_isnan_host") { +TEST_CASE(Unit_half_isnan_host) { std::vector<__half> in{std::nanf(""), std::nanf("1"), std::nanf("2"), @@ -333,7 +317,7 @@ TEST_CASE("Unit_half_isnan_host") { } } -TEST_CASE("Unit_half_abs_host") { +TEST_CASE(Unit_half_abs_host) { std::vector f_a; f_a.reserve(1000); @@ -365,7 +349,7 @@ TEST_CASE("Unit_half_abs_host") { } } -TEST_CASE("Unit_half_min_max_host") { +TEST_CASE(Unit_half_min_max_host) { std::vector f_a; f_a.reserve(1000); diff --git a/catch/unit/deviceLib/fp4_ocp.cc b/catch/unit/deviceLib/fp4_ocp.cc index 85516f5c3..3045a0e4a 100644 --- a/catch/unit/deviceLib/fp4_ocp.cc +++ b/catch/unit/deviceLib/fp4_ocp.cc @@ -1,23 +1,8 @@ -/* Copyright (c) 2025 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -42,7 +27,7 @@ static __global__ void lambda_kernel_launch(Lambda l, Type... args) { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_all_fp4_from_double") { +TEST_CASE(Unit_all_fp4_from_double) { SECTION("sanityx1") { std::vector inputs{-1.0, 0.0, 1.0}; for (const auto input : inputs) { @@ -92,7 +77,7 @@ TEST_CASE("Unit_all_fp4_from_double") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_all_fp4_from_double_device") { +TEST_CASE(Unit_all_fp4_from_double_device) { SECTION("sanityx1") { auto fp4x1_l = [] __device__(double* inputs, float* outputs, size_t size) { int i = threadIdx.x; @@ -207,7 +192,7 @@ TEST_CASE("Unit_all_fp4_from_double_device") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEMPLATE_TEST_CASE("Unit_all_fp4_from_interger_data", "", int, long int, long long int, short int) { +TEMPLATE_TEST_CASE(Unit_all_fp4_from_interger_data, int, long int, long long int, short int) { SECTION("Fp4 with e2m1") { std::vector input{-1, 0, 1}; for (const auto val : input) { @@ -232,7 +217,7 @@ TEMPLATE_TEST_CASE("Unit_all_fp4_from_interger_data", "", int, long int, long lo * ------------------------ * - HIP_VERSION >= 6.5 */ -TEMPLATE_TEST_CASE("Unit_all_fp4_from__unsigned_integer_data", "", unsigned int, unsigned long int, +TEMPLATE_TEST_CASE(Unit_all_fp4_from__unsigned_integer_data, unsigned int, unsigned long int, unsigned long long int, unsigned short int) { SECTION("Fp4 with e2m1") { std::vector input{1, 2, 3}; @@ -259,7 +244,7 @@ TEMPLATE_TEST_CASE("Unit_all_fp4_from__unsigned_integer_data", "", unsigned int, * - HIP_VERSION >= 6.5 */ -TEMPLATE_TEST_CASE("Unit_all_fp4_from_integer_data_device", "", int, long int, long long int, +TEMPLATE_TEST_CASE(Unit_all_fp4_from_integer_data_device, int, long int, long long int, short int) { std::vector all_fp4{-6.0f, -4.0f, -3.0f, -2.0f, -1.5f, -1.0f, -0.5f, 0.0f, 0.5f, 1.0f, 1.5f, 2.0f, 3.0f, 4.0f, 6.0f}; @@ -310,7 +295,7 @@ TEMPLATE_TEST_CASE("Unit_all_fp4_from_integer_data_device", "", int, long int, l * ------------------------ * - HIP_VERSION >= 6.5 */ -TEMPLATE_TEST_CASE("Unit_all_fp4_from__unsigned_integer_data_device", "", unsigned int, +TEMPLATE_TEST_CASE(Unit_all_fp4_from__unsigned_integer_data_device, unsigned int, unsigned long int, unsigned long long int, unsigned short int) { std::vector all_fp4{-6.0f, -4.0f, -3.0f, -2.0f, -1.5f, -1.0f, -0.5f, 0.0f, 0.5f, 1.0f, 1.5f, 2.0f, 3.0f, 4.0f, 6.0f}; @@ -361,7 +346,7 @@ TEMPLATE_TEST_CASE("Unit_all_fp4_from__unsigned_integer_data_device", "", unsign * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_ocp_fp4_from_double_full_range_host") { +TEST_CASE(Unit_ocp_fp4_from_double_full_range_host) { std::vector in; in.reserve(30); for (double i = -6.0; i <= 6.0; i += 0.5) { @@ -393,7 +378,7 @@ TEST_CASE("Unit_ocp_fp4_from_double_full_range_host") { * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_ocp_fp4_from_double_full_range_device") { +TEST_CASE(Unit_ocp_fp4_from_double_full_range_device) { std::vector all_fp4{-6.0f, -4.0f, -3.0f, -2.0f, -1.5f, -1.0f, -0.5f, 0.0f, 0.5f, 1.0f, 1.5f, 2.0f, 3.0f, 4.0f, 6.0f}; auto fp4x1_l = [] __device__(double* inputs, float* outputs, size_t size) { diff --git a/catch/unit/deviceLib/fp6_ocp.cc b/catch/unit/deviceLib/fp6_ocp.cc index a58607ca5..279149326 100644 --- a/catch/unit/deviceLib/fp6_ocp.cc +++ b/catch/unit/deviceLib/fp6_ocp.cc @@ -1,23 +1,8 @@ -/* Copyright (c) 2025 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -63,7 +48,7 @@ __global__ void Type_to_fp6(T* f, __hip_fp6_storage_t* res, size_t size) { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEMPLATE_TEST_CASE("Unit_all_fp6_ocp_vector_cvt_interger_data", "", int, long int, long long int, +TEMPLATE_TEST_CASE(Unit_all_fp6_ocp_vector_cvt_interger_data, int, long int, long long int, short int) { SECTION("Fp6 with e2m3") { std::vector input = {0, 1, 2, 3, 4, 5, 6, 7, -0, -1, -2, -3, -4, -5, -6, -7}; @@ -101,7 +86,7 @@ TEMPLATE_TEST_CASE("Unit_all_fp6_ocp_vector_cvt_interger_data", "", int, long in * ------------------------ * - HIP_VERSION >= 6.5 */ -TEMPLATE_TEST_CASE("Unit_all_fp6_ocp_vector_cvt_unsigned_interger_data", "", int, long int, +TEMPLATE_TEST_CASE(Unit_all_fp6_ocp_vector_cvt_unsigned_interger_data, int, long int, long long int, short int) { SECTION("Fp6 with e2m3") { std::vector input = {0, 1, 2, 3, 4, 5, 6, 7}; @@ -137,7 +122,7 @@ TEMPLATE_TEST_CASE("Unit_all_fp6_ocp_vector_cvt_unsigned_interger_data", "", int * ------------------------ * - HIP_VERSION >= 6.5 */ -TEMPLATE_TEST_CASE("Unit_all_fp6_ocp_vector_cvt_unsigned_integer_device", "", unsigned int, +TEMPLATE_TEST_CASE(Unit_all_fp6_ocp_vector_cvt_unsigned_integer_device, unsigned int, unsigned long int, unsigned long long int, unsigned short int) { bool is_e2m3 = GENERATE(true, false); std::vector f_vals; @@ -223,7 +208,7 @@ TEMPLATE_TEST_CASE("Unit_all_fp6_ocp_vector_cvt_unsigned_integer_device", "", un * - HIP_VERSION >= 6.5 */ -TEMPLATE_TEST_CASE("Unit_all_fp6_ocp_vector_cvt_interger_data_device", "", int, long int, +TEMPLATE_TEST_CASE(Unit_all_fp6_ocp_vector_cvt_interger_data_device, int, long int, long long int, short int) { bool is_e2m3 = GENERATE(true, false); std::vector f_vals; diff --git a/catch/unit/deviceLib/fp8_e8m0.cc b/catch/unit/deviceLib/fp8_e8m0.cc index d5dab7d3f..00d8f9be1 100644 --- a/catch/unit/deviceLib/fp8_e8m0.cc +++ b/catch/unit/deviceLib/fp8_e8m0.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -60,7 +44,7 @@ void device_cvt_bfloat16raw_to_e8m0(const std::vector<__hip_bfloat16>& in, hipMemcpy(out.data(), out_d, sizeof(unsigned char) * out.size(), hipMemcpyDeviceToHost)); } -TEST_CASE("Unit__hip_cvt_bfloat16raw_to_e8m0") { +TEST_CASE(Unit__hip_cvt_bfloat16raw_to_e8m0) { bool run_on_host = GENERATE(true, false); __hip_saturation_t saturation = GENERATE(__HIP_NOSAT, __HIP_SATFINITE); hipRoundMode rounding = GENERATE(hipRoundZero, hipRoundPosInf); @@ -146,7 +130,7 @@ void device_cvt_float_to_e8m0(const std::vector& in, std::vector& in, std::vector& in, std::vecto HIP_CHECK(hipMemcpy(out.data(), out_d, sizeof(float) * out.size(), hipMemcpyDeviceToHost)); } -TEST_CASE("Unit__hip_cvt_e8m0_to_bf16raw") { +TEST_CASE(Unit__hip_cvt_e8m0_to_bf16raw) { bool run_on_host = GENERATE(true, false); std::vector in = {0x00u, 0x7EU, 0x81U, 0x82U, 0xFF}; diff --git a/catch/unit/deviceLib/fp8_fnuz.cc b/catch/unit/deviceLib/fp8_fnuz.cc index 91856800e..5bbb0bbf7 100644 --- a/catch/unit/deviceLib/fp8_fnuz.cc +++ b/catch/unit/deviceLib/fp8_fnuz.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -109,7 +93,7 @@ std::vector cpu_cvt_float_fp8_float_fnuz(const std::vector& nums) { } // floats to fp8 -TEMPLATE_TEST_CASE("Unit_fp8_fnuz_compare_host_device", "", float, double) { +TEMPLATE_TEST_CASE(Unit_fp8_fnuz_compare_host_device, float, double) { FP8_FNUZ_SKIP_TEST std::vector numbers = {0.0f, 1.0f, 1.1f, 2.0f, 2.1f, 3.0f, 3.2f, 3.3f, 4.0f, 4.5f, 10.0f, 11.0f, 12.2f, 14.1f}; @@ -195,7 +179,7 @@ std::vector cpu_cvt_float2_fp8x2_float2_fnuz(const std::vector& return ret; } -TEST_CASE("Unit_fp8x2_fnuz_compare_host_device") { +TEST_CASE(Unit_fp8x2_fnuz_compare_host_device) { FP8_FNUZ_SKIP_TEST std::vector numbers_input = {0.0f, 1.0f, 1.1f, 2.0f, 2.1f, 3.0f, 3.2f, 3.3f, 4.0f, 4.5f, 10.0f, 11.0f, 12.2f, 14.1f}; @@ -237,7 +221,7 @@ TEST_CASE("Unit_fp8x2_fnuz_compare_host_device") { } } -TEST_CASE("Unit_fp8x2_fnuz_split_compare") { +TEST_CASE(Unit_fp8x2_fnuz_split_compare) { FP8_FNUZ_SKIP_TEST std::vector numbers_input = {0.0f, 1.0f, 1.1f, 2.0f, 2.1f, 3.0f, 3.2f, 3.3f, 4.0f, 4.5f, 10.0f, 11.0f, 12.2f, 14.1f}; @@ -325,7 +309,7 @@ template __global__ void cvt_float4_fp8x4_float4_fnuz(float4 } } -TEST_CASE("Unit_fp8x4_fnuz_split_compare") { +TEST_CASE(Unit_fp8x4_fnuz_split_compare) { FP8_FNUZ_SKIP_TEST std::vector numbers_input = {0.0f, 1.0f, 1.1f, 2.0f, 2.1f, 3.0f, 3.2f, 3.3f, 4.0f, 4.5f, 10.0f, 11.0f, 12.2f, 14.1f}; @@ -427,7 +411,7 @@ template __global__ void fp8_2_bool_fnuz(float* f, bool* ret } } -TEST_CASE("Unit_fp8_fnuz_bool_device") { +TEST_CASE(Unit_fp8_fnuz_bool_device) { FP8_FNUZ_SKIP_TEST // clang-format off std::vector fvals{-10.0f, -1.0f, -0.0f, 0.0f, 1.0f, 10.0f}; @@ -524,7 +508,7 @@ __global__ void Type_to_fp8_fnuz(float* f, __hip_fp8_storage_t* res, size_t size } } -TEST_CASE("Unit_all_fp8_fnuz_cvt") { +TEST_CASE(Unit_all_fp8_fnuz_cvt) { FP8_FNUZ_SKIP_TEST bool is_e4m3_fnuz = GENERATE(true, false); std::vector f_vals; @@ -664,7 +648,7 @@ __global__ void Type_to_fp8_fnuz_cvt(T* f, float* cvt1, float* cvt2, size_t size } } -TEMPLATE_TEST_CASE("Unit_fp8_fnuz_correctness_device", "", float, double) { +TEMPLATE_TEST_CASE(Unit_fp8_fnuz_correctness_device, float, double) { FP8_FNUZ_SKIP_TEST SECTION("e4m3_fnuz") { diff --git a/catch/unit/deviceLib/fp8_host.cc b/catch/unit/deviceLib/fp8_host.cc index d2f3e5bc5..2f143fe18 100644 --- a/catch/unit/deviceLib/fp8_host.cc +++ b/catch/unit/deviceLib/fp8_host.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -32,7 +16,7 @@ THE SOFTWARE. * Both FNUZ and OCP types are supported on host */ -TEST_CASE("Unit_fp8_ocp_bool_host") { +TEST_CASE(Unit_fp8_ocp_bool_host) { // clang-format off std::vector fvals{-10.0f, -1.0f, -0.0f, 0.0f, 1.0f, 10.0f}; std::vector tvals {true, true, false, false, true, true}; @@ -62,7 +46,7 @@ TEST_CASE("Unit_fp8_ocp_bool_host") { } // test to check we are putting in data correctly in vector types -TEST_CASE("Unit_all_fp8_ocp_vector_cvt") { +TEST_CASE(Unit_all_fp8_ocp_vector_cvt) { float2 in2{1.0f, 2.0f}; float4 in4{3.0f, 4.0f, 5.0f, 6.0f}; @@ -121,7 +105,7 @@ TEST_CASE("Unit_all_fp8_ocp_vector_cvt") { } -TEMPLATE_TEST_CASE("Unit_fp8_ocp_correctness", "", float, double) { +TEMPLATE_TEST_CASE(Unit_fp8_ocp_correctness, float, double) { SECTION("e4m3_ocp") { /* These are basically all the fp8 - e4m3_ocp type numbers. * They can be generated by iterating over 0'0000'000 and converting them to fp32 number @@ -454,7 +438,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_ocp_correctness", "", float, double) { } // Check the orientation encoded is correct -TEST_CASE("Unit_fp8_ocp_vector_basic_conversions") { +TEST_CASE(Unit_fp8_ocp_vector_basic_conversions) { float f1 = 1.0f; float2 f2 = {1.0f, 2.0f}; float4 f4 = {1.0f, 2.0f, 3.0f, 4.0f}; @@ -595,7 +579,7 @@ TEST_CASE("Unit_fp8_ocp_vector_basic_conversions") { } -TEST_CASE("Unit_fp8_fnuz_bool_host") { +TEST_CASE(Unit_fp8_fnuz_bool_host) { // clang-format off std::vector fvals{-10.0f, -1.0f, -0.0f, 0.0f, 1.0f, 10.0f}; std::vector tvals {true, true, false, false, true, true}; @@ -625,7 +609,7 @@ TEST_CASE("Unit_fp8_fnuz_bool_host") { } // test to check we are putting in data correctly in vector types -TEST_CASE("Unit_all_fp8_fnuz_vector_cvt") { +TEST_CASE(Unit_all_fp8_fnuz_vector_cvt) { float2 in2{1.0f, 2.0f}; float4 in4{3.0f, 4.0f, 5.0f, 6.0f}; @@ -683,7 +667,7 @@ TEST_CASE("Unit_all_fp8_fnuz_vector_cvt") { } } -TEMPLATE_TEST_CASE("Unit_fp8_fnuz_correctness", "", float, double) { +TEMPLATE_TEST_CASE(Unit_fp8_fnuz_correctness, float, double) { SECTION("e4m3_fnuz") { /* These are basically all the fp8 - e4m3_fnuz type numbers. * They can be generated by iterating over 0'0000'000 and converting them to fp32 number @@ -1072,7 +1056,7 @@ TEMPLATE_TEST_CASE("Unit_fp8_fnuz_correctness", "", float, double) { } // Check the orientation encoded is correct -TEST_CASE("Unit_fp8_fnuz_vector_basic_conversions") { +TEST_CASE(Unit_fp8_fnuz_vector_basic_conversions) { float f1 = 1.0f; float2 f2 = {1.0f, 2.0f}; float4 f4 = {1.0f, 2.0f, 3.0f, 4.0f}; diff --git a/catch/unit/deviceLib/fp8_ocp.cc b/catch/unit/deviceLib/fp8_ocp.cc index 5d2c80615..a1620fdc1 100644 --- a/catch/unit/deviceLib/fp8_ocp.cc +++ b/catch/unit/deviceLib/fp8_ocp.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -107,7 +91,7 @@ std::vector cpu_cvt_float_fp8_float(const std::vector& nums) { // This test only makes sense on gfx94x where device side convert will use the builtins to convert // floats to fp8 -TEMPLATE_TEST_CASE("Unit_fp8_ocp_compare_host_device", "", float, double) { +TEMPLATE_TEST_CASE(Unit_fp8_ocp_compare_host_device, float, double) { FP8_OCP_SKIP_TEST std::vector numbers = {0.0f, 1.0f, 1.1f, 2.0f, 2.1f, 3.0f, 3.2f, @@ -196,7 +180,7 @@ std::vector cpu_cvt_float2_fp8x2_float2(const std::vector& nums) return ret; } -TEST_CASE("Unit_fp8x2_ocp_compare_host_device") { +TEST_CASE(Unit_fp8x2_ocp_compare_host_device) { FP8_OCP_SKIP_TEST std::vector numbers_input = {0.0f, 1.0f, 1.1f, 2.0f, 2.1f, 3.0f, 3.2f, 3.3f, 4.0f, 4.5f, 10.0f, 11.0f, 12.2f, 14.1f}; @@ -240,7 +224,7 @@ TEST_CASE("Unit_fp8x2_ocp_compare_host_device") { HIP_CHECK(hipFree(d_numbers)); } -TEST_CASE("Unit_fp8x2_ocp_split_compare") { +TEST_CASE(Unit_fp8x2_ocp_split_compare) { FP8_OCP_SKIP_TEST std::vector numbers_input = {0.0f, 1.0f, 1.1f, 2.0f, 2.1f, 3.0f, 3.2f, 3.3f, 4.0f, 4.5f, 10.0f, 11.0f, 12.2f, 14.1f}; @@ -329,7 +313,7 @@ template __global__ void cvt_float4_fp8x4_float4(float4* in, } } -TEST_CASE("Unit_fp8x4_ocp_split_compare") { +TEST_CASE(Unit_fp8x4_ocp_split_compare) { FP8_OCP_SKIP_TEST std::vector numbers_input = {0.0f, 1.0f, 1.1f, 2.0f, 2.1f, 3.0f, 3.2f, @@ -434,7 +418,7 @@ template __global__ void fp8_2_bool(float* f, bool* ret, size } } -TEST_CASE("Unit_fp8_ocp_bool_device") { +TEST_CASE(Unit_fp8_ocp_bool_device) { FP8_OCP_SKIP_TEST // clang-format off std::vector fvals{-10.0f, -1.0f, -0.0f, 0.0f, 1.0f, 10.0f}; @@ -537,7 +521,7 @@ __global__ void Type_to_fp8(float* f, __hip_fp8_storage_t* res, size_t size) { } } -TEST_CASE("Unit_all_fp8_ocp_cvt") { +TEST_CASE(Unit_all_fp8_ocp_cvt) { FP8_OCP_SKIP_TEST bool is_e4m3_ocp = GENERATE(true, false); @@ -678,7 +662,7 @@ __global__ void Type_to_fp8_cvt(T* f, float* cvt1, float* cvt2, size_t size) { } } -TEMPLATE_TEST_CASE("Unit_fp8_ocp_correctness_device", "", float, double) { +TEMPLATE_TEST_CASE(Unit_fp8_ocp_correctness_device, float, double) { FP8_OCP_SKIP_TEST SECTION("e4m3_ocp") { diff --git a/catch/unit/deviceLib/funnelshift.cc b/catch/unit/deviceLib/funnelshift.cc index 5cfeff496..38cb74259 100644 --- a/catch/unit/deviceLib/funnelshift.cc +++ b/catch/unit/deviceLib/funnelshift.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -93,7 +77,7 @@ static unsigned int cpu_funnelshift_rc(unsigned int lo, unsigned int hi, unsigne return val & 0xffffffff; } -TEST_CASE("Unit_funnelshift") { +TEST_CASE(Unit_funnelshift) { unsigned int* host_l_output; unsigned int* host_lc_output; unsigned int* host_r_output; diff --git a/catch/unit/deviceLib/hadd.cc b/catch/unit/deviceLib/hadd.cc index 2230727b0..dee415abe 100644 --- a/catch/unit/deviceLib/hadd.cc +++ b/catch/unit/deviceLib/hadd.cc @@ -1,22 +1,7 @@ /* - * Copyright (C) Advanced Micro Devices, Inc. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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 COPYRIGHT HOLDER(S) 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. + * SPDX-License-Identifier: MIT */ #include @@ -133,7 +118,7 @@ static auto get_uadd_inputs() -> std::pair, std::vector #include #include @@ -92,7 +80,7 @@ __global__ void testOperationsGPU(float* d_a, float* d_b, bool* testPass) { float& b = d_b[id]; *testPass = testOperations(a, b); } -TEST_CASE("Unit_hipBfloat16") { +TEST_CASE(Unit_hipBfloat16) { float *h_fa, *h_fb; float *d_fa, *d_fb; bool *d_fc, h_fc = false; diff --git a/catch/unit/deviceLib/hipComplex.cc b/catch/unit/deviceLib/hipComplex.cc index 3bc23de7c..ec8b49c99 100644 --- a/catch/unit/deviceLib/hipComplex.cc +++ b/catch/unit/deviceLib/hipComplex.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -395,7 +383,7 @@ static bool test_allcomplexMathFunc_host() { return TestPassed; } -TEST_CASE("Unit_TestMathFuncComplex") { +TEST_CASE(Unit_TestMathFuncComplex) { bool TestPassed = false; TestPassed = test_makehipComplex_dev() && test_makehipComplex_dev() && diff --git a/catch/unit/deviceLib/hipDeviceMemcpy.cc b/catch/unit/deviceLib/hipDeviceMemcpy.cc index 08dc413a4..705cb4644 100644 --- a/catch/unit/deviceLib/hipDeviceMemcpy.cc +++ b/catch/unit/deviceLib/hipDeviceMemcpy.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #define LEN 1024 @@ -31,7 +19,7 @@ __global__ static void set(uint32_t* ptr, uint8_t val) { memset(ptr + tx, val, sizeof(uint32_t)); } -TEST_CASE("Unit_ToAndFroMemCpyToDevice") { +TEST_CASE(Unit_ToAndFroMemCpyToDevice) { uint32_t *A, *Ad, *B, *Bd; A = new uint32_t[LEN]; B = new uint32_t[LEN]; diff --git a/catch/unit/deviceLib/hipMathFunctions.cc b/catch/unit/deviceLib/hipMathFunctions.cc index f76fae850..cfbcdb183 100644 --- a/catch/unit/deviceLib/hipMathFunctions.cc +++ b/catch/unit/deviceLib/hipMathFunctions.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Test Scenarios : @@ -66,7 +53,7 @@ template void check_simple(F f, T expected, const char* file, /** Verification of absolute int64 operation performed at device. */ -TEST_CASE("Unit_abs_int64_Verification") { +TEST_CASE(Unit_abs_int64_Verification) { using datatype_t = long long; // NOLINT datatype_t *inputCPU{}, *outputCPU{}; @@ -120,7 +107,7 @@ TEST_CASE("Unit_abs_int64_Verification") { /** Verification of pow operations performed at device. */ -TEST_CASE("Unit_pown_Verification") { +TEST_CASE(Unit_pown_Verification) { CHECK_SIMPLE([] __device__() { return powif(2.0f, 2); }, 4.0f); CHECK_SIMPLE([] __device__() { return powi(2.0, 2); }, 4.0); CHECK_SIMPLE([] __device__() { return pow(2.0f, 2); }, 4.0f); diff --git a/catch/unit/deviceLib/hipStdComplex.cc b/catch/unit/deviceLib/hipStdComplex.cc index 3132a86f8..ef92955a0 100644 --- a/catch/unit/deviceLib/hipStdComplex.cc +++ b/catch/unit/deviceLib/hipStdComplex.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -134,7 +121,7 @@ template void test() { } #if HT_AMD -TEST_CASE("Unit_StdComplex") { +TEST_CASE(Unit_StdComplex) { SECTION("Test run with float") { test(); } SECTION("Test run with double") { test(); } } diff --git a/catch/unit/deviceLib/hipTestAtomicAdd.cc b/catch/unit/deviceLib/hipTestAtomicAdd.cc index a5bd88a2d..18e3134af 100644 --- a/catch/unit/deviceLib/hipTestAtomicAdd.cc +++ b/catch/unit/deviceLib/hipTestAtomicAdd.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -166,7 +153,7 @@ template bool atomictestnoret_simple(const T& initial_val) { return true; } -TEST_CASE("Unit_hipTestAtomicAdd") { +TEST_CASE(Unit_hipTestAtomicAdd) { bool TestPassed = true; SECTION("atomic tests with many waves") { diff --git a/catch/unit/deviceLib/hipTestClock.cc b/catch/unit/deviceLib/hipTestClock.cc index 9d5803b1a..dce7547c7 100644 --- a/catch/unit/deviceLib/hipTestClock.cc +++ b/catch/unit/deviceLib/hipTestClock.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -34,7 +21,7 @@ static __global__ void kernel2(int64_t* Ad) { Ad[tid] = clock() + clock64() + __clock() + __clock64() - Ad[tid]; } -TEST_CASE("Unit_hipTestClock") { +TEST_CASE(Unit_hipTestClock) { int64_t *A, *Ad; A = new int64_t[LEN]; for (unsigned i = 0; i < LEN; i++) { diff --git a/catch/unit/deviceLib/hipTestDevice.cc b/catch/unit/deviceLib/hipTestDevice.cc index 55d807168..acbf4f417 100644 --- a/catch/unit/deviceLib/hipTestDevice.cc +++ b/catch/unit/deviceLib/hipTestDevice.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -722,7 +710,7 @@ bool run_erfinvf() { } } -TEST_CASE("Unit_hipDeviceTrigFunc_Float") { +TEST_CASE(Unit_hipDeviceTrigFunc_Float) { bool result = false; result = run_sincosf() && run_sincospif() && run_fdividef() && run_llrintf() && run_norm3df() && run_norm4df() && run_normf() && run_rnorm3df() && run_rnorm4df() && run_rnormf() && diff --git a/catch/unit/deviceLib/hipTestDeviceDouble.cc b/catch/unit/deviceLib/hipTestDeviceDouble.cc index 1e4b4d1b2..b7ed403b5 100644 --- a/catch/unit/deviceLib/hipTestDeviceDouble.cc +++ b/catch/unit/deviceLib/hipTestDeviceDouble.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -612,7 +600,7 @@ bool run_erfinv() { return false; } -TEST_CASE("Unit_hipTrigDeviceFunc_Double") { +TEST_CASE(Unit_hipTrigDeviceFunc_Double) { bool result = false; result = run_sincos() && run_sincospi() && run_llrint() && run_norm3d() && run_norm4d() && run_rnorm3d() && run_rnorm4d() && run_rnorm() && run_lround() && run_llround() && diff --git a/catch/unit/deviceLib/hipTestDeviceLimit.cc b/catch/unit/deviceLib/hipTestDeviceLimit.cc index 92bf7a72e..0f93d1ffb 100644 --- a/catch/unit/deviceLib/hipTestDeviceLimit.cc +++ b/catch/unit/deviceLib/hipTestDeviceLimit.cc @@ -1,23 +1,11 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include -TEST_CASE("Unit_hipTestDeviceLimit_Basic") { +TEST_CASE(Unit_hipTestDeviceLimit_Basic) { size_t heap; HIP_CHECK(hipDeviceGetLimit(&heap, hipLimitMallocHeapSize)); REQUIRE(heap != 0); diff --git a/catch/unit/deviceLib/hipTestDeviceSymbol.cc b/catch/unit/deviceLib/hipTestDeviceSymbol.cc index 2f4894a8f..3d9f63fad 100644 --- a/catch/unit/deviceLib/hipTestDeviceSymbol.cc +++ b/catch/unit/deviceLib/hipTestDeviceSymbol.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* @@ -47,7 +34,7 @@ __global__ void checkStaticConstVarAddress(float* addr, bool* out) { *out = (statConstVar == addr); } -TEST_CASE("Unit_hipMemcpyToSymbolAsync_ToNFrom") { +TEST_CASE(Unit_hipMemcpyToSymbolAsync_ToNFrom) { int *A{nullptr}, *Am{nullptr}, *B{nullptr}, *Ad{nullptr}, *C{nullptr}, *Cm{nullptr}; A = new int[NUM]; B = new int[NUM]; @@ -165,7 +152,7 @@ TEST_CASE("Unit_hipMemcpyToSymbolAsync_ToNFrom") { /* 1) Validate get symbol address/size for static const variable. */ -TEST_CASE("Unit_hipGetSymbolAddressAndSize_Validation") { +TEST_CASE(Unit_hipGetSymbolAddressAndSize_Validation) { bool* checkOkD{nullptr}; bool checkOk = false; size_t symbolSize{}; @@ -186,7 +173,7 @@ TEST_CASE("Unit_hipGetSymbolAddressAndSize_Validation") { } } -TEST_CASE("Unit_hipGetSymbolAddress_Negative") { +TEST_CASE(Unit_hipGetSymbolAddress_Negative) { SECTION("Invalid symbol") { int notADeviceSymbol{0}; int* addr{nullptr}; @@ -202,7 +189,7 @@ TEST_CASE("Unit_hipGetSymbolAddress_Negative") { } } -TEST_CASE("Unit_hipGetSymbolSize_Negative") { +TEST_CASE(Unit_hipGetSymbolSize_Negative) { SECTION("Invalid symbol") { int notADeviceSymbol{0}; size_t dsize{0}; diff --git a/catch/unit/deviceLib/hipTestDotFunctions.cc b/catch/unit/deviceLib/hipTestDotFunctions.cc index 04732599c..3eaba3b8b 100644 --- a/catch/unit/deviceLib/hipTestDotFunctions.cc +++ b/catch/unit/deviceLib/hipTestDotFunctions.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -43,7 +31,7 @@ __global__ static void DotFunctions(bool* result) { #endif } -TEST_CASE("Unit_hipTestDotFunctions") { +TEST_CASE(Unit_hipTestDotFunctions) { bool* result{nullptr}; HIP_CHECK(hipHostMalloc(&result, 1)); result[0] = true; diff --git a/catch/unit/deviceLib/hipTestFMA.cc b/catch/unit/deviceLib/hipTestFMA.cc index c56a64f66..ea1aa7c90 100644 --- a/catch/unit/deviceLib/hipTestFMA.cc +++ b/catch/unit/deviceLib/hipTestFMA.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -172,7 +160,7 @@ void runTestHalfFMA() { HIP_CHECK(hipFree(Ad)); } -TEST_CASE("Unit_hipTestFMA") { +TEST_CASE(Unit_hipTestFMA) { SECTION("test FMA") { runTestFMA(); } SECTION("test HalfFMA") { runTestHalfFMA(); } } diff --git a/catch/unit/deviceLib/hipTestHalf.cc b/catch/unit/deviceLib/hipTestHalf.cc index c8292a7a1..fab67014e 100644 --- a/catch/unit/deviceLib/hipTestHalf.cc +++ b/catch/unit/deviceLib/hipTestHalf.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -211,7 +199,7 @@ void checkHalfAbs() { } } -TEST_CASE("Unit_hipTestHalf") { +TEST_CASE(Unit_hipTestHalf) { bool* result{nullptr}; HIP_CHECK(hipHostMalloc(&result, sizeof(result))); diff --git a/catch/unit/deviceLib/hipTestHalfConstexpr.cc b/catch/unit/deviceLib/hipTestHalfConstexpr.cc index f1331fbe9..305b2b4ba 100644 --- a/catch/unit/deviceLib/hipTestHalfConstexpr.cc +++ b/catch/unit/deviceLib/hipTestHalfConstexpr.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/deviceLib/hipTestHost.cc b/catch/unit/deviceLib/hipTestHost.cc index f8addfb5d..21e444916 100644 --- a/catch/unit/deviceLib/hipTestHost.cc +++ b/catch/unit/deviceLib/hipTestHost.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #define N 512 @@ -364,7 +352,7 @@ __global__ void testFunctions(bool* result, float* Af, double* A) { check_rnorm(A) && check_sincospif() && check_sincospi() && check_nextafter(); } -TEST_CASE("Unit_TestDevice_DoublePrecisionMathFunc") { +TEST_CASE(Unit_TestDevice_DoublePrecisionMathFunc) { float* Af = new float[N]; double* A = new double[N]; for (int i = 0; i < N; i++) { diff --git a/catch/unit/deviceLib/hipTestIncludeMath.cc b/catch/unit/deviceLib/hipTestIncludeMath.cc index 1e37487d7..870b1bde1 100644 --- a/catch/unit/deviceLib/hipTestIncludeMath.cc +++ b/catch/unit/deviceLib/hipTestIncludeMath.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -125,7 +113,7 @@ __global__ void FloatMathPreciseKernel() { ynf(1, 1.0f); } -TEST_CASE("Unit_TestIncludeMathPreciseFloat") { +TEST_CASE(Unit_TestIncludeMathPreciseFloat) { hipError_t err; err = hipLaunchKernel(reinterpret_cast(FloatMathPreciseKernel), dim3(1, 1, 1), dim3(1, 1, 1), 0, 0, 0); diff --git a/catch/unit/deviceLib/hipTestNativeHalf.cc b/catch/unit/deviceLib/hipTestNativeHalf.cc index 70b2656a2..997689a1f 100644 --- a/catch/unit/deviceLib/hipTestNativeHalf.cc +++ b/catch/unit/deviceLib/hipTestNativeHalf.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -142,7 +130,7 @@ __global__ void __half2Test(bool* result, __half2 a) { result[0] &= amd_mixed_dot(a, a, 1, 1) && result[0]; } -TEST_CASE("Unit_hipTestNativeHalf") { +TEST_CASE(Unit_hipTestNativeHalf) { bool* result{nullptr}; HIP_CHECK(hipHostMalloc(&result, 1)); SECTION("Half Test") { diff --git a/catch/unit/deviceLib/hipTestNew.cc b/catch/unit/deviceLib/hipTestNew.cc index 67c05f41d..b2a4be8a7 100644 --- a/catch/unit/deviceLib/hipTestNew.cc +++ b/catch/unit/deviceLib/hipTestNew.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #define LEN 512 @@ -34,7 +22,7 @@ static __global__ void kernel(int* Ad) { new (Ad + tid) A(); } -TEST_CASE("Unit_hipTest_DeviceNewOperator") { +TEST_CASE(Unit_hipTest_DeviceNewOperator) { int *A, *Ad; A = new int[LEN]; for (unsigned i = 0; i < LEN; i++) { diff --git a/catch/unit/deviceLib/hipThreadFence.cc b/catch/unit/deviceLib/hipThreadFence.cc index b09f0bc4a..54fa99db2 100644 --- a/catch/unit/deviceLib/hipThreadFence.cc +++ b/catch/unit/deviceLib/hipThreadFence.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #define NUM 1024 @@ -30,7 +18,7 @@ __global__ static void vAdd(float* In1, float* In2, float* In3, float* In4, floa Out[tid] = In4[tid] + In3[tid]; } -TEST_CASE("Unit_hipThreadFence") { +TEST_CASE(Unit_hipThreadFence) { float* In1 = new float[NUM]; float* In2 = new float[NUM]; float* In3 = new float[NUM]; diff --git a/catch/unit/deviceLib/hipVectorTypesDevice.cc b/catch/unit/deviceLib/hipVectorTypesDevice.cc index cf2d8d06d..b344ff7ca 100644 --- a/catch/unit/deviceLib/hipVectorTypesDevice.cc +++ b/catch/unit/deviceLib/hipVectorTypesDevice.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -241,7 +225,7 @@ template bool run_CheckSharedVectorTypes() { return run_CheckSharedVectorType() && run_CheckSharedVectorTypes(); } -TEST_CASE("Unit_hipVectorTypes_test_on_device") { +TEST_CASE(Unit_hipVectorTypes_test_on_device) { static_assert(sizeof(float1) == 4, ""); static_assert(sizeof(float2) >= 8, ""); static_assert(sizeof(float3) >= 12, ""); diff --git a/catch/unit/deviceLib/hipVectorTypesHost.cc b/catch/unit/deviceLib/hipVectorTypesHost.cc index 341521e35..7a154de33 100644 --- a/catch/unit/deviceLib/hipVectorTypesHost.cc +++ b/catch/unit/deviceLib/hipVectorTypesHost.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -174,7 +162,7 @@ bool CheckVectorTypes() { ulonglong2, ulonglong3, ulonglong4, float1, float2, float3, float4, double1, double2, double3, double4>(); } -TEST_CASE("Unit_hipVectorTypes_test_on_host") { +TEST_CASE(Unit_hipVectorTypes_test_on_host) { REQUIRE(sizeof(float1) == 4); REQUIRE(sizeof(float2) >= 8); REQUIRE(sizeof(float3) == 12); diff --git a/catch/unit/deviceLib/hip_test_make_type.cc b/catch/unit/deviceLib/hip_test_make_type.cc index a99900578..12848a33b 100644 --- a/catch/unit/deviceLib/hip_test_make_type.cc +++ b/catch/unit/deviceLib/hip_test_make_type.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -311,7 +298,7 @@ template bool dataTypesRunChar4() { return ret; } -TEST_CASE("Unit_Test_makechar_functionality") { +TEST_CASE(Unit_Test_makechar_functionality) { bool errors; errors = dataTypesRunChar1() && dataTypesRunChar2() && dataTypesRunChar3() && diff --git a/catch/unit/deviceLib/hip_trig.cc b/catch/unit/deviceLib/hip_trig.cc index 5145a8dd0..09212cd8f 100644 --- a/catch/unit/deviceLib/hip_trig.cc +++ b/catch/unit/deviceLib/hip_trig.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #define LEN 512 @@ -28,7 +16,7 @@ __global__ static void kernel_trig(float* In, float* sin_d, float* cos_d, float* tan_d[tid] = tanf(In[tid]); sincosf(In[tid], &sin_pd[tid], &cos_pd[tid]); } -TEST_CASE("Unit_kernel_trigger") { +TEST_CASE(Unit_kernel_trigger) { float *In, *sin_h, *cos_h, *tan_h, *sin_ph, *cos_ph; float *In_d, *sin_d, *cos_d, *tan_d, *sin_pd, *cos_pd; int errors = 0; diff --git a/catch/unit/deviceLib/hmax_hmin.cc b/catch/unit/deviceLib/hmax_hmin.cc index c6d5e5768..3282892c6 100644 --- a/catch/unit/deviceLib/hmax_hmin.cc +++ b/catch/unit/deviceLib/hmax_hmin.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -88,7 +72,7 @@ __global__ void HMinMaxHalfOpsArray(__half* x, __half* y, __half* ExptdResult, i // The following tests checks the basic functionality of __hmax(), __hmin() // __hmax_nan() and __hmin_nan() -TEST_CASE("Unit_hmax_hmin_Tsts") { +TEST_CASE(Unit_hmax_hmin_Tsts) { int *Hptr = nullptr, *Dptr = nullptr; HIP_CHECK(hipHostMalloc(&Hptr, sizeof(int))); *Hptr = 1; @@ -203,7 +187,7 @@ TEST_CASE("Unit_hmax_hmin_Tsts") { // The following Tests does negative testing by passing nan -TEST_CASE("Unit_hmax_hmin_Tsts_Negative") { +TEST_CASE(Unit_hmax_hmin_Tsts_Negative) { int *Hptr = nullptr, *Dptr = nullptr; HIP_CHECK(hipHostMalloc(&Hptr, sizeof(int))); *Hptr = 1; @@ -230,7 +214,7 @@ TEST_CASE("Unit_hmax_hmin_Tsts_Negative") { } // The following tests the __hmax/min functions over array of memory -TEST_CASE("Unit_hmax_hmin_Tsts_With_Array") { +TEST_CASE(Unit_hmax_hmin_Tsts_With_Array) { int *Hptr = nullptr, *Dptr = nullptr; __half *Ad = nullptr, *Bd = nullptr; HIP_CHECK(hipHostMalloc(&Hptr, sizeof(int))); diff --git a/catch/unit/deviceLib/kerDevAllocMultCO.cc b/catch/unit/deviceLib/kerDevAllocMultCO.cc index 03a200f14..375d69c8c 100644 --- a/catch/unit/deviceLib/kerDevAllocMultCO.cc +++ b/catch/unit/deviceLib/kerDevAllocMultCO.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "./defs.h" diff --git a/catch/unit/deviceLib/kerDevAllocSingleKer.cc b/catch/unit/deviceLib/kerDevAllocSingleKer.cc index 5a375910a..21de79193 100644 --- a/catch/unit/deviceLib/kerDevAllocSingleKer.cc +++ b/catch/unit/deviceLib/kerDevAllocSingleKer.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "./defs.h" diff --git a/catch/unit/deviceLib/kerDevFreeMultCO.cc b/catch/unit/deviceLib/kerDevFreeMultCO.cc index b4c738dff..c10f395e3 100644 --- a/catch/unit/deviceLib/kerDevFreeMultCO.cc +++ b/catch/unit/deviceLib/kerDevFreeMultCO.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "./defs.h" diff --git a/catch/unit/deviceLib/kerDevWriteMultCO.cc b/catch/unit/deviceLib/kerDevWriteMultCO.cc index c6c6082f3..cc2c400d9 100644 --- a/catch/unit/deviceLib/kerDevWriteMultCO.cc +++ b/catch/unit/deviceLib/kerDevWriteMultCO.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "./defs.h" diff --git a/catch/unit/deviceLib/ldg.cc b/catch/unit/deviceLib/ldg.cc index bf663b831..b675d3cf1 100644 --- a/catch/unit/deviceLib/ldg.cc +++ b/catch/unit/deviceLib/ldg.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -220,7 +204,7 @@ template int dataTypesRun4() { return errors; } -TEST_CASE("Unit_ldg") { +TEST_CASE(Unit_ldg) { using namespace std; int errors; diff --git a/catch/unit/deviceLib/mbcnt.cc b/catch/unit/deviceLib/mbcnt.cc index 1fc37ee1c..98fa1981a 100644 --- a/catch/unit/deviceLib/mbcnt.cc +++ b/catch/unit/deviceLib/mbcnt.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -36,7 +20,7 @@ __global__ void HIP_kernel(unsigned int* mbcnt_lo, unsigned int* mbcnt_hi, unsig } -TEST_CASE("Unit_mbcnt") { +TEST_CASE(Unit_mbcnt) { using namespace std; unsigned int* device_mbcnt_lo; unsigned int* device_mbcnt_hi; diff --git a/catch/unit/deviceLib/popc.cc b/catch/unit/deviceLib/popc.cc index a86bb1132..78f267391 100644 --- a/catch/unit/deviceLib/popc.cc +++ b/catch/unit/deviceLib/popc.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -53,7 +37,7 @@ __global__ void HIP_kernel(unsigned int* a, unsigned int* b, unsigned int* c, } -TEST_CASE("Unit_popc") { +TEST_CASE(Unit_popc) { using namespace std; unsigned int* hostA; unsigned int* hostB; diff --git a/catch/unit/deviceLib/syncthreadsand.cc b/catch/unit/deviceLib/syncthreadsand.cc index 4bbc2efcd..b258f2de7 100644 --- a/catch/unit/deviceLib/syncthreadsand.cc +++ b/catch/unit/deviceLib/syncthreadsand.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -120,7 +104,7 @@ static void test_syncthreads_and(int blockSize) { HIP_CHECK(hipHostFree(allThreadsMinusOneH)); } -TEST_CASE("Unit_syncthreads_and") { +TEST_CASE(Unit_syncthreads_and) { int blockSizes[] = {10, 40, 70, 130, 240, 723, 32, 64, 128, 256, 512, 1024}; for (unsigned long i = 0; i < (sizeof(blockSizes) / sizeof(blockSizes[0])); ++i) test_syncthreads_and(blockSizes[i]); diff --git a/catch/unit/deviceLib/syncthreadscount.cc b/catch/unit/deviceLib/syncthreadscount.cc index 9a78dadfe..eac804708 100644 --- a/catch/unit/deviceLib/syncthreadscount.cc +++ b/catch/unit/deviceLib/syncthreadscount.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -131,7 +115,7 @@ void test_syncthreads_count(int blockSize) { HIP_CHECK(hipHostFree(allThreadsIdH)); } -TEST_CASE("Unit_syncthreads_count") { +TEST_CASE(Unit_syncthreads_count) { int blockSizes[] = {10, 40, 70, 130, 240, 723, 32, 64, 128, 256, 512, 1024}; for (unsigned long i = 0; i < (sizeof(blockSizes) / sizeof(blockSizes[0])); ++i) test_syncthreads_count(blockSizes[i]); diff --git a/catch/unit/deviceLib/syncthreadsor.cc b/catch/unit/deviceLib/syncthreadsor.cc index a06bc3279..721ebc6d0 100644 --- a/catch/unit/deviceLib/syncthreadsor.cc +++ b/catch/unit/deviceLib/syncthreadsor.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -121,7 +105,7 @@ static void test_syncthreads_or(int blockSize) { } -TEST_CASE("Unit_syncthreads_or") { +TEST_CASE(Unit_syncthreads_or) { int blockSizes[] = {10, 40, 70, 130, 240, 723, 32, 64, 128, 256, 512, 1024}; for (unsigned long i = 0; i < (sizeof(blockSizes) / sizeof(blockSizes[0])); ++i) test_syncthreads_or(blockSizes[i]); diff --git a/catch/unit/deviceLib/threadfence_system.cc b/catch/unit/deviceLib/threadfence_system.cc index d2b28ee1e..ff27fd52c 100644 --- a/catch/unit/deviceLib/threadfence_system.cc +++ b/catch/unit/deviceLib/threadfence_system.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -51,7 +35,7 @@ __global__ void gpu_round_robin(const int id, const int num_dev, const int num_i round_robin(id, num_dev, num_iter, data, flag); } -TEST_CASE("Unit_threadfence_system", "[multigpu]") { +TEST_CASE(Unit_threadfence_system) { int num_gpus = 0; HIP_CHECK(hipGetDeviceCount(&num_gpus)); REQUIRE(num_gpus > 0); diff --git a/catch/unit/deviceLib/unsafeAtomicAddDevice.cc b/catch/unit/deviceLib/unsafeAtomicAddDevice.cc index 6466494da..183027951 100644 --- a/catch/unit/deviceLib/unsafeAtomicAddDevice.cc +++ b/catch/unit/deviceLib/unsafeAtomicAddDevice.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -46,7 +30,7 @@ void unsafeAdd_d(double *p, double v) )"}; -TEST_CASE("Unit_unsafeAtomicAdd") { +TEST_CASE(Unit_unsafeAtomicAdd) { using namespace std; int device = 0; hipDeviceProp_t props; diff --git a/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withnounsafeflag.cc b/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withnounsafeflag.cc index 552de0bab..3d839c515 100644 --- a/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withnounsafeflag.cc +++ b/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withnounsafeflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on FineGrainMemory 1. The following test scenario verifies @@ -45,7 +31,7 @@ Output: unsafeatomicAdd API would return 0 and the 0/P is 5 atomic add instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentwithnoUnsafeflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_CoherentwithnoUnsafeflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withoutflag.cc b/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withoutflag.cc index 3e884e479..127dc75a3 100644 --- a/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withoutflag.cc +++ b/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withoutflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on FineGrainMemory 1. The following test scenario verifies @@ -45,7 +31,7 @@ Output: unsafeatomicAdd API would return 0 and the 0/P is 5 atomic add instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_Coherentwithoutflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_Coherentwithoutflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withunsafeflag.cc b/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withunsafeflag.cc index cecca6553..eccb30088 100644 --- a/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withunsafeflag.cc +++ b/catch/unit/deviceLib/unsafeAtomicAdd_Coherent_withunsafeflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on FineGrainMemory 1. The following test scenario verifies @@ -46,7 +32,7 @@ Output: atomicAdd API would return 0 and the 0/P is 5 atomic add instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentwithUnsafeflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_CoherentwithUnsafeflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withnounsafeflag.cc b/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withnounsafeflag.cc index 71d297b52..3b2870d76 100644 --- a/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withnounsafeflag.cc +++ b/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withnounsafeflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* AtomicAdd on CoarseGrainMemory 1. The following test scenario verifies @@ -44,7 +30,7 @@ Output: unsafeAtomicAdd API would work and the 0/P is INITIAL_VAL + INC_VAL global_atomic_add instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentnounsafeatomicsflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_NonCoherentnounsafeatomicsflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withoutflag.cc b/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withoutflag.cc index e146e6742..f31fbb624 100644 --- a/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withoutflag.cc +++ b/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withoutflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* unsafeAtomicAdd on CoarseGrainMemory 1. The following test scenario verifies @@ -44,7 +30,7 @@ Output: unsafeAtomicAdd API would work and the 0/P is INITIAL_VAL + INC_VAL global_atomic_cmpswap instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentwithoutflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_NonCoherentwithoutflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withunsafeflag.cc b/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withunsafeflag.cc index 4dfc880b7..ee1c75eee 100644 --- a/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withunsafeflag.cc +++ b/catch/unit/deviceLib/unsafeAtomicAdd_NonCoherent_withunsafeflag.cc @@ -1,23 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + /* unsafeAtomicAdd on CoarseGrainMemory 1. The following test scenario verifies @@ -44,7 +30,7 @@ Output: unsafeAtomicAdd API would work and the 0/P is INITIAL_VAL + INC_VAL global_atomic_add instruction is generated or not */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentwithunsafeatomicsflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_NonCoherentwithunsafeatomicsflag, float, double) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/deviceLib/unsafeAtomicAdd_RTC.cc b/catch/unit/deviceLib/unsafeAtomicAdd_RTC.cc index 16036ade6..37f87e02d 100644 --- a/catch/unit/deviceLib/unsafeAtomicAdd_RTC.cc +++ b/catch/unit/deviceLib/unsafeAtomicAdd_RTC.cc @@ -1,22 +1,7 @@ /* - Copyright (c) 2021 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* @@ -60,7 +45,7 @@ __global__ void AtomicCheck(double* Ad, double *result) { Output: unsafeAtomicAdd API will not work and returns 0 so the initial value will be intact. expected O/P is 5 */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCnounsafeatomicflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_CoherentRTCnounsafeatomicflag, float, double) { int device = 0; hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, device)); @@ -151,7 +136,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCnounsafeatomicflag", "", flo Output: unsafeAtomicAdd API will not work and r`eturns 0 so the initial value will be intact. expected O/P is 5 */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCunsafeatomicflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_CoherentRTCunsafeatomicflag, float, double) { int device = 0; hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, device)); @@ -241,7 +226,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCunsafeatomicflag", "", float Output: unsafeAtomicAdd API will not work and returns 0 so the initial value will be intact. expected O/P is 5*/ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCwithoutflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_CoherentRTCwithoutflag, float, double) { int device = 0; hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, device)); @@ -330,7 +315,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_CoherentRTCwithoutflag", "", float, dou is compiled using hipRTC and with compilation flag -mno-unsafe-fp-atomics Input: Ad{5}, INCREMENT_VAL{10} Output: Expected O/P is 15 */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentRTCnounsafeatomicflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_NonCoherentRTCnounsafeatomicflag, float, double) { int device = 0; hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, device)); @@ -413,7 +398,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentRTCnounsafeatomicflag", "", Input: Ad{5}, INCREMENT_VAL{10} Output: Expected O/P is 15 */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentRTCunsafeatomicflag", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_NonCoherentRTCunsafeatomicflag, float, double) { int device = 0; hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, device)); @@ -497,7 +482,7 @@ TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentRTCunsafeatomicflag", "", fl Input: Ad{5}, INCREMENT_VAL{10} Output: O/P is 15 */ -TEMPLATE_TEST_CASE("Unit_unsafeAtomicAdd_NonCoherentRTC", "", float, double) { +TEMPLATE_TEST_CASE(Unit_unsafeAtomicAdd_NonCoherentRTC, float, double) { int device = 0; hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, device)); diff --git a/catch/unit/device_memory/CMakeLists.txt b/catch/unit/device_memory/CMakeLists.txt index ab08a7823..999ac5840 100644 --- a/catch/unit/device_memory/CMakeLists.txt +++ b/catch/unit/device_memory/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms @@ -31,35 +15,28 @@ elseif(HIP_PLATFORM MATCHES "amd") set(LINKER_LIBS hiprtc::hiprtc) endif() -if(HIP_PLATFORM MATCHES "amd") - hip_add_exe_to_target(NAME DeviceMemoryTest +hip_add_exe_to_target(NAME DeviceMemoryTest TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests LINKER_LIBS ${LINKER_LIBS} PROPERTY CXX_STANDARD 17) -elseif (HIP_PLATFORM MATCHES "nvidia") - hip_add_exe_to_target(NAME DeviceMemoryTest - TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests - LINKER_LIBS ${LINKER_LIBS}) -endif() if(UNIX) -file(GLOB NEGATIVE_TEST_SRC + file(GLOB NEGATIVE_TEST_SRC "memcpy_negative_kernels.cc" "memset_negative_kernels.cc" ) -file(COPY ${NEGATIVE_TEST_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src) -set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC}) + file(COPY ${NEGATIVE_TEST_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src) + set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC}) -#add_test(NAME Unit_Device_memcpy_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# memcpy_negative_kernels.cc 4) -# -#add_test(NAME Unit_Device_memset_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# memset_negative_kernels.cc 4) + #add_test(NAME Unit_Device_memcpy_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # memcpy_negative_kernels.cc 4) + # + #add_test(NAME Unit_Device_memset_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # memset_negative_kernels.cc 4) endif() diff --git a/catch/unit/device_memory/memcpy.cc b/catch/unit/device_memory/memcpy.cc index 313ae7113..97aaa7610 100644 --- a/catch/unit/device_memory/memcpy.cc +++ b/catch/unit/device_memory/memcpy.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "memcpy_negative_kernels_rtc.hh" #include @@ -197,7 +185,7 @@ template void DeviceMemcpyCommon(kernel_sig memcpy_kernel) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_memcpy_Positive", "", char, int, unsigned int, long, unsigned long, +TEMPLATE_TEST_CASE(Unit_Device_memcpy_Positive, char, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { SECTION("Memcpy whole buffer in one thread") { DeviceMemcpyCommon(memcpy_at_once_kernel); @@ -218,7 +206,7 @@ TEMPLATE_TEST_CASE("Unit_Device_memcpy_Positive", "", char, int, unsigned int, l * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_memcpy_Negative_Parameters_RTC") { +TEST_CASE(Unit_Device_memcpy_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = kMemcpyParam; diff --git a/catch/unit/device_memory/memcpy_negative_kernels.cc b/catch/unit/device_memory/memcpy_negative_kernels.cc index 84621dca8..6ebff6bad 100644 --- a/catch/unit/device_memory/memcpy_negative_kernels.cc +++ b/catch/unit/device_memory/memcpy_negative_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/device_memory/memcpy_negative_kernels_rtc.hh b/catch/unit/device_memory/memcpy_negative_kernels_rtc.hh index ac86844ec..4ab034110 100644 --- a/catch/unit/device_memory/memcpy_negative_kernels_rtc.hh +++ b/catch/unit/device_memory/memcpy_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/device_memory/memset.cc b/catch/unit/device_memory/memset.cc index 5fc390c20..e17370ff3 100644 --- a/catch/unit/device_memory/memset.cc +++ b/catch/unit/device_memory/memset.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "memset_negative_kernels_rtc.hh" #include @@ -120,7 +108,7 @@ template void DeviceMemsetCommon(kernel_sig memset_kernel) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_memset_Positive", "", char, int, unsigned int, long, unsigned long, +TEMPLATE_TEST_CASE(Unit_Device_memset_Positive, char, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { SECTION("Memset whole buffer in one thread") { DeviceMemsetCommon(memset_at_once_kernel); @@ -141,7 +129,7 @@ TEMPLATE_TEST_CASE("Unit_Device_memset_Positive", "", char, int, unsigned int, l * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_memset_Negative_Parameters_RTC") { +TEST_CASE(Unit_Device_memset_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = kMemsetParam; diff --git a/catch/unit/device_memory/memset_negative_kernels.cc b/catch/unit/device_memory/memset_negative_kernels.cc index e6d1c19e0..87a77911b 100644 --- a/catch/unit/device_memory/memset_negative_kernels.cc +++ b/catch/unit/device_memory/memset_negative_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/device_memory/memset_negative_kernels_rtc.hh b/catch/unit/device_memory/memset_negative_kernels_rtc.hh index 43d3c513b..673dcc23e 100644 --- a/catch/unit/device_memory/memset_negative_kernels_rtc.hh +++ b/catch/unit/device_memory/memset_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/dynamicLoading/CMakeLists.txt b/catch/unit/dynamicLoading/CMakeLists.txt index 7cb666b59..8e67063bd 100644 --- a/catch/unit/dynamicLoading/CMakeLists.txt +++ b/catch/unit/dynamicLoading/CMakeLists.txt @@ -1,55 +1,44 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT + if(UNIX AND BUILD_SHARED_LIBS) set(TEST_SRC ${TEST_SRC} complex_loading_behavior.cc) set(AMD_TEST_SRC hipApiDynamicLoad.cc) -if(HIP_PLATFORM MATCHES "amd") - set(TEST_SRC ${TEST_SRC} ${AMD_TEST_SRC}) -endif() + if(HIP_PLATFORM MATCHES "amd") + set(TEST_SRC ${TEST_SRC} ${AMD_TEST_SRC}) + endif() -hip_add_exe_to_target(NAME dynamicLoading + hip_add_exe_to_target(NAME dynamicLoading TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests) -if(HIP_PLATFORM MATCHES "amd") - add_custom_target(libLazyLoad.so COMMAND ${CMAKE_HIP_COMPILER} -fPIC -lpthread -shared - ${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/liblazyLoad.cc + if(HIP_PLATFORM MATCHES "amd") + add_custom_target(libLazyLoad.so COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} -fPIC -lpthread -shared + -x hip ${CMAKE_CURRENT_SOURCE_DIR}/liblazyLoad.cc -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT} -I${Catch2_SOURCE_DIR}/src -I${Catch2_BINARY_DIR}/generated-includes -o libLazyLoad.so) -elseif(HIP_PLATFORM MATCHES "nvidia") - add_custom_target(libLazyLoad.so COMMAND ${CMAKE_CUDA_COMPILER} -Xcompiler -fPIC -lpthread -Wno-deprecated-declarations -shared + add_custom_target(bit_extract_kernel.code COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only + -x hip ${CMAKE_CURRENT_SOURCE_DIR}/bit_extract_kernel.cpp ${HIP_PATH_OPT} + -o ${CMAKE_CURRENT_BINARY_DIR}/../dynamicLoading/bit_extract_kernel.code + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) + elseif(HIP_PLATFORM MATCHES "nvidia") + add_custom_target(libLazyLoad.so COMMAND ${CMAKE_CUDA_COMPILER} -Xcompiler -fPIC -lpthread -shared -x cu ${CMAKE_CURRENT_SOURCE_DIR}/liblazyLoad.cc -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${Catch2_SOURCE_DIR}/src -I${Catch2_BINARY_DIR}/generated-includes -I${HIP_PATH}/include/ -o libLazyLoad.so) -endif() + add_custom_target(bit_extract_kernel.code COMMAND ${CMAKE_HIP_COMPILER} --fatbin + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/bit_extract_kernel.cpp -I${HIP_PATH}/include/ + ${OFFLOAD_ARCH_LIST} -o ${CMAKE_CURRENT_BINARY_DIR}/../dynamicLoading/bit_extract_kernel.code + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) + endif() -add_custom_target(bit_extract_kernel.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only - -x hip ${CMAKE_CURRENT_SOURCE_DIR}/bit_extract_kernel.cpp ${HIP_PATH_OPT} - ${OFFLOAD_ARCH_LIST} -o ${CMAKE_CURRENT_BINARY_DIR}/../dynamicLoading/bit_extract_kernel.code - -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -add_custom_target(vecadd.cc COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/vecadd.cc ${CMAKE_CURRENT_BINARY_DIR}/../dynamicLoading/) -set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS + add_custom_target(vecadd.cc COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/vecadd.cc ${CMAKE_CURRENT_BINARY_DIR}/../dynamicLoading/) + set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/vecadd.cc ${CMAKE_CURRENT_BINARY_DIR}/libLazyLoad.so ${CMAKE_CURRENT_BINARY_DIR}/bit_extract_kernel.code diff --git a/catch/unit/dynamicLoading/bit_extract_kernel.cpp b/catch/unit/dynamicLoading/bit_extract_kernel.cpp index 56678abab..114830fe4 100644 --- a/catch/unit/dynamicLoading/bit_extract_kernel.cpp +++ b/catch/unit/dynamicLoading/bit_extract_kernel.cpp @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include extern "C" __global__ void bit_extract_kernel(uint32_t* C_d, const uint32_t* A_d, size_t N) { size_t offset = (blockIdx.x * blockDim.x + threadIdx.x); diff --git a/catch/unit/dynamicLoading/complex_loading_behavior.cc b/catch/unit/dynamicLoading/complex_loading_behavior.cc index 79fc7c130..e9de9fe9a 100644 --- a/catch/unit/dynamicLoading/complex_loading_behavior.cc +++ b/catch/unit/dynamicLoading/complex_loading_behavior.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -136,7 +124,7 @@ static bool launch_dynamically_loaded_kernel() { return testResult; } -TEST_CASE("Unit_dynamic_loading_device_kernels_from_library") { +TEST_CASE(Unit_dynamic_loading_device_kernels_from_library) { bool testResult = true; testResult &= launch_local_kernel(); diff --git a/catch/unit/dynamicLoading/hipApiDynamicLoad.cc b/catch/unit/dynamicLoading/hipApiDynamicLoad.cc index 2a7105f65..ae5d7e7d0 100644 --- a/catch/unit/dynamicLoading/hipApiDynamicLoad.cc +++ b/catch/unit/dynamicLoading/hipApiDynamicLoad.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -156,7 +144,7 @@ void test_dynamicLoading(void* sym_hipGetDevice, void* sym_hipMalloc, void* sym_ free(A_h); free(C_h); } -TEST_CASE("Unit_hipApiDynamicLoad_hipGetProcAddress") { +TEST_CASE(Unit_hipApiDynamicLoad_hipGetProcAddress) { void* sym_hipGetDevice; void* sym_hipMalloc; void* sym_hipMemcpyHtoD; @@ -189,7 +177,7 @@ TEST_CASE("Unit_hipApiDynamicLoad_hipGetProcAddress") { } -TEST_CASE("Unit_hipApiDynamicLoad") { +TEST_CASE(Unit_hipApiDynamicLoad) { void* handle = dlopen("libamdhip64.so", RTLD_LAZY); REQUIRE(handle != NULL); diff --git a/catch/unit/dynamicLoading/liblazyLoad.cc b/catch/unit/dynamicLoading/liblazyLoad.cc index 68b0a6a16..71c977d4b 100644 --- a/catch/unit/dynamicLoading/liblazyLoad.cc +++ b/catch/unit/dynamicLoading/liblazyLoad.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include diff --git a/catch/unit/dynamicLoading/vecadd.cc b/catch/unit/dynamicLoading/vecadd.cc index c5374cf57..fd4a196dc 100644 --- a/catch/unit/dynamicLoading/vecadd.cc +++ b/catch/unit/dynamicLoading/vecadd.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include __global__ void kerAdd(int* in_a, int* in_b, int* out_c, int nelem) { diff --git a/catch/unit/errorHandling/CMakeLists.txt b/catch/unit/errorHandling/CMakeLists.txt index 873417baf..f9216324e 100644 --- a/catch/unit/errorHandling/CMakeLists.txt +++ b/catch/unit/errorHandling/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC error_handling_common.cc @@ -7,7 +11,6 @@ set(TEST_SRC hipDrvGetErrorString.cc hipGetLastError.cc hipPeekAtLastError.cc - hipDynamicLogging.cc ) if(UNIX) @@ -19,16 +22,13 @@ endif() add_executable(hipGetLastErrorEnv_Exe EXCLUDE_FROM_ALL hipGetLastErrorEnv_Exe.cc) add_executable(hipPeekAtLastErrorEnv_Exe EXCLUDE_FROM_ALL hipPeekAtLastErrorEnv_Exe.cc) -set_source_files_properties(hipGetLastErrorEnv_Exe.cc PROPERTIES LANGUAGE HIP) -set_source_files_properties(hipPeekAtLastErrorEnv_Exe.cc PROPERTIES LANGUAGE HIP) -set_target_properties(hipGetLastErrorEnv_Exe PROPERTIES LINKER_LANGUAGE HIP) -set_target_properties(hipPeekAtLastErrorEnv_Exe PROPERTIES LINKER_LANGUAGE HIP) -target_link_libraries(hipGetLastErrorEnv_Exe hip::host hip::device) -target_link_libraries(hipPeekAtLastErrorEnv_Exe hip::host hip::device) +set_source_files_properties(hipGetLastErrorEnv_Exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +set_source_files_properties(hipPeekAtLastErrorEnv_Exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) if(HIP_PLATFORM MATCHES "amd") set(AMD_SRC hipExtGetLastError.cc + hipDynamicLogging.cc ) set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) endif() diff --git a/catch/unit/errorHandling/OutCapture.hh b/catch/unit/errorHandling/OutCapture.hh index febd7e429..b747284ae 100644 --- a/catch/unit/errorHandling/OutCapture.hh +++ b/catch/unit/errorHandling/OutCapture.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/errorHandling/error_handling_common.cc b/catch/unit/errorHandling/error_handling_common.cc index a2e4cdd9e..2b429ddc2 100644 --- a/catch/unit/errorHandling/error_handling_common.cc +++ b/catch/unit/errorHandling/error_handling_common.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "error_handling_common.hh" diff --git a/catch/unit/errorHandling/error_handling_common.hh b/catch/unit/errorHandling/error_handling_common.hh index fa8ca9015..f331021f6 100644 --- a/catch/unit/errorHandling/error_handling_common.hh +++ b/catch/unit/errorHandling/error_handling_common.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/errorHandling/hipDrvGetErrorName.cc b/catch/unit/errorHandling/hipDrvGetErrorName.cc index 4c7802059..44c739376 100644 --- a/catch/unit/errorHandling/hipDrvGetErrorName.cc +++ b/catch/unit/errorHandling/hipDrvGetErrorName.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -41,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.4 */ -TEST_CASE("Unit_hipDrvGetErrorName_Positive_Basic") { +TEST_CASE(Unit_hipDrvGetErrorName_Positive_Basic) { const char* error_string = nullptr; const auto enumerator = GENERATE(from_range(std::begin(kErrorEnumerators), std::end(kErrorEnumerators))); @@ -69,7 +56,7 @@ TEST_CASE("Unit_hipDrvGetErrorName_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.4 */ -TEST_CASE("Unit_hipDrvGetErrorName_Negative_Parameters") { +TEST_CASE(Unit_hipDrvGetErrorName_Negative_Parameters) { const char* error_string = nullptr; SECTION("pass unknown value to hipError") { HIP_CHECK_ERROR((hipDrvGetErrorName(static_cast(-1), &error_string)), diff --git a/catch/unit/errorHandling/hipDrvGetErrorString.cc b/catch/unit/errorHandling/hipDrvGetErrorString.cc index 5cfc94eb4..29116827c 100644 --- a/catch/unit/errorHandling/hipDrvGetErrorString.cc +++ b/catch/unit/errorHandling/hipDrvGetErrorString.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -41,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.4 */ -TEST_CASE("Unit_hipDrvGetErrorString_Positive_Basic") { +TEST_CASE(Unit_hipDrvGetErrorString_Positive_Basic) { const char* error_string = nullptr; const auto enumerator = GENERATE(from_range(std::begin(kErrorEnumerators), std::end(kErrorEnumerators))); @@ -68,7 +55,7 @@ TEST_CASE("Unit_hipDrvGetErrorString_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.4 */ -TEST_CASE("Unit_hipDrvGetErrorString_Negative_Parameters") { +TEST_CASE(Unit_hipDrvGetErrorString_Negative_Parameters) { const char* error_string = nullptr; SECTION("pass unknown value to hipError") { HIP_CHECK_ERROR((hipDrvGetErrorString(static_cast(-1), &error_string)), diff --git a/catch/unit/errorHandling/hipDynamicLogging.cc b/catch/unit/errorHandling/hipDynamicLogging.cc index d242b12bb..7ded177bd 100644 --- a/catch/unit/errorHandling/hipDynamicLogging.cc +++ b/catch/unit/errorHandling/hipDynamicLogging.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "OutCapture.hh" diff --git a/catch/unit/errorHandling/hipExtGetLastError.cc b/catch/unit/errorHandling/hipExtGetLastError.cc index 9e83a39e5..9cc3bf605 100644 --- a/catch/unit/errorHandling/hipExtGetLastError.cc +++ b/catch/unit/errorHandling/hipExtGetLastError.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022 - 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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -50,7 +37,7 @@ static constexpr size_t Nbytes = N * sizeof(int); *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_Positive_Basic") { +TEST_CASE(Unit_hipExtGetLastError_Positive_Basic) { HIP_CHECK(hipExtGetLastError()); HIP_CHECK_ERROR(hipMalloc(nullptr, 1), hipErrorInvalidValue); HIP_CHECK_ERROR(hipExtGetLastError(), hipErrorInvalidValue); @@ -69,7 +56,7 @@ TEST_CASE("Unit_hipExtGetLastError_Positive_Basic") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_Positive_Threaded") { +TEST_CASE(Unit_hipExtGetLastError_Positive_Threaded) { class HipGetLastErrorThreadedTest : public ThreadedZigZagTest { public: void TestPart2() { REQUIRE_THREAD(hipMalloc(nullptr, 1) == hipErrorInvalidValue); } @@ -93,7 +80,7 @@ TEST_CASE("Unit_hipExtGetLastError_Positive_Threaded") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpyPeerAsync", "[multigpu]") { +TEST_CASE(Unit_hipExtGetLastError_with_hipMemcpyPeerAsync) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -152,7 +139,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpyPeerAsync", "[multigpu]") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpyDtoHAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipMemcpyDtoHAsync) { int *A_d, *B_d, *A_h; hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); @@ -190,7 +177,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpyDtoHAsync") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpyParam2DAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipMemcpyParam2DAsync) { CHECK_IMAGE_SUPPORT float *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; @@ -243,7 +230,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpyParam2DAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipDrvMemcpy3DAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipDrvMemcpy3DAsync) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); @@ -266,7 +253,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipDrvMemcpy3DAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpy3DAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipMemcpy3DAsync) { CHECK_IMAGE_SUPPORT constexpr int width{10}, height{10}, depth{10}; @@ -321,7 +308,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpy3DAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpy2D_To_From_ArrayAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipMemcpy2D_To_From_ArrayAsync) { int* hData = reinterpret_cast(malloc(WIDTH)); REQUIRE(hData != nullptr); memset(hData, 0, WIDTH); @@ -361,7 +348,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpy2D_To_From_ArrayAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipStreamAttachMemAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipStreamAttachMemAsync) { void* d_memory{nullptr}; HIP_CHECK(hipExtGetLastError()); HIP_CHECK_ERROR(hipMemPrefetchAsync(reinterpret_cast(d_memory), 0, hipMemAttachHost, 0), @@ -382,7 +369,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipStreamAttachMemAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipWaitExternalSemaphoresAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipWaitExternalSemaphoresAsync) { hipExternalSemaphoreWaitParams wait_params = {}; wait_params.params.fence.value = 1; @@ -405,7 +392,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipWaitExternalSemaphoresAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipSignalExternalSemaphoresAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipSignalExternalSemaphoresAsync) { hipExternalSemaphoreSignalParams signal_params = {}; signal_params.params.fence.value = 1; @@ -428,7 +415,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipSignalExternalSemaphoresAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipMemPrefetchAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipMemPrefetchAsync) { HIP_CHECK(hipExtGetLastError()); HIP_CHECK_ERROR(hipMemPrefetchAsync(nullptr, 1024, 0), hipErrorInvalidValue); HIP_CHECK_ERROR(hipExtGetLastError(), hipErrorInvalidValue); @@ -448,7 +435,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipMemPrefetchAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpy2DAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipMemcpy2DAsync) { CHECK_IMAGE_SUPPORT int *A_h{nullptr}, *A_d{nullptr}; @@ -500,7 +487,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipMemcpy2DAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipMemsetAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_hipMemsetAsync) { int* A_d; HIP_CHECK(hipMalloc(&A_d, Nbytes)); REQUIRE(A_d != nullptr); @@ -529,7 +516,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipMemsetAsync") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_MemCpyAsync") { +TEST_CASE(Unit_hipExtGetLastError_with_MemCpyAsync) { int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; @@ -582,7 +569,7 @@ static void thread_wait_func(int sleep_time) { HIP_CHECK(hipExtGetLastError()); } -TEST_CASE("Unit_hipExtGetLastError_with_MemCpyAsync_thread") { +TEST_CASE(Unit_hipExtGetLastError_with_MemCpyAsync_thread) { int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; @@ -635,7 +622,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_MemCpyAsync_thread") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipGraphAddMemcpyNode1D") { +TEST_CASE(Unit_hipExtGetLastError_with_hipGraphAddMemcpyNode1D) { constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; int *A_d, *B_d, *C_d; @@ -716,7 +703,7 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipGraphAddMemcpyNode1D") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_with_hipStreamBegin_EndCapture") { +TEST_CASE(Unit_hipExtGetLastError_with_hipStreamBegin_EndCapture) { int *A_d, *B_d, *C_d, *A_h, *B_h, *C_h; HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); @@ -755,29 +742,6 @@ TEST_CASE("Unit_hipExtGetLastError_with_hipStreamBegin_EndCapture") { HIP_CHECK(hipStreamDestroy(stream)); } -/** - * Test Description - * ------------------------ - *  - Verify hipExtGetLastError status with hipGraphCreate api invalid arg call. - * Test source - * ------------------------ - *  - unit/errorHandling/hipExtGetLastError.cc - * Test requirements - * ------------------------ - *  - HIP_VERSION >= 6.4 - */ - -TEST_CASE("Unit_hipExtGetLastError_error_check_with_hipGraphCreate") { - hipGraph_t graph; - hipError_t ret; - - HIP_CHECK(hipExtGetLastError()); - ret = hipGraphCreate(&graph, 1); - REQUIRE(ret == hipErrorInvalidValue); - HIP_CHECK_ERROR(hipExtGetLastError(), hipErrorInvalidValue); - HIP_CHECK(hipExtGetLastError()); -} - /** * Test Description * ------------------------ @@ -793,7 +757,7 @@ TEST_CASE("Unit_hipExtGetLastError_error_check_with_hipGraphCreate") { *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipExtGetLastError_success_before_error_check_again") { +TEST_CASE(Unit_hipExtGetLastError_success_before_error_check_again) { int value = 0; hipGraph_t graph; @@ -821,7 +785,7 @@ TEST_CASE("Unit_hipExtGetLastError_success_before_error_check_again") { static void __global__ devideKernl(int* i, int x, int y) { *i = x / (x - y); } -TEST_CASE("Unit_hipExtGetLastError_with_Kernel_divide_by_zero") { +TEST_CASE(Unit_hipExtGetLastError_with_Kernel_divide_by_zero) { int* i_d; int i = 9; HIP_CHECK(hipMalloc(&i_d, sizeof(int))); diff --git a/catch/unit/errorHandling/hipGetErrorName.cc b/catch/unit/errorHandling/hipGetErrorName.cc index cfd78020b..2a0f3ca03 100644 --- a/catch/unit/errorHandling/hipGetErrorName.cc +++ b/catch/unit/errorHandling/hipGetErrorName.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetErrorName_Positive_Basic") { +TEST_CASE(Unit_hipGetErrorName_Positive_Basic) { const char* error_string = nullptr; const auto enumerator = GENERATE(from_range(std::begin(kErrorEnumerators), std::end(kErrorEnumerators))); @@ -70,7 +54,7 @@ TEST_CASE("Unit_hipGetErrorName_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetErrorName_Negative_Parameters") { +TEST_CASE(Unit_hipGetErrorName_Negative_Parameters) { const char* error_string = hipGetErrorName(static_cast(-1)); REQUIRE(error_string != nullptr); #if HT_NVIDIA diff --git a/catch/unit/errorHandling/hipGetErrorString.cc b/catch/unit/errorHandling/hipGetErrorString.cc index a7357670d..1391e64e7 100644 --- a/catch/unit/errorHandling/hipGetErrorString.cc +++ b/catch/unit/errorHandling/hipGetErrorString.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetErrorString_Positive_Basic") { +TEST_CASE(Unit_hipGetErrorString_Positive_Basic) { const char* error_string = nullptr; const auto enumerator = GENERATE(from_range(std::begin(kErrorEnumerators), std::end(kErrorEnumerators))); @@ -69,7 +53,7 @@ TEST_CASE("Unit_hipGetErrorString_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetErrorString_Negative_Parameters") { +TEST_CASE(Unit_hipGetErrorString_Negative_Parameters) { const char* error_string = hipGetErrorString(static_cast(-1)); REQUIRE(error_string != nullptr); } diff --git a/catch/unit/errorHandling/hipGetLastError.cc b/catch/unit/errorHandling/hipGetLastError.cc index ba5523eb7..f5f360142 100644 --- a/catch/unit/errorHandling/hipGetLastError.cc +++ b/catch/unit/errorHandling/hipGetLastError.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022 - 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -51,7 +38,7 @@ static constexpr size_t Nbytes = N * sizeof(int); *  - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetLastError_Positive_Basic") { +TEST_CASE(Unit_hipGetLastError_Positive_Basic) { HIP_CHECK(hipGetLastError()); HIP_CHECK_ERROR(hipMalloc(nullptr, 1), hipErrorInvalidValue); HIP_CHECK_ERROR(hipGetLastError(), hipErrorInvalidValue); @@ -70,7 +57,7 @@ TEST_CASE("Unit_hipGetLastError_Positive_Basic") { *  - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetLastError_Positive_Threaded") { +TEST_CASE(Unit_hipGetLastError_Positive_Threaded) { class HipGetLastErrorThreadedTest : public ThreadedZigZagTest { public: void TestPart2() { REQUIRE_THREAD(hipMalloc(nullptr, 1) == hipErrorInvalidValue); } @@ -94,7 +81,7 @@ TEST_CASE("Unit_hipGetLastError_Positive_Threaded") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipMemcpyPeerAsync", "[multigpu]") { +TEST_CASE(Unit_hipGetLastError_with_hipMemcpyPeerAsync) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -154,7 +141,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipMemcpyPeerAsync", "[multigpu]") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipMemcpyDtoHAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipMemcpyDtoHAsync) { int *A_d, *B_d, *A_h; hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); @@ -192,7 +179,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipMemcpyDtoHAsync") { * ------------------------ *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipMemcpyParam2DAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipMemcpyParam2DAsync) { CHECK_IMAGE_SUPPORT float *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; @@ -245,7 +232,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipMemcpyParam2DAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipDrvMemcpy3DAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipDrvMemcpy3DAsync) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); @@ -269,7 +256,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipDrvMemcpy3DAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipMemcpy3DAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipMemcpy3DAsync) { CHECK_IMAGE_SUPPORT constexpr int width{10}, height{10}, depth{10}; @@ -324,7 +311,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipMemcpy3DAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipMemcpy2D_To_From_ArrayAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipMemcpy2D_To_From_ArrayAsync) { int* hData = reinterpret_cast(malloc(WIDTH)); REQUIRE(hData != nullptr); memset(hData, 0, WIDTH); @@ -364,7 +351,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipMemcpy2D_To_From_ArrayAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipStreamAttachMemAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipStreamAttachMemAsync) { void* d_memory{nullptr}; HIP_CHECK(hipGetLastError()); HIP_CHECK_ERROR(hipMemPrefetchAsync(reinterpret_cast(d_memory), 0, hipMemAttachHost, 0), @@ -385,7 +372,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipStreamAttachMemAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipWaitExternalSemaphoresAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipWaitExternalSemaphoresAsync) { hipExternalSemaphoreWaitParams wait_params = {}; wait_params.params.fence.value = 1; @@ -408,7 +395,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipWaitExternalSemaphoresAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipSignalExternalSemaphoresAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipSignalExternalSemaphoresAsync) { hipExternalSemaphoreSignalParams signal_params = {}; signal_params.params.fence.value = 1; @@ -431,7 +418,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipSignalExternalSemaphoresAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipMemPrefetchAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipMemPrefetchAsync) { HIP_CHECK(hipGetLastError()); HIP_CHECK_ERROR(hipMemPrefetchAsync(nullptr, 1024, 0), hipErrorInvalidValue); HIP_CHECK_ERROR(hipGetLastError(), hipErrorInvalidValue); @@ -451,7 +438,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipMemPrefetchAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipMemcpy2DAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipMemcpy2DAsync) { CHECK_IMAGE_SUPPORT int *A_h{nullptr}, *A_d{nullptr}; @@ -503,7 +490,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipMemcpy2DAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_hipMemsetAsync") { +TEST_CASE(Unit_hipGetLastError_with_hipMemsetAsync) { int* A_d; HIP_CHECK(hipMalloc(&A_d, Nbytes)); REQUIRE(A_d != nullptr); @@ -532,7 +519,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipMemsetAsync") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_with_MemCpyAsync") { +TEST_CASE(Unit_hipGetLastError_with_MemCpyAsync) { int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; @@ -585,7 +572,7 @@ static void thread_wait_func(int sleep_time) { HIP_CHECK(hipGetLastError()); } -TEST_CASE("Unit_hipGetLastError_with_MemCpyAsync_thread") { +TEST_CASE(Unit_hipGetLastError_with_MemCpyAsync_thread) { int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; @@ -638,7 +625,7 @@ TEST_CASE("Unit_hipGetLastError_with_MemCpyAsync_thread") { *  - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipGetLastError_with_hipGraphAddMemcpyNode1D") { +TEST_CASE(Unit_hipGetLastError_with_hipGraphAddMemcpyNode1D) { constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; int *A_d, *B_d, *C_d; @@ -719,7 +706,7 @@ TEST_CASE("Unit_hipGetLastError_with_hipGraphAddMemcpyNode1D") { *  - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipGetLastError_with_hipStreamBegin_EndCapture") { +TEST_CASE(Unit_hipGetLastError_with_hipStreamBegin_EndCapture) { int *A_d, *B_d, *C_d, *A_h, *B_h, *C_h; HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); @@ -759,29 +746,6 @@ TEST_CASE("Unit_hipGetLastError_with_hipStreamBegin_EndCapture") { HIP_CHECK(hipStreamDestroy(stream)); } -/** - * Test Description - * ------------------------ - *  - Verify hipGetLastError status with hipGraphCreate api invalid arg call. - * Test source - * ------------------------ - *  - unit/errorHandling/hipGetLastError.cc - * Test requirements - * ------------------------ - *  - HIP_VERSION >= 6.0 - */ - -TEST_CASE("Unit_hipGetLastError_error_check_with_hipGraphCreate") { - hipGraph_t graph; - hipError_t ret; - - HIP_CHECK(hipGetLastError()); - ret = hipGraphCreate(&graph, 1); - REQUIRE(ret == hipErrorInvalidValue); - HIP_CHECK_ERROR(hipGetLastError(), hipErrorInvalidValue); - HIP_CHECK(hipGetLastError()); -} - /** * Test Description * ------------------------ @@ -794,8 +758,7 @@ TEST_CASE("Unit_hipGetLastError_error_check_with_hipGraphCreate") { *  - HIP_VERSION >= 6.0 */ -#if HT_NVIDIA -TEST_CASE("Unit_hipGetLastError_success_before_hipGetLastError") { +TEST_CASE(Unit_hipGetLastError_success_before_hipGetLastError) { hipGraph_t graph; hipStream_t stream; @@ -807,7 +770,6 @@ TEST_CASE("Unit_hipGetLastError_success_before_hipGetLastError") { HIP_CHECK(hipStreamDestroy(stream)); } -#endif /** * Test Description @@ -824,7 +786,7 @@ TEST_CASE("Unit_hipGetLastError_success_before_hipGetLastError") { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGetLastError_success_before_hipGetLastError_check_again") { +TEST_CASE(Unit_hipGetLastError_success_before_hipGetLastError_check_again) { int value = 0; hipGraph_t graph; @@ -852,7 +814,7 @@ TEST_CASE("Unit_hipGetLastError_success_before_hipGetLastError_check_again") { static void __global__ devideKernl(int* i, int x, int y) { *i = x / (x - y); } -TEST_CASE("Unit_hipGetLastError_with_Kernel_divide_by_zero") { +TEST_CASE(Unit_hipGetLastError_with_Kernel_divide_by_zero) { int* i_d; int i = 9; HIP_CHECK(hipMalloc(&i_d, sizeof(int))); @@ -888,7 +850,7 @@ TEST_CASE("Unit_hipGetLastError_with_Kernel_divide_by_zero") { static void __global__ incrementKernl(int* i) { *i += 1; } -TEST_CASE("Unit_hipGetLastError_with_Kernel_Invalid_Configuration") { +TEST_CASE(Unit_hipGetLastError_with_Kernel_Invalid_Configuration) { int* i_d; HIP_CHECK(hipMalloc(&i_d, sizeof(int))); REQUIRE(i_d != nullptr); @@ -951,7 +913,7 @@ TEST_CASE("Unit_hipGetLastError_with_Kernel_Invalid_Configuration") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGetLastError_With_Chk_Updated_Status") { +TEST_CASE(Unit_hipGetLastError_With_Chk_Updated_Status) { hipGraph_t graph; HIP_CHECK_ERROR(hipGraphCreate(&graph, 1), hipErrorInvalidValue); HIP_CHECK_ERROR(hipGetLastError(), hipErrorInvalidValue); @@ -971,7 +933,7 @@ TEST_CASE("Unit_hipGetLastError_With_Chk_Updated_Status") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGetLastError_Chk_Along_hipPeekAtLastError") { +TEST_CASE(Unit_hipGetLastError_Chk_Along_hipPeekAtLastError) { hipGraph_t graph; HIP_CHECK_ERROR(hipGraphCreate(&graph, 1), hipErrorInvalidValue); HIP_CHECK_ERROR(hipPeekAtLastError(), hipErrorInvalidValue); @@ -994,7 +956,7 @@ TEST_CASE("Unit_hipGetLastError_Chk_Along_hipPeekAtLastError") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGetLastError_Error_Combinations") { +TEST_CASE(Unit_hipGetLastError_Error_Combinations) { int value = 0; hipGraph_t graph; SECTION("A case with Error-Error") { @@ -1055,7 +1017,7 @@ static void thread_func() { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGetLastError_With_Thread") { +TEST_CASE(Unit_hipGetLastError_With_Thread) { hipGraph_t graph; int *A_d; HIP_CHECK(hipMalloc(&A_d, 1024)); @@ -1077,7 +1039,7 @@ TEST_CASE("Unit_hipGetLastError_With_Thread") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGetLastError_MultiProcess") { +TEST_CASE(Unit_hipGetLastError_MultiProcess) { hipGraph_t graph; int *A_d; HIP_CHECK(hipMalloc(&A_d, 1024)); @@ -1106,7 +1068,7 @@ static void __global__ emptyKernl() { } // Below test failed on NVIDIA due to error mismatch produced by the Invalid Kernel config. // For more details please check the ticket SWDEV-501851 comments. #if HT_AMD -TEST_CASE("Unit_hipGetLastError_Kernel_Invalid_Config") { +TEST_CASE(Unit_hipGetLastError_Kernel_Invalid_Config) { hipError_t ret; hipLaunchKernelGGL(emptyKernl, dim3(0), dim3(0), 0, 0); int* A_d; diff --git a/catch/unit/errorHandling/hipGetLastErrorEnv_Exe.cc b/catch/unit/errorHandling/hipGetLastErrorEnv_Exe.cc index 7be3cb3ec..a889aeb69 100644 --- a/catch/unit/errorHandling/hipGetLastErrorEnv_Exe.cc +++ b/catch/unit/errorHandling/hipGetLastErrorEnv_Exe.cc @@ -1,20 +1,9 @@ -/*Copyright (c) 2024 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "hip/hip_runtime_api.h" #include int main() { diff --git a/catch/unit/errorHandling/hipGetLastErrorOnAbort.cc b/catch/unit/errorHandling/hipGetLastErrorOnAbort.cc index 3ad3cdf95..95501820d 100644 --- a/catch/unit/errorHandling/hipGetLastErrorOnAbort.cc +++ b/catch/unit/errorHandling/hipGetLastErrorOnAbort.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -45,7 +32,7 @@ static __global__ void squareKernel(int* arr) { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipGetLastError_KernelFailure_ValidAndInvalidOperations") { +TEST_CASE(Unit_hipGetLastError_KernelFailure_ValidAndInvalidOperations) { DISABLE_CORE_DUMPS(); int* devMem = nullptr; @@ -104,7 +91,7 @@ TEST_CASE("Unit_hipGetLastError_KernelFailure_ValidAndInvalidOperations") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipGetLastError_KernelFailure_TwoDevices", "[multigpu]") { +TEST_CASE(Unit_hipGetLastError_KernelFailure_TwoDevices) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount < 2) { @@ -172,7 +159,7 @@ TEST_CASE("Unit_hipGetLastError_KernelFailure_TwoDevices", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipGetLastError_KernelFailure_TwoStreams") { +TEST_CASE(Unit_hipGetLastError_KernelFailure_TwoStreams) { DISABLE_CORE_DUMPS(); int* devMem = nullptr; diff --git a/catch/unit/errorHandling/hipPeekAtLastError.cc b/catch/unit/errorHandling/hipPeekAtLastError.cc index cb2b56ac0..ce36b8396 100644 --- a/catch/unit/errorHandling/hipPeekAtLastError.cc +++ b/catch/unit/errorHandling/hipPeekAtLastError.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022-2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -42,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipPeekAtLastError_Positive_Basic") { +TEST_CASE(Unit_hipPeekAtLastError_Positive_Basic) { HIP_CHECK(hipPeekAtLastError()); HIP_CHECK_ERROR(hipMalloc(nullptr, 1), hipErrorInvalidValue); HIP_CHECK_ERROR(hipPeekAtLastError(), hipErrorInvalidValue); @@ -65,7 +52,7 @@ TEST_CASE("Unit_hipPeekAtLastError_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipPeekAtLastError_Positive_Threaded") { +TEST_CASE(Unit_hipPeekAtLastError_Positive_Threaded) { class HipPeekAtLastErrorTest : public ThreadedZigZagTest { public: void TestPart2() { REQUIRE_THREAD(hipMalloc(nullptr, 1) == hipErrorInvalidValue); } @@ -91,7 +78,7 @@ TEST_CASE("Unit_hipPeekAtLastError_Positive_Threaded") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipPeekAtLastError_Positive") { +TEST_CASE(Unit_hipPeekAtLastError_Positive) { HIP_CHECK_ERROR(hipMalloc(nullptr, 1), hipErrorInvalidValue); int* A_d; HIP_CHECK(hipMalloc(&A_d, 1024)); @@ -112,7 +99,7 @@ TEST_CASE("Unit_hipPeekAtLastError_Positive") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipPeekAtLastError_Chk_Updated_Status") { +TEST_CASE(Unit_hipPeekAtLastError_Chk_Updated_Status) { hipGraph_t graph; int value = 0; HIP_CHECK_ERROR(hipGraphCreate(&graph, 1), hipErrorInvalidValue); @@ -135,7 +122,7 @@ TEST_CASE("Unit_hipPeekAtLastError_Chk_Updated_Status") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipPeekAtLastError_Chk_Along_hipGetLastError") { +TEST_CASE(Unit_hipPeekAtLastError_Chk_Along_hipGetLastError) { hipGraph_t graph; HIP_CHECK_ERROR(hipGraphCreate(&graph, 1), hipErrorInvalidValue); HIP_CHECK_ERROR(hipGetLastError(), hipErrorInvalidValue); @@ -160,7 +147,7 @@ TEST_CASE("Unit_hipPeekAtLastError_Chk_Along_hipGetLastError") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipPeekAtLastError_Error_Combinations") { +TEST_CASE(Unit_hipPeekAtLastError_Error_Combinations) { int value = 0; hipGraph_t graph; SECTION("A case with Error-Error-Success-Success") { @@ -223,7 +210,7 @@ static void thread_func() { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipPeekAtLastError_With_Thread") { +TEST_CASE(Unit_hipPeekAtLastError_With_Thread) { hipGraph_t graph; int *A_d; HIP_CHECK(hipMalloc(&A_d, 1024)); @@ -244,7 +231,7 @@ TEST_CASE("Unit_hipPeekAtLastError_With_Thread") { * ------------------------ *  - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipPeekAtLastError_MultiProcess") { +TEST_CASE(Unit_hipPeekAtLastError_MultiProcess) { hipGraph_t graph; int *A_d; HIP_CHECK(hipMalloc(&A_d, 1024)); @@ -272,7 +259,7 @@ static void __global__ emptyKernl() {} // Below test failed on NVIDIA due to error mismatch produced by the Invalid Kernel config. // For more details please check the ticket SWDEV-501896 comments. #if HT_AMD -TEST_CASE("Unit_hipPeekAtLastError_Kernel_Invalid_Config") { +TEST_CASE(Unit_hipPeekAtLastError_Kernel_Invalid_Config) { hipError_t ret; hipLaunchKernelGGL(emptyKernl, dim3(0), dim3(0), 0, 0); int* A_d; diff --git a/catch/unit/errorHandling/hipPeekAtLastErrorEnv_Exe.cc b/catch/unit/errorHandling/hipPeekAtLastErrorEnv_Exe.cc index 11064b482..ffc2c8423 100644 --- a/catch/unit/errorHandling/hipPeekAtLastErrorEnv_Exe.cc +++ b/catch/unit/errorHandling/hipPeekAtLastErrorEnv_Exe.cc @@ -1,20 +1,9 @@ -/*Copyright (c) 2024 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "hip/hip_runtime_api.h" #include int main() { diff --git a/catch/unit/event/CMakeLists.txt b/catch/unit/event/CMakeLists.txt index 4a7423e9e..e49ff6003 100644 --- a/catch/unit/event/CMakeLists.txt +++ b/catch/unit/event/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC Unit_hipEvent_Negative.cc @@ -28,3 +32,4 @@ endif() hip_add_exe_to_target(NAME EventTest TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests) + diff --git a/catch/unit/event/Unit_hipEvent.cc b/catch/unit/event/Unit_hipEvent.cc index adbca132a..c26fa80fc 100644 --- a/catch/unit/event/Unit_hipEvent.cc +++ b/catch/unit/event/Unit_hipEvent.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Tests hipEventRecord and hipEventElapsedTime with different scenarios // and confirms if these are working as expected #include @@ -202,7 +187,7 @@ void runTests(int64_t numElements) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEvent") { runTests(10000000); } +TEST_CASE(Unit_hipEvent) { runTests(10000000); } /** * End doxygen group EventTest. diff --git a/catch/unit/event/Unit_hipEventElapsedTime.cc b/catch/unit/event/Unit_hipEventElapsedTime.cc index b8aec0ff2..985604edc 100644 --- a/catch/unit/event/Unit_hipEventElapsedTime.cc +++ b/catch/unit/event/Unit_hipEventElapsedTime.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -56,7 +40,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventElapsedTime_NullCheck") { +TEST_CASE(Unit_hipEventElapsedTime_NullCheck) { hipEvent_t start, end; HIP_CHECK(hipEventCreate(&start)); HIP_CHECK(hipEventCreate(&end)); @@ -85,7 +69,7 @@ TEST_CASE("Unit_hipEventElapsedTime_NullCheck") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventElapsedTime_DisableTiming") { +TEST_CASE(Unit_hipEventElapsedTime_DisableTiming) { float timeElapsed = 1.0f; hipEvent_t start, stop; HIP_CHECK(hipEventCreateWithFlags(&start, hipEventDisableTiming)); @@ -108,7 +92,7 @@ TEST_CASE("Unit_hipEventElapsedTime_DisableTiming") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventElapsedTime_DifferentDevices", "[multigpu]") { +TEST_CASE(Unit_hipEventElapsedTime_DifferentDevices) { int devCount = 0; HIP_CHECK(hipGetDeviceCount(&devCount)); if (devCount > 1) { @@ -153,7 +137,7 @@ TEST_CASE("Unit_hipEventElapsedTime_DifferentDevices", "[multigpu]") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventElapsedTime_NotReady_Negative") { +TEST_CASE(Unit_hipEventElapsedTime_NotReady_Negative) { hipEvent_t start; HIP_CHECK(hipEventCreate(&start)); @@ -189,7 +173,7 @@ TEST_CASE("Unit_hipEventElapsedTime_NotReady_Negative") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventElapsedTime") { +TEST_CASE(Unit_hipEventElapsedTime) { hipEvent_t start; HIP_CHECK(hipEventCreate(&start)); @@ -209,7 +193,7 @@ TEST_CASE("Unit_hipEventElapsedTime") { HIP_CHECK(hipEventDestroy(stop)); } -TEST_CASE("Unit_hipEventElapsedTime_Verify_Capture") { +TEST_CASE(Unit_hipEventElapsedTime_Verify_Capture) { hipEvent_t start, stop; HIP_CHECK(hipEventCreate(&start)); diff --git a/catch/unit/event/Unit_hipEventIpc.cc b/catch/unit/event/Unit_hipEventIpc.cc index 5e52be8af..4804bc211 100644 --- a/catch/unit/event/Unit_hipEventIpc.cc +++ b/catch/unit/event/Unit_hipEventIpc.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ // Test hipEventIpc behavior. @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventIpc") { +TEST_CASE(Unit_hipEventIpc) { size_t N = 4 * 1024 * 1024; unsigned threadsPerBlock = 256; int iterations = 1; diff --git a/catch/unit/event/Unit_hipEventIpc_shm_cleanup.cc b/catch/unit/event/Unit_hipEventIpc_shm_cleanup.cc index 72771a386..b852bc3a9 100644 --- a/catch/unit/event/Unit_hipEventIpc_shm_cleanup.cc +++ b/catch/unit/event/Unit_hipEventIpc_shm_cleanup.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ // Test hipEventIpc behavior. @@ -64,7 +48,7 @@ std::set get_hip_ipc_shm_files() { return result; } -TEST_CASE("Unit_hipEventIpc_shm_cleanup") { +TEST_CASE(Unit_hipEventIpc_shm_cleanup) { auto before = get_hip_ipc_shm_files(); int pipefd[2]; diff --git a/catch/unit/event/Unit_hipEventMGpuMThreads.cc b/catch/unit/event/Unit_hipEventMGpuMThreads.cc index b1ee368d5..7392608a2 100644 --- a/catch/unit/event/Unit_hipEventMGpuMThreads.cc +++ b/catch/unit/event/Unit_hipEventMGpuMThreads.cc @@ -1,21 +1,9 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + #define HIP_TEMPLATE_KERNEL_LAUNCH #include #include @@ -203,7 +191,7 @@ void testEventMGpuMThreads(int nThreads = 1) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventMGpuMThreads_1") { testEventMGpuMThreads(1); } +TEST_CASE(Unit_hipEventMGpuMThreads_1) { testEventMGpuMThreads(1); } /** * Test Description @@ -216,7 +204,7 @@ TEST_CASE("Unit_hipEventMGpuMThreads_1") { testEventMGpuMThreads(1); } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventMGpuMThreads_2", "[multigpu]") { +TEST_CASE(Unit_hipEventMGpuMThreads_2) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); if (numDevices > 1) { @@ -237,7 +225,7 @@ TEST_CASE("Unit_hipEventMGpuMThreads_2", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventMGpuMThreads_3", "[multigpu]") { +TEST_CASE(Unit_hipEventMGpuMThreads_3) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); if (numDevices > 1) { diff --git a/catch/unit/event/Unit_hipEventQuery.cc b/catch/unit/event/Unit_hipEventQuery.cc index a0ddb5104..57cce1fef 100644 --- a/catch/unit/event/Unit_hipEventQuery.cc +++ b/catch/unit/event/Unit_hipEventQuery.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -41,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventQuery_DifferentDevice", "[multigpu]") { +TEST_CASE(Unit_hipEventQuery_DifferentDevice) { hipEvent_t event1{}, event2{}; HIP_CHECK(hipEventCreate(&event1)); HIP_CHECK(hipEventCreate(&event2)); diff --git a/catch/unit/event/Unit_hipEventRecord.cc b/catch/unit/event/Unit_hipEventRecord.cc index 96734042a..692e537c0 100644 --- a/catch/unit/event/Unit_hipEventRecord.cc +++ b/catch/unit/event/Unit_hipEventRecord.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -53,7 +37,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventRecord") { +TEST_CASE(Unit_hipEventRecord) { constexpr size_t N = 1024; constexpr int iterations = 1; @@ -158,7 +142,7 @@ TEST_CASE("Unit_hipEventRecord") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventRecord_Negative", "[multigpu]") { +TEST_CASE(Unit_hipEventRecord_Negative) { SECTION("Nullptr event") { HIP_CHECK_ERROR(hipEventRecord(nullptr, nullptr), hipErrorInvalidResourceHandle); } diff --git a/catch/unit/event/Unit_hipEvent_Negative.cc b/catch/unit/event/Unit_hipEvent_Negative.cc index e1a04be1c..c50a26574 100644 --- a/catch/unit/event/Unit_hipEvent_Negative.cc +++ b/catch/unit/event/Unit_hipEvent_Negative.cc @@ -1,24 +1,9 @@ /* -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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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. -*/ /* Testcase Scenarios : Unit_hipEventCreate_NullCheck - Test unsuccessful event creation when event passed as nullptr @@ -51,7 +36,7 @@ incompatible flags are passed * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventCreate_NullCheck") { +TEST_CASE(Unit_hipEventCreate_NullCheck) { auto res = hipEventCreate(nullptr); REQUIRE(res != hipSuccess); } @@ -79,7 +64,7 @@ TEST_CASE("Unit_hipEventCreate_NullCheck") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventCreateWithFlags_NullCheck") { +TEST_CASE(Unit_hipEventCreateWithFlags_NullCheck) { auto res = hipEventCreateWithFlags(nullptr, 0); REQUIRE(res != hipSuccess); } @@ -97,7 +82,7 @@ TEST_CASE("Unit_hipEventCreateWithFlags_NullCheck") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventCreate_IncompatibleFlags") { +TEST_CASE(Unit_hipEventCreate_IncompatibleFlags) { hipEvent_t event; HIP_CHECK_ERROR(hipEventCreateWithFlags(&event, hipEventInterprocess), hipErrorInvalidValue); @@ -145,7 +130,7 @@ TEST_CASE("Unit_hipEventCreate_IncompatibleFlags") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventSynchronize_NullCheck") { +TEST_CASE(Unit_hipEventSynchronize_NullCheck) { auto res = hipEventSynchronize(nullptr); REQUIRE(res != hipSuccess); } @@ -173,35 +158,7 @@ TEST_CASE("Unit_hipEventSynchronize_NullCheck") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventQuery_NullCheck") { +TEST_CASE(Unit_hipEventQuery_NullCheck) { auto res = hipEventQuery(nullptr); REQUIRE(res != hipSuccess); } -/** - * End doxygen group hipEventQuery. - * @} - */ - -/** - * @addtogroup hipEventDestroy hipEventDestroy - * @{ - * @ingroup EventTest - */ - -/** - * Test Description - * ------------------------ - * - Validates handling of invalid arguments: - * -# When event is `nullptr` - * - Expected output: do not return `hipSuccess` - * Test source - * ------------------------ - * - unit/event/Unit_hipEvent_Negative.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ -TEST_CASE("Unit_hipEventDestroy_NullCheck") { - auto res = hipEventDestroy(nullptr); - REQUIRE(res != hipSuccess); -} diff --git a/catch/unit/event/hipEventCreate.cc b/catch/unit/event/hipEventCreate.cc index 78414c5a0..eeec1f697 100644 --- a/catch/unit/event/hipEventCreate.cc +++ b/catch/unit/event/hipEventCreate.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -41,7 +25,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventCreate_Positive") { +TEST_CASE(Unit_hipEventCreate_Positive) { int id = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(id)); @@ -63,7 +47,7 @@ TEST_CASE("Unit_hipEventCreate_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventCreate_Verify_Capture") { +TEST_CASE(Unit_hipEventCreate_Verify_Capture) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/event/hipEventCreateWithFlags.cc b/catch/unit/event/hipEventCreateWithFlags.cc index 38e6a9e84..2407fb9c7 100644 --- a/catch/unit/event/hipEventCreateWithFlags.cc +++ b/catch/unit/event/hipEventCreateWithFlags.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2022-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -49,7 +33,7 @@ constexpr int block_size = 512; * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventCreateWithFlags_Positive") { +TEST_CASE(Unit_hipEventCreateWithFlags_Positive) { #if HT_AMD const unsigned int flagUnderTest = GENERATE(hipEventDefault, hipEventBlockingSync, hipEventDisableTiming, @@ -168,7 +152,7 @@ static void testMemCoherency(eSyncToTest test, eMemoryToTest mem, uint32_t flags * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipEventCreateWithFlags_DisableSystemFence_HstVisMem") { +TEST_CASE(Unit_hipEventCreateWithFlags_DisableSystemFence_HstVisMem) { SECTION("Check with hipStreamSynchronize") { INFO("Check with hipStreamSynchronize"); testMemCoherency(eSyncToTest::eStreamSynchronize, eMemoryToTest::eHostVisibleMemory, @@ -195,7 +179,7 @@ TEST_CASE("Unit_hipEventCreateWithFlags_DisableSystemFence_HstVisMem") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipEventCreateWithFlags_DefaultFlg_HstVisMem") { +TEST_CASE(Unit_hipEventCreateWithFlags_DefaultFlg_HstVisMem) { SECTION("Check with hipStreamSynchronize") { INFO("Check with hipStreamSynchronize"); testMemCoherency(eSyncToTest::eStreamSynchronize, eMemoryToTest::eHostVisibleMemory, @@ -227,7 +211,7 @@ TEST_CASE("Unit_hipEventCreateWithFlags_DefaultFlg_HstVisMem") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipEventCreateWithFlags_DisableSystemFence_NonCohHstMem") { +TEST_CASE(Unit_hipEventCreateWithFlags_DisableSystemFence_NonCohHstMem) { SECTION("Check with hipStreamSynchronize") { INFO("Check with hipStreamSynchronize"); testMemCoherency(eSyncToTest::eStreamSynchronize, eMemoryToTest::eNonCoherentHostMemory, @@ -255,7 +239,7 @@ TEST_CASE("Unit_hipEventCreateWithFlags_DisableSystemFence_NonCohHstMem") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipEventCreateWithFlags_DefaultFlg_NonCohHstMem") { +TEST_CASE(Unit_hipEventCreateWithFlags_DefaultFlg_NonCohHstMem) { SECTION("Check with hipStreamSynchronize") { INFO("Check with hipStreamSynchronize"); testMemCoherency(eSyncToTest::eStreamSynchronize, eMemoryToTest::eNonCoherentHostMemory, @@ -287,7 +271,7 @@ TEST_CASE("Unit_hipEventCreateWithFlags_DefaultFlg_NonCohHstMem") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipEventCreateWithFlags_DisableSystemFence_CohHstMem") { +TEST_CASE(Unit_hipEventCreateWithFlags_DisableSystemFence_CohHstMem) { SECTION("Check with hipStreamSynchronize") { INFO("Check with hipStreamSynchronize"); testMemCoherency(eSyncToTest::eStreamSynchronize, eMemoryToTest::eCoherentHostMemory, @@ -319,7 +303,7 @@ TEST_CASE("Unit_hipEventCreateWithFlags_DisableSystemFence_CohHstMem") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipEventCreateWithFlags_DefaultFlg_CohHstMem") { +TEST_CASE(Unit_hipEventCreateWithFlags_DefaultFlg_CohHstMem) { SECTION("Check with hipStreamSynchronize") { INFO("Check with hipStreamSynchronize"); testMemCoherency(eSyncToTest::eStreamSynchronize, eMemoryToTest::eCoherentHostMemory, @@ -349,7 +333,7 @@ TEST_CASE("Unit_hipEventCreateWithFlags_DefaultFlg_CohHstMem") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventCreateWithFlags_Verify_Capture") { +TEST_CASE(Unit_hipEventCreateWithFlags_Verify_Capture) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/event/hipEventDestroy.cc b/catch/unit/event/hipEventDestroy.cc index 96edb9aca..9256d686b 100644 --- a/catch/unit/event/hipEventDestroy.cc +++ b/catch/unit/event/hipEventDestroy.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -67,7 +51,7 @@ static inline void launchVectorAdd(float*& A_h, float*& B_h, float*& C_h, * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventDestroy_Unfinished") { +TEST_CASE(Unit_hipEventDestroy_Unfinished) { hipEvent_t event; HIP_CHECK(hipEventCreate(&event)); @@ -96,7 +80,7 @@ TEST_CASE("Unit_hipEventDestroy_Unfinished") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventDestroy_WithWaitingStream") { +TEST_CASE(Unit_hipEventDestroy_WithWaitingStream) { hipEvent_t event; HIP_CHECK(hipEventCreate(&event)); @@ -134,14 +118,14 @@ TEST_CASE("Unit_hipEventDestroy_WithWaitingStream") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventDestroy_Negative") { +TEST_CASE(Unit_hipEventDestroy_Negative) { SECTION("Invalid Event") { hipEvent_t event{nullptr}; HIP_CHECK_ERROR(hipEventDestroy(event), hipErrorInvalidResourceHandle); } } -TEST_CASE("Unit_hipEventDestroy_Verify_Capture") { +TEST_CASE(Unit_hipEventDestroy_Verify_Capture) { hipEvent_t event; HIP_CHECK(hipEventCreate(&event)); REQUIRE(event != nullptr); diff --git a/catch/unit/event/hipEventSynchronize.cc b/catch/unit/event/hipEventSynchronize.cc index fa700a8ff..468f079e7 100644 --- a/catch/unit/event/hipEventSynchronize.cc +++ b/catch/unit/event/hipEventSynchronize.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -87,7 +71,7 @@ void testSynchronize(hipStream_t stream) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventSynchronize_Default_Positive") { +TEST_CASE(Unit_hipEventSynchronize_Default_Positive) { hipStream_t stream{nullptr}; SECTION("Kernel launched in null stream") { testSynchronize(stream); } @@ -110,7 +94,7 @@ TEST_CASE("Unit_hipEventSynchronize_Default_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipEventSynchronize_NoEventRecord_Positive") { +TEST_CASE(Unit_hipEventSynchronize_NoEventRecord_Positive) { constexpr size_t N = 1024; constexpr int blocks = 1024; diff --git a/catch/unit/executionControl/CMakeLists.txt b/catch/unit/executionControl/CMakeLists.txt index 242fbae33..79ea3c520 100644 --- a/catch/unit/executionControl/CMakeLists.txt +++ b/catch/unit/executionControl/CMakeLists.txt @@ -1,21 +1,25 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + set(TEST_SRC execution_control_common.cc hipFuncGetAttributesBasic.cc hipLaunchKernel.cc hipLaunchCooperativeKernel.cc - hipLaunchCooperativeKernelMultiDevice.cc ) if(HIP_PLATFORM MATCHES "amd") - set(TEST_SRC ${TEST_SRC} + set(TEST_SRC ${TEST_SRC} hipExtLaunchKernel.cc hipExtLaunchMultiKernelMultiDevice.cc launch_api.cc hipGetProcAddressLaunchCbExecCtrlApis.cc + hipLaunchCooperativeKernelMultiDevice.cc ) else() - # These functions are currently unimplemented on AMD - set(TEST_SRC ${TEST_SRC} + # These functions are currently unimplemented on AMD + set(TEST_SRC ${TEST_SRC} hipFuncSetCacheConfig.cc hipFuncSetSharedMemConfig.cc hipFuncSetAttribute.cc diff --git a/catch/unit/executionControl/execution_control_common.cc b/catch/unit/executionControl/execution_control_common.cc index e4c04de1f..6aa528302 100644 --- a/catch/unit/executionControl/execution_control_common.cc +++ b/catch/unit/executionControl/execution_control_common.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" diff --git a/catch/unit/executionControl/execution_control_common.hh b/catch/unit/executionControl/execution_control_common.hh index 425c5309e..7d01ca690 100644 --- a/catch/unit/executionControl/execution_control_common.hh +++ b/catch/unit/executionControl/execution_control_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/executionControl/hipExtLaunchKernel.cc b/catch/unit/executionControl/hipExtLaunchKernel.cc index 414b38389..8ad165436 100644 --- a/catch/unit/executionControl/hipExtLaunchKernel.cc +++ b/catch/unit/executionControl/hipExtLaunchKernel.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" @@ -27,7 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipExtLaunchKernel_Positive_Basic") { +TEST_CASE(Unit_hipExtLaunchKernel_Positive_Basic) { SECTION("Kernel with no arguments") { HIP_CHECK(hipExtLaunchKernel(reinterpret_cast(kernel), dim3{1, 1, 1}, dim3{1, 1, 1}, nullptr, 0, nullptr, nullptr, nullptr, 0u)); @@ -47,7 +31,7 @@ TEST_CASE("Unit_hipExtLaunchKernel_Positive_Basic") { } } -TEST_CASE("Unit_hipExtLaunchKernel_Positive_Parameters") { +TEST_CASE(Unit_hipExtLaunchKernel_Positive_Parameters) { SECTION("blockDim.x == maxBlockDimX") { const unsigned int x = GetDeviceAttribute(hipDeviceAttributeMaxBlockDimX, 0); HIP_CHECK(hipExtLaunchKernel(reinterpret_cast(kernel), dim3{1, 1, 1}, dim3{x, 1, 1}, @@ -67,7 +51,7 @@ TEST_CASE("Unit_hipExtLaunchKernel_Positive_Parameters") { } } -TEST_CASE("Unit_hipExtLaunchKernel_Negative_Parameters") { +TEST_CASE(Unit_hipExtLaunchKernel_Negative_Parameters) { SECTION("f == nullptr") { HIP_CHECK_ERROR(hipExtLaunchKernel(nullptr, dim3{1, 1, 1}, dim3{1, 1, 1}, nullptr, 0, nullptr, nullptr, nullptr, 0u), @@ -185,7 +169,7 @@ TEST_CASE("Unit_hipExtLaunchKernel_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipExtLaunchKernel_capturehipExtLaunchKernel") { +TEST_CASE(Unit_hipExtLaunchKernel_capturehipExtLaunchKernel) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); int* A_d; diff --git a/catch/unit/executionControl/hipExtLaunchMultiKernelMultiDevice.cc b/catch/unit/executionControl/hipExtLaunchMultiKernelMultiDevice.cc index 6f76830f9..07ae9db1c 100644 --- a/catch/unit/executionControl/hipExtLaunchMultiKernelMultiDevice.cc +++ b/catch/unit/executionControl/hipExtLaunchMultiKernelMultiDevice.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" @@ -27,8 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipExtLaunchMultiKernelMultiDevice_Positive_Basic", - "[multigpu]") { +TEST_CASE(Unit_hipExtLaunchMultiKernelMultiDevice_Positive_Basic) { const auto device_count = HipTest::getDeviceCount(); std::vector params_list(device_count); @@ -55,8 +38,7 @@ TEST_CASE("Unit_hipExtLaunchMultiKernelMultiDevice_Positive_Basic", } } -TEST_CASE("Unit_hipExtLaunchMultiKernelMultiDevice_Negative_Parameters", - "[multigpu]") { +TEST_CASE(Unit_hipExtLaunchMultiKernelMultiDevice_Negative_Parameters) { const auto device_count = HipTest::getDeviceCount(); std::vector params_list(device_count); @@ -123,7 +105,7 @@ TEST_CASE("Unit_hipExtLaunchMultiKernelMultiDevice_Negative_Parameters", } } -TEST_CASE("Unit_hipExtLaunchMultiKernelMultiDevice_Negative_MultiKernelSameDevice") { +TEST_CASE(Unit_hipExtLaunchMultiKernelMultiDevice_Negative_MultiKernelSameDevice) { HIP_CHECK(hipSetDevice(0)); std::vector params_list(2); diff --git a/catch/unit/executionControl/hipFuncGetAttributesBasic.cc b/catch/unit/executionControl/hipFuncGetAttributesBasic.cc index ffc5d760b..28972024f 100644 --- a/catch/unit/executionControl/hipFuncGetAttributesBasic.cc +++ b/catch/unit/executionControl/hipFuncGetAttributesBasic.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -29,7 +13,7 @@ __constant__ char const_data[kConstSizeBytes]; __global__ void attribute_test_kernel() {} -TEST_CASE("Unit_hipFuncGetAttributes_Positive_Basic") { +TEST_CASE(Unit_hipFuncGetAttributes_Positive_Basic) { hipFuncAttributes attr; HIP_CHECK(hipFuncGetAttributes(&attr, reinterpret_cast(attribute_test_kernel))); @@ -57,7 +41,7 @@ TEST_CASE("Unit_hipFuncGetAttributes_Positive_Basic") { } } -TEST_CASE("Unit_hipFuncGetAttributes_Negative_Parameters") { +TEST_CASE(Unit_hipFuncGetAttributes_Negative_Parameters) { SECTION("attr == nullptr") { HIP_CHECK_ERROR(hipFuncGetAttributes(nullptr, reinterpret_cast(attribute_test_kernel)), hipErrorInvalidValue); diff --git a/catch/unit/executionControl/hipFuncSetAttribute.cc b/catch/unit/executionControl/hipFuncSetAttribute.cc index c74710840..a26c5d2c7 100644 --- a/catch/unit/executionControl/hipFuncSetAttribute.cc +++ b/catch/unit/executionControl/hipFuncSetAttribute.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" @@ -45,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize") { +TEST_CASE(Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize) { HIP_CHECK(hipFuncSetAttribute(reinterpret_cast(kernel), hipFuncAttributeMaxDynamicSharedMemorySize, 1024)); @@ -67,7 +51,7 @@ TEST_CASE("Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout") { +TEST_CASE(Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout) { HIP_CHECK(hipFuncSetAttribute(reinterpret_cast(kernel), hipFuncAttributePreferredSharedMemoryCarveout, 50)); @@ -99,7 +83,7 @@ TEST_CASE("Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetAttribute_Positive_Parameters") { +TEST_CASE(Unit_hipFuncSetAttribute_Positive_Parameters) { SECTION("hipFuncAttributeMaxDynamicSharedMemorySize == 0") { HIP_CHECK(hipFuncSetAttribute(reinterpret_cast(kernel), hipFuncAttributeMaxDynamicSharedMemorySize, 0)); @@ -160,7 +144,7 @@ TEST_CASE("Unit_hipFuncSetAttribute_Positive_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipFuncSetAttribute_Negative_Parameters) { SECTION("func == nullptr") { HIP_CHECK_ERROR(hipFuncSetAttribute(nullptr, hipFuncAttributePreferredSharedMemoryCarveout, 50), hipErrorInvalidDeviceFunction); @@ -220,7 +204,7 @@ TEST_CASE("Unit_hipFuncSetAttribute_Negative_Parameters") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize_Not_Supported") { +TEST_CASE(Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize_Not_Supported) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("This is an AMD specific test"); return; @@ -252,7 +236,7 @@ TEST_CASE("Unit_hipFuncSetAttribute_Positive_MaxDynamicSharedMemorySize_Not_Supp * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout_Not_Supported") { +TEST_CASE(Unit_hipFuncSetAttribute_Positive_PreferredSharedMemoryCarveout_Not_Supported) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("This is an AMD specific test"); return; diff --git a/catch/unit/executionControl/hipFuncSetCacheConfig.cc b/catch/unit/executionControl/hipFuncSetCacheConfig.cc index 4e32d4c70..d3187bf94 100644 --- a/catch/unit/executionControl/hipFuncSetCacheConfig.cc +++ b/catch/unit/executionControl/hipFuncSetCacheConfig.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" @@ -50,7 +34,7 @@ constexpr std::array kCacheConfigs{ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetCacheConfig_Positive_Basic") { +TEST_CASE(Unit_hipFuncSetCacheConfig_Positive_Basic) { const auto cache_config = GENERATE(from_range(begin(kCacheConfigs), end(kCacheConfigs))); HIP_CHECK(hipFuncSetCacheConfig(reinterpret_cast(kernel), cache_config)); @@ -74,7 +58,7 @@ TEST_CASE("Unit_hipFuncSetCacheConfig_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetCacheConfig_Negative_Parameters") { +TEST_CASE(Unit_hipFuncSetCacheConfig_Negative_Parameters) { SECTION("func == nullptr") { HIP_CHECK_ERROR(hipFuncSetCacheConfig(nullptr, hipFuncCachePreferNone), hipErrorInvalidDeviceFunction); @@ -99,7 +83,7 @@ TEST_CASE("Unit_hipFuncSetCacheConfig_Negative_Parameters") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetCacheConfig_Negative_Not_Supported") { +TEST_CASE(Unit_hipFuncSetCacheConfig_Negative_Not_Supported) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("This is an AMD specific test"); return; diff --git a/catch/unit/executionControl/hipFuncSetSharedMemConfig.cc b/catch/unit/executionControl/hipFuncSetSharedMemConfig.cc index f429b8273..08502bfa9 100644 --- a/catch/unit/executionControl/hipFuncSetSharedMemConfig.cc +++ b/catch/unit/executionControl/hipFuncSetSharedMemConfig.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" @@ -49,7 +33,7 @@ constexpr std::array kSharedMemConfigs{ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetSharedMemConfig_Positive_Basic") { +TEST_CASE(Unit_hipFuncSetSharedMemConfig_Positive_Basic) { const auto shared_mem_config = GENERATE(from_range(begin(kSharedMemConfigs), end(kSharedMemConfigs))); @@ -74,7 +58,7 @@ TEST_CASE("Unit_hipFuncSetSharedMemConfig_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetSharedMemConfig_Negative_Parameters") { +TEST_CASE(Unit_hipFuncSetSharedMemConfig_Negative_Parameters) { SECTION("func == nullptr") { HIP_CHECK_ERROR(hipFuncSetSharedMemConfig(nullptr, hipSharedMemBankSizeDefault), hipErrorInvalidDeviceFunction); @@ -99,7 +83,7 @@ TEST_CASE("Unit_hipFuncSetSharedMemConfig_Negative_Parameters") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipFuncSetSharedMemConfig_Negative_Not_Supported") { +TEST_CASE(Unit_hipFuncSetSharedMemConfig_Negative_Not_Supported) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("This is an AMD specific test"); return; diff --git a/catch/unit/executionControl/hipGetProcAddressLaunchCbExecCtrlApis.cc b/catch/unit/executionControl/hipGetProcAddressLaunchCbExecCtrlApis.cc index acfe5ce3a..5a393edab 100644 --- a/catch/unit/executionControl/hipGetProcAddressLaunchCbExecCtrlApis.cc +++ b/catch/unit/executionControl/hipGetProcAddressLaunchCbExecCtrlApis.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -36,7 +23,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_KernelLaunchApis") { +TEST_CASE(Unit_hipGetProcAddress_KernelLaunchApis) { void* hipConfigureCall_ptr = nullptr; void* hipSetupArgument_ptr = nullptr; void* hipLaunchByPtr_ptr = nullptr; @@ -358,7 +345,7 @@ TEST_CASE("Unit_hipGetProcAddress_KernelLaunchApis") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_CallbackActivityAPIs") { +TEST_CASE(Unit_hipGetProcAddress_CallbackActivityAPIs) { void* hipGetStreamDeviceId_ptr = nullptr; void* hipApiName_ptr = nullptr; void* hipKernelNameRef_ptr = nullptr; @@ -424,7 +411,7 @@ TEST_CASE("Unit_hipGetProcAddress_CallbackActivityAPIs") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_ExecutionControlAPIs") { +TEST_CASE(Unit_hipGetProcAddress_ExecutionControlAPIs) { void* hipFuncSetAttribute_ptr = nullptr; void* hipFuncSetCacheConfig_ptr = nullptr; void* hipFuncSetSharedMemConfig_ptr = nullptr; diff --git a/catch/unit/executionControl/hipLaunchCooperativeKernel.cc b/catch/unit/executionControl/hipLaunchCooperativeKernel.cc index a940c9fe8..ec4e379ba 100644 --- a/catch/unit/executionControl/hipLaunchCooperativeKernel.cc +++ b/catch/unit/executionControl/hipLaunchCooperativeKernel.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" @@ -27,7 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipLaunchCooperativeKernel_Positive_Basic") { +TEST_CASE(Unit_hipLaunchCooperativeKernel_Positive_Basic) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -54,7 +38,7 @@ TEST_CASE("Unit_hipLaunchCooperativeKernel_Positive_Basic") { } } -TEST_CASE("Unit_hipLaunchCooperativeKernel_Positive_Parameters") { +TEST_CASE(Unit_hipLaunchCooperativeKernel_Positive_Parameters) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -79,7 +63,7 @@ TEST_CASE("Unit_hipLaunchCooperativeKernel_Positive_Parameters") { } } -TEST_CASE("Unit_hipLaunchCooperativeKernel_Negative_Parameters") { +TEST_CASE(Unit_hipLaunchCooperativeKernel_Negative_Parameters) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -178,7 +162,7 @@ TEST_CASE("Unit_hipLaunchCooperativeKernel_Negative_Parameters") { } } -TEST_CASE("Unit_hipLaunchCooperativeKernel_Verify_Capture") { +TEST_CASE(Unit_hipLaunchCooperativeKernel_Verify_Capture) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; diff --git a/catch/unit/executionControl/hipLaunchCooperativeKernelMultiDevice.cc b/catch/unit/executionControl/hipLaunchCooperativeKernelMultiDevice.cc index f3ea6df74..1217d1238 100644 --- a/catch/unit/executionControl/hipLaunchCooperativeKernelMultiDevice.cc +++ b/catch/unit/executionControl/hipLaunchCooperativeKernelMultiDevice.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" @@ -27,8 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipLaunchCooperativeKernelMultiDevice_Positive_Basic", - "[multigpu]") { +TEST_CASE(Unit_hipLaunchCooperativeKernelMultiDevice_Positive_Basic) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -64,8 +47,7 @@ TEST_CASE("Unit_hipLaunchCooperativeKernelMultiDevice_Positive_Basic", } } -TEST_CASE("Unit_hipLaunchCooperativeKernelMultiDevice_Negative_Parameters", - "[multigpu]") { +TEST_CASE(Unit_hipLaunchCooperativeKernelMultiDevice_Negative_Parameters) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -146,7 +128,7 @@ TEST_CASE("Unit_hipLaunchCooperativeKernelMultiDevice_Negative_Parameters", } } -TEST_CASE("Unit_hipLaunchCooperativeKernelMultiDevice_Negative_MultiKernelSameDevice") { +TEST_CASE(Unit_hipLaunchCooperativeKernelMultiDevice_Negative_MultiKernelSameDevice) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; diff --git a/catch/unit/executionControl/hipLaunchKernel.cc b/catch/unit/executionControl/hipLaunchKernel.cc index 03009f4ca..d2b42ba2b 100644 --- a/catch/unit/executionControl/hipLaunchKernel.cc +++ b/catch/unit/executionControl/hipLaunchKernel.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" @@ -27,7 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipLaunchKernel_Positive_Basic") { +TEST_CASE(Unit_hipLaunchKernel_Positive_Basic) { SECTION("Kernel with no arguments") { HIP_CHECK(hipLaunchKernel(reinterpret_cast(kernel), dim3{1, 1, 1}, dim3{1, 1, 1}, nullptr, 0, nullptr)); @@ -47,7 +31,7 @@ TEST_CASE("Unit_hipLaunchKernel_Positive_Basic") { } } -TEST_CASE("Unit_hipLaunchKernel_Positive_Parameters") { +TEST_CASE(Unit_hipLaunchKernel_Positive_Parameters) { SECTION("blockDim.x == maxBlockDimX") { const unsigned int x = GetDeviceAttribute(hipDeviceAttributeMaxBlockDimX, 0); HIP_CHECK(hipLaunchKernel(reinterpret_cast(kernel), dim3{1, 1, 1}, dim3{x, 1, 1}, @@ -67,7 +51,7 @@ TEST_CASE("Unit_hipLaunchKernel_Positive_Parameters") { } } -TEST_CASE("Unit_hipLaunchKernel_Negative_Parameters") { +TEST_CASE(Unit_hipLaunchKernel_Negative_Parameters) { SECTION("f == nullptr") { HIP_CHECK_ERROR(hipLaunchKernel(nullptr, dim3{1, 1, 1}, dim3{1, 1, 1}, nullptr, 0, nullptr), hipErrorInvalidDeviceFunction); @@ -155,7 +139,7 @@ TEST_CASE("Unit_hipLaunchKernel_Negative_Parameters") { #endif } -TEST_CASE("Unit_hipLaunchKernel_Verify_Capture") { +TEST_CASE(Unit_hipLaunchKernel_Verify_Capture) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/executionControl/launch_api.cc b/catch/unit/executionControl/launch_api.cc index f301da796..1414be89a 100644 --- a/catch/unit/executionControl/launch_api.cc +++ b/catch/unit/executionControl/launch_api.cc @@ -1,31 +1,15 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "execution_control_common.hh" #include #include -TEST_CASE("Unit_hipLaunchByPtr_Positive_Basic") { +TEST_CASE(Unit_hipLaunchByPtr_Positive_Basic) { LinearAllocGuard alloc(LinearAllocs::hipMallocManaged, 4); SECTION("hipConfigureCall") { HIP_CHECK(hipConfigureCall(dim3{1}, dim3{1}, 0, nullptr)); } @@ -43,12 +27,12 @@ TEST_CASE("Unit_hipLaunchByPtr_Positive_Basic") { REQUIRE(alloc.ptr()[0] == 42); } -TEST_CASE("Unit_hipLaunchByPtr_Negative_Parameters") { +TEST_CASE(Unit_hipLaunchByPtr_Negative_Parameters) { HIP_CHECK(hipConfigureCall(dim3{1}, dim3{1}, 0, nullptr)); HIP_CHECK_ERROR(hipLaunchByPtr(nullptr), hipErrorInvalidDeviceFunction); } -TEST_CASE("Unit___hipPushCallConfiguration_Positive_Basic") { +TEST_CASE(Unit___hipPushCallConfiguration_Positive_Basic) { StreamGuard stream_guard(Streams::created); HIP_CHECK(__hipPushCallConfiguration(dim3{1, 2, 3}, dim3{3, 2, 1}, 1024, stream_guard.stream())); @@ -68,7 +52,7 @@ TEST_CASE("Unit___hipPushCallConfiguration_Positive_Basic") { REQUIRE(stream == stream_guard.stream()); } -TEST_CASE("Unit_hipLaunchByPtr_Verify_Capture") { +TEST_CASE(Unit_hipLaunchByPtr_Verify_Capture) { LinearAllocGuard alloc(LinearAllocs::hipMallocManaged, 4); hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/g++/CMakeLists.txt b/catch/unit/g++/CMakeLists.txt index f7a83860c..af05c89ff 100644 --- a/catch/unit/g++/CMakeLists.txt +++ b/catch/unit/g++/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # AMD specific test if(HIP_PLATFORM MATCHES "amd" AND UNIX AND GPP_EXEC) set(TEST_SRC diff --git a/catch/unit/g++/hipMalloc.cc b/catch/unit/g++/hipMalloc.cc index cce6c87ad..e9afdd8b5 100644 --- a/catch/unit/g++/hipMalloc.cc +++ b/catch/unit/g++/hipMalloc.cc @@ -1,21 +1,8 @@ /* - * 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 - * 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * */ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -42,7 +29,7 @@ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipMalloc_gpptest") { +TEST_CASE(Unit_hipMalloc_gpptest) { printf("calling cpp function from here\n"); int result = MallocFunc(); REQUIRE(result == 1); diff --git a/catch/unit/g++/hipMalloc.cpp b/catch/unit/g++/hipMalloc.cpp index 8fb540967..658e1b072 100644 --- a/catch/unit/g++/hipMalloc.cpp +++ b/catch/unit/g++/hipMalloc.cpp @@ -1,21 +1,8 @@ /* - * Copyright (c) 2019 - 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * */ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/g++/hipMalloc.h b/catch/unit/g++/hipMalloc.h index 9dee5043e..6234842c7 100644 --- a/catch/unit/g++/hipMalloc.h +++ b/catch/unit/g++/hipMalloc.h @@ -1,21 +1,8 @@ /* - * 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 - * 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * */ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/gcc/CMakeLists.txt b/catch/unit/gcc/CMakeLists.txt index c47cbb256..05dafe52a 100644 --- a/catch/unit/gcc/CMakeLists.txt +++ b/catch/unit/gcc/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms if(HIP_PLATFORM MATCHES "amd" AND UNIX AND GCC_EXEC) set(TEST_SRC diff --git a/catch/unit/gcc/LaunchKernel.c b/catch/unit/gcc/LaunchKernel.c index 253d3aa1a..f9ae55bc3 100644 --- a/catch/unit/gcc/LaunchKernel.c +++ b/catch/unit/gcc/LaunchKernel.c @@ -1,20 +1,8 @@ -/* Copyright (c) 2019 - 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include diff --git a/catch/unit/gcc/LaunchKernel.h b/catch/unit/gcc/LaunchKernel.h index afbc6c5f6..a89162b17 100644 --- a/catch/unit/gcc/LaunchKernel.h +++ b/catch/unit/gcc/LaunchKernel.h @@ -1,20 +1,8 @@ -/* Copyright (c) 2019 - 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #ifdef __cplusplus diff --git a/catch/unit/gcc/gccTest.cc b/catch/unit/gcc/gccTest.cc index 2f2323de4..55b92059e 100644 --- a/catch/unit/gcc/gccTest.cc +++ b/catch/unit/gcc/gccTest.cc @@ -1,21 +1,8 @@ /* - * 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 - * 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * */ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -37,7 +24,7 @@ extern "C" { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_LaunchKernelgccTests") { +TEST_CASE(Unit_LaunchKernelgccTests) { printf("Calling launchKernel files from here\n"); int result = launchKernel(); REQUIRE(result == 1); @@ -57,7 +44,7 @@ TEST_CASE("Unit_LaunchKernelgccTests") { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipMallocgccTests") { +TEST_CASE(Unit_hipMallocgccTests) { printf("Calling hipMalloc files from here\n"); int result = hipMallocfunc(); REQUIRE(result == 1); diff --git a/catch/unit/gcc/gpu.cpp b/catch/unit/gcc/gpu.cpp index 354d593d9..a3234a49d 100644 --- a/catch/unit/gcc/gpu.cpp +++ b/catch/unit/gcc/gpu.cpp @@ -1,21 +1,8 @@ /* - * Copyright (c) 2019 - 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * */ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/gcc/hipMalloc.c b/catch/unit/gcc/hipMalloc.c index 9e8521ce4..ae38aeeec 100644 --- a/catch/unit/gcc/hipMalloc.c +++ b/catch/unit/gcc/hipMalloc.c @@ -1,21 +1,8 @@ /* - * Copyright (c) 2019 - 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * */ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/gl_interop/CMakeLists.txt b/catch/unit/gl_interop/CMakeLists.txt index c7c08d4f7..bc78075d9 100644 --- a/catch/unit/gl_interop/CMakeLists.txt +++ b/catch/unit/gl_interop/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + set(TEST_SRC hipGLGetDevices.cc hipGLContextSwitch.cc diff --git a/catch/unit/gl_interop/gl_interop_common.hh b/catch/unit/gl_interop/gl_interop_common.hh index 6320df97b..7d8a0177b 100644 --- a/catch/unit/gl_interop/gl_interop_common.hh +++ b/catch/unit/gl_interop/gl_interop_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/gl_interop/hipGLContextSwitch.cc b/catch/unit/gl_interop/hipGLContextSwitch.cc index acae24c79..67982ea7e 100644 --- a/catch/unit/gl_interop/hipGLContextSwitch.cc +++ b/catch/unit/gl_interop/hipGLContextSwitch.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2026 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @file hipGLContextSwitch.cc diff --git a/catch/unit/gl_interop/hipGLGetDevices.cc b/catch/unit/gl_interop/hipGLGetDevices.cc index f822064ee..10760bed2 100644 --- a/catch/unit/gl_interop/hipGLGetDevices.cc +++ b/catch/unit/gl_interop/hipGLGetDevices.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -31,7 +15,7 @@ constexpr std::array kDeviceLists{ hipGLDeviceListAll, hipGLDeviceListCurrentFrame, hipGLDeviceListNextFrame}; } // anonymous namespace -TEST_CASE("Unit_hipGLGetDevices_Positive_Basic") { +TEST_CASE(Unit_hipGLGetDevices_Positive_Basic) { GLContextScopeGuard gl_context; const auto device_list = GENERATE(from_range(begin(kDeviceLists), end(kDeviceLists))); @@ -53,7 +37,7 @@ TEST_CASE("Unit_hipGLGetDevices_Positive_Basic") { } } -TEST_CASE("Unit_hipGLGetDevices_Positive_Parameters") { +TEST_CASE(Unit_hipGLGetDevices_Positive_Parameters) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); @@ -81,7 +65,7 @@ TEST_CASE("Unit_hipGLGetDevices_Positive_Parameters") { } } -TEST_CASE("Unit_hipGLGetDevices_Negative_Parameters") { +TEST_CASE(Unit_hipGLGetDevices_Negative_Parameters) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); diff --git a/catch/unit/gl_interop/hipGraphicsGLRegisterBuffer.cc b/catch/unit/gl_interop/hipGraphicsGLRegisterBuffer.cc index 415b67154..b0b0be7ab 100644 --- a/catch/unit/gl_interop/hipGraphicsGLRegisterBuffer.cc +++ b/catch/unit/gl_interop/hipGraphicsGLRegisterBuffer.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -32,7 +16,7 @@ constexpr std::array kFlags{hipGraphicsRegisterFlagsNone, hipGraphicsRegisterFlagsWriteDiscard}; } // anonymous namespace -TEST_CASE("Unit_hipGraphicsGLRegisterBuffer_Positive_Basic") { +TEST_CASE(Unit_hipGraphicsGLRegisterBuffer_Positive_Basic) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); @@ -55,7 +39,7 @@ TEST_CASE("Unit_hipGraphicsGLRegisterBuffer_Positive_Basic") { HIP_CHECK(hipGraphicsUnregisterResource(vbo_resource)); } -TEST_CASE("Unit_hipGraphicsGLRegisterBuffer_Positive_Register_Twice") { +TEST_CASE(Unit_hipGraphicsGLRegisterBuffer_Positive_Register_Twice) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); @@ -78,7 +62,7 @@ TEST_CASE("Unit_hipGraphicsGLRegisterBuffer_Positive_Register_Twice") { HIP_CHECK(hipGraphicsUnregisterResource(vbo_resource_2)); } -TEST_CASE("Unit_hipGraphicsGLRegisterBuffer_Negative_Parameters") { +TEST_CASE(Unit_hipGraphicsGLRegisterBuffer_Negative_Parameters) { GLContextScopeGuard gl_context; GLBufferObject vbo; diff --git a/catch/unit/gl_interop/hipGraphicsGLRegisterImage.cc b/catch/unit/gl_interop/hipGraphicsGLRegisterImage.cc index cc372172e..fbc60a307 100644 --- a/catch/unit/gl_interop/hipGraphicsGLRegisterImage.cc +++ b/catch/unit/gl_interop/hipGraphicsGLRegisterImage.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -33,7 +17,7 @@ constexpr std::array kFlags{ hipGraphicsRegisterFlagsTextureGather}; } // anonymous namespace -TEST_CASE("Unit_hipGraphicsGLRegisterImage_Positive_Basic") { +TEST_CASE(Unit_hipGraphicsGLRegisterImage_Positive_Basic) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); @@ -56,7 +40,7 @@ TEST_CASE("Unit_hipGraphicsGLRegisterImage_Positive_Basic") { HIP_CHECK(hipGraphicsUnregisterResource(tex_resource)); } -TEST_CASE("Unit_hipGraphicsGLRegisterImage_Positive_Register_Twice") { +TEST_CASE(Unit_hipGraphicsGLRegisterImage_Positive_Register_Twice) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); unsigned int gl_device_count = 0; @@ -80,7 +64,7 @@ TEST_CASE("Unit_hipGraphicsGLRegisterImage_Positive_Register_Twice") { HIP_CHECK(hipGraphicsUnregisterResource(tex_resource_2)); } -TEST_CASE("Unit_hipGraphicsGLRegisterImage_Negative_Parameters") { +TEST_CASE(Unit_hipGraphicsGLRegisterImage_Negative_Parameters) { GLContextScopeGuard gl_context; GLImageObject tex; diff --git a/catch/unit/gl_interop/hipGraphicsMapResources.cc b/catch/unit/gl_interop/hipGraphicsMapResources.cc index 183a6a575..07b818a07 100644 --- a/catch/unit/gl_interop/hipGraphicsMapResources.cc +++ b/catch/unit/gl_interop/hipGraphicsMapResources.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,7 +10,7 @@ THE SOFTWARE. #include "gl_interop_common.hh" -TEST_CASE("Unit_hipGraphicsMapResources_Positive_Basic") { +TEST_CASE(Unit_hipGraphicsMapResources_Positive_Basic) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); @@ -60,7 +44,7 @@ TEST_CASE("Unit_hipGraphicsMapResources_Positive_Basic") { HIP_CHECK(hipGraphicsUnregisterResource(resources.at(1))); } -TEST_CASE("Unit_hipGraphicsMapResources_Negative_Parameters") { +TEST_CASE(Unit_hipGraphicsMapResources_Negative_Parameters) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); diff --git a/catch/unit/gl_interop/hipGraphicsResourceGetMappedPointer.cc b/catch/unit/gl_interop/hipGraphicsResourceGetMappedPointer.cc index b12203eba..437b6af70 100644 --- a/catch/unit/gl_interop/hipGraphicsResourceGetMappedPointer.cc +++ b/catch/unit/gl_interop/hipGraphicsResourceGetMappedPointer.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,7 +10,7 @@ THE SOFTWARE. #include "gl_interop_common.hh" -TEST_CASE("Unit_hipGraphicsResourceGetMappedPointer_Positive_Basic") { +TEST_CASE(Unit_hipGraphicsResourceGetMappedPointer_Positive_Basic) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); @@ -60,7 +44,7 @@ TEST_CASE("Unit_hipGraphicsResourceGetMappedPointer_Positive_Basic") { HIP_CHECK(hipGraphicsUnregisterResource(vbo_resource)); } -TEST_CASE("Unit_hipGraphicsResourceGetMappedPointer_Null_Parameters") { +TEST_CASE(Unit_hipGraphicsResourceGetMappedPointer_Null_Parameters) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); @@ -108,7 +92,7 @@ TEST_CASE("Unit_hipGraphicsResourceGetMappedPointer_Null_Parameters") { HIP_CHECK(hipGraphicsUnregisterResource(vbo_resource)); } -TEST_CASE("Unit_hipGraphicsResourceGetMappedPointer_Negative_Parameters") { +TEST_CASE(Unit_hipGraphicsResourceGetMappedPointer_Negative_Parameters) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); diff --git a/catch/unit/gl_interop/hipGraphicsSubResourceGetMappedArray.cc b/catch/unit/gl_interop/hipGraphicsSubResourceGetMappedArray.cc index e477916e3..d194cb2de 100644 --- a/catch/unit/gl_interop/hipGraphicsSubResourceGetMappedArray.cc +++ b/catch/unit/gl_interop/hipGraphicsSubResourceGetMappedArray.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,7 +10,7 @@ THE SOFTWARE. #include "gl_interop_common.hh" -TEST_CASE("Unit_hipGraphicsSubResourceGetMappedArray_Positive_Basic") { +TEST_CASE(Unit_hipGraphicsSubResourceGetMappedArray_Positive_Basic) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); @@ -57,7 +41,7 @@ TEST_CASE("Unit_hipGraphicsSubResourceGetMappedArray_Positive_Basic") { HIP_CHECK(hipGraphicsUnregisterResource(tex_resource)); } -TEST_CASE("Unit_hipGraphicsSubResourceGetMappedArray_Negative_Parameters") { +TEST_CASE(Unit_hipGraphicsSubResourceGetMappedArray_Negative_Parameters) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); diff --git a/catch/unit/gl_interop/hipGraphicsUnmapResources.cc b/catch/unit/gl_interop/hipGraphicsUnmapResources.cc index 080a81f89..6b76fb429 100644 --- a/catch/unit/gl_interop/hipGraphicsUnmapResources.cc +++ b/catch/unit/gl_interop/hipGraphicsUnmapResources.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,7 +10,7 @@ THE SOFTWARE. #include "gl_interop_common.hh" -TEST_CASE("Unit_hipGraphicsUnmapResources_Negative_Parameters") { +TEST_CASE(Unit_hipGraphicsUnmapResources_Negative_Parameters) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); diff --git a/catch/unit/gl_interop/hipGraphicsUnregisterResource.cc b/catch/unit/gl_interop/hipGraphicsUnregisterResource.cc index df6d3c5e6..c94b66ce7 100644 --- a/catch/unit/gl_interop/hipGraphicsUnregisterResource.cc +++ b/catch/unit/gl_interop/hipGraphicsUnregisterResource.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2022 - 2026 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,7 +10,7 @@ THE SOFTWARE. #include "gl_interop_common.hh" -TEST_CASE("Unit_hipGraphicsUnregisterResource_Negative_Parameters") { +TEST_CASE(Unit_hipGraphicsUnregisterResource_Negative_Parameters) { GLContextScopeGuard gl_context; const int device_count = HipTest::getDeviceCount(); diff --git a/catch/unit/graph/CMakeLists.txt b/catch/unit/graph/CMakeLists.txt index c2c95f8c8..3c5654b75 100644 --- a/catch/unit/graph/CMakeLists.txt +++ b/catch/unit/graph/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # FIXME: cjatin # This is a temp hack to pass it on windows since it has a char limit for @@ -26,13 +10,11 @@ set(TEST_SRC hipGraphAddEmptyNode.cc hipGraphAddDependencies.cc - hipGraphAddDependencies_old.cc hipGraphAddEventRecordNode.cc hipGraphAddEventWaitNode.cc hipGraph.cc hipSimpleGraphWithKernel.cc hipGraphAddMemcpyNode.cc - hipGraphAddMemcpyNode_old.cc hipGraphClone.cc hipGraphInstantiateWithFlags.cc hipGraphInstantiateWithParams.cc @@ -45,11 +27,9 @@ set(TEST_SRC hipGraphAddMemcpyNodeToSymbol_old.cc hipGraphAddMemcpyNodeToSymbol.cc hipGraphExecMemsetNodeSetParams.cc - hipGraphMemcpyNodeSetParamsToSymbol_old.cc hipGraphMemcpyNodeSetParamsToSymbol.cc hipGraphDestroyNode.cc hipGraphGetNodes.cc - hipGraphGetNodes_old.cc hipGraphGetRootNodes.cc hipGraphGetRootNodes_old.cc hipGraphHostNodeSetParams.cc @@ -59,9 +39,7 @@ set(TEST_SRC hipGraphExecMemcpyNodeSetParams1D_old.cc hipGraphExecMemcpyNodeSetParams1D.cc hipGraphGetEdges.cc - hipGraphGetEdges_old.cc hipGraphRemoveDependencies.cc - hipGraphRemoveDependencies_old.cc hipGraphInstantiate.cc hipGraphExecUpdate.cc hipGraphExecEventRecordNodeSetEvent.cc @@ -93,10 +71,15 @@ if(HIP_PLATFORM MATCHES "amd") hipStreamCaptureExtModuleLaunchKernel.cc hipStreamBeginCaptureToGraph.cc hipGetProcAddressGraphApis.cc - # Below files are disbled in NVIDIA as PSDB builds are failing due to lower CUDA version. + # Below files are disabled in NVIDIA as PSDB builds are failing due to lower CUDA version. hipGraphExecNodeSetParams.cc hipGraphNodeSetParams.cc hipGraphExecGetFlags.cc + # this files are disabled for NVIDIA due to lacking corresponding hipStreamGetCaptureInfo_v3 implementation + hipStreamGetCaptureInfo_old.cc + hipStreamGetCaptureInfo_v2.cc + hipStreamUpdateCaptureDependencies.cc + hipGraphAddNodeBeginCapture.cc ) set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) endif() @@ -107,7 +90,6 @@ hip_add_exe_to_target(NAME GraphsTest1 set(TEST_SRC hipStreamGetCaptureInfo.cc - hipStreamGetCaptureInfo_old.cc hipStreamEndCapture.cc hipStreamEndCapture_old.cc hipGraphMemcpyNodeSetParamsFromSymbol_old.cc @@ -118,7 +100,6 @@ set(TEST_SRC hipGraphMemcpyNodeGetParams.cc hipGraphMemcpyNodeGetParams_old.cc hipGraphMemcpyNodeSetParams.cc - hipGraphMemcpyNodeSetParams_old.cc hipGraphKernelNodeGetParams.cc hipGraphKernelNodeSetParams.cc hipGraphExecKernelNodeSetParams.cc @@ -129,18 +110,13 @@ set(TEST_SRC hipGraphExecMemcpyNodeSetParamsToSymbol_old.cc hipGraphExecMemcpyNodeSetParamsToSymbol.cc hipGraphNodeGetDependentNodes.cc - hipGraphNodeGetDependentNodes_old.cc hipGraphNodeGetDependencies.cc - hipGraphNodeGetDependencies_old.cc hipGraphHostNodeGetParams.cc hipGraphExecChildGraphNodeSetParams.cc - hipStreamGetCaptureInfo_v2.cc hipGraphCreate.cc hipGraphDestroy.cc - hipStreamUpdateCaptureDependencies.cc hipThreadExchangeStreamCaptureMode.cc hipLaunchHostFuncWithGraph.cc - hipStreamGetCaptureInfo_v2_old.cc hipUserObjectCreate.cc hipUserObjectRelease.cc hipUserObjectRetain.cc @@ -153,7 +129,6 @@ set(TEST_SRC hipGraphExecDestroy.cc hipGraphUpload.cc hipGraphKernelNodeCopyAttributes.cc - hipGraphAddNodeBeginCapture.cc hipGraphCycle.cc hipGraphPerf.cc hipGraphKernelNodeGetAttribute.cc @@ -179,23 +154,13 @@ if(HIP_PLATFORM MATCHES "amd") hipDrvGraphAddMemcpyNode.cc ) set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) -endif() - -add_custom_target(add_Kernel.code COMMAND ${CMAKE_HIP_COMPILER} - --cuda-device-only ${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/add_Kernel.cpp + add_custom_target(add_Kernel.code COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} + --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/add_Kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../graph/add_Kernel.code -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -set_property(GLOBAL APPEND PROPERTY - G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/add_Kernel.code) - -hip_add_exe_to_target(NAME GraphsTest2 - TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests) - -if(HIP_PLATFORM MATCHES "amd") - add_custom_target(hipMatMul COMMAND ${CMAKE_HIP_COMPILER} - --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(hipMatMul COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} + --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/hipMatMul.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/graph/hipMatMul.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../../../include/ @@ -204,6 +169,20 @@ if(HIP_PLATFORM MATCHES "amd") add_dependencies(build_tests hipMatMul) set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/hipMatMul.code) +else() + add_custom_target(add_Kernel.code COMMAND ${CMAKE_HIP_COMPILER} + --fatbin ${OFFLOAD_ARCH_LIST} -x cu ${CMAKE_CURRENT_SOURCE_DIR}/add_Kernel.cpp + -o ${CMAKE_CURRENT_BINARY_DIR}/../graph/add_Kernel.code + -I${HIP_INCLUDE_DIR} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) endif() +set_property(GLOBAL APPEND PROPERTY + G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/add_Kernel.code) + + +hip_add_exe_to_target(NAME GraphsTest2 + TEST_SRC ${TEST_SRC} + TEST_TARGET_NAME build_tests) + add_dependencies(build_tests add_Kernel.code) diff --git a/catch/unit/graph/add_Kernel.cpp b/catch/unit/graph/add_Kernel.cpp index 7c5e184f9..6c4e6a9d9 100644 --- a/catch/unit/graph/add_Kernel.cpp +++ b/catch/unit/graph/add_Kernel.cpp @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include extern "C" __global__ void Add(int* a, int* b, int* c) { size_t tx = (blockIdx.x * blockDim.x + threadIdx.x); diff --git a/catch/unit/graph/graph_dependency_common.hh b/catch/unit/graph/graph_dependency_common.hh index df9a7d3ba..41878f830 100644 --- a/catch/unit/graph/graph_dependency_common.hh +++ b/catch/unit/graph/graph_dependency_common.hh @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #pragma once #include diff --git a/catch/unit/graph/graph_memcpy_to_from_symbol_common.hh b/catch/unit/graph/graph_memcpy_to_from_symbol_common.hh index f69614b59..f8c3ad544 100644 --- a/catch/unit/graph/graph_memcpy_to_from_symbol_common.hh +++ b/catch/unit/graph/graph_memcpy_to_from_symbol_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/graph/graph_memset_node_test_common.hh b/catch/unit/graph/graph_memset_node_test_common.hh index b23a16933..745fe416b 100644 --- a/catch/unit/graph/graph_memset_node_test_common.hh +++ b/catch/unit/graph/graph_memset_node_test_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/graph/graph_tests_common.hh b/catch/unit/graph/graph_tests_common.hh index 430709388..80ddd9427 100644 --- a/catch/unit/graph/graph_tests_common.hh +++ b/catch/unit/graph/graph_tests_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/graph/hipDeviceGetGraphMemAttribute.cc b/catch/unit/graph/hipDeviceGetGraphMemAttribute.cc index 59cddc0c7..a9478c386 100644 --- a/catch/unit/graph/hipDeviceGetGraphMemAttribute.cc +++ b/catch/unit/graph/hipDeviceGetGraphMemAttribute.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -108,7 +92,7 @@ static void ResetGraphMemAttribute(unsigned deviceId = 0) { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Positive_DoubleMemory") { +TEST_CASE(Unit_hipDeviceGetGraphMemAttribute_Positive_DoubleMemory) { hipGraphExec_t graph_exec1, graph_exec2; int *dev_p1, *dev_p2; @@ -154,7 +138,7 @@ TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Positive_DoubleMemory") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceGetGraphMemAttribute_Negative_Parameters) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); @@ -218,7 +202,7 @@ TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Negative_Parameters") { * - HIP_VERSION >= 6.1 */ -static void Unit_hipDeviceGetGraphMemAttribute_Functional(unsigned deviceId = 0) { +static void hipDeviceGetGraphMemAttribute_Functional_Test(unsigned deviceId = 0) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -305,18 +289,17 @@ static void Unit_hipDeviceGetGraphMemAttribute_Functional(unsigned deviceId = 0) ResetGraphMemAttribute(deviceId); } -TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Functional") { - Unit_hipDeviceGetGraphMemAttribute_Functional(); +TEST_CASE(Unit_hipDeviceGetGraphMemAttribute_Functional) { + hipDeviceGetGraphMemAttribute_Functional_Test(); } -TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Functional_Multi_Device", - "[multigpu]") { +TEST_CASE(Unit_hipDeviceGetGraphMemAttribute_Functional_Multi_Device) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); if (numDevices > 0) { for (int i = 0; i < numDevices; ++i) { - Unit_hipDeviceGetGraphMemAttribute_Functional(i); + hipDeviceGetGraphMemAttribute_Functional_Test(i); } } else { HipTest::HIP_SKIP_TEST("Skipped test as there is no device to test."); @@ -339,7 +322,7 @@ TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Functional_Multi_Device", * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Negative") { +TEST_CASE(Unit_hipDeviceGetGraphMemAttribute_Negative) { size_t value = 0; hipError_t ret; SECTION("Pass device id as negative value") { @@ -379,7 +362,7 @@ TEST_CASE("Unit_hipDeviceGetGraphMemAttribute_Negative") { * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipDeviceSetGraphMemAttribute_Negative") { +TEST_CASE(Unit_hipDeviceSetGraphMemAttribute_Negative) { size_t value = 0; hipError_t ret; SECTION("Pass device id as negative value") { diff --git a/catch/unit/graph/hipDeviceGraphMemTrim.cc b/catch/unit/graph/hipDeviceGraphMemTrim.cc index be9238d67..4c1a83cb0 100644 --- a/catch/unit/graph/hipDeviceGraphMemTrim.cc +++ b/catch/unit/graph/hipDeviceGraphMemTrim.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -41,7 +25,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDeviceGraphMemTrim_Positive_Default") { +TEST_CASE(Unit_hipDeviceGraphMemTrim_Positive_Default) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); // Check for each device @@ -60,7 +44,7 @@ TEST_CASE("Unit_hipDeviceGraphMemTrim_Positive_Default") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDeviceGraphMemTrim_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceGraphMemTrim_Negative_Parameters) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); diff --git a/catch/unit/graph/hipDeviceSetGraphMemAttribute.cc b/catch/unit/graph/hipDeviceSetGraphMemAttribute.cc index c178353be..3d9d486b0 100644 --- a/catch/unit/graph/hipDeviceSetGraphMemAttribute.cc +++ b/catch/unit/graph/hipDeviceSetGraphMemAttribute.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ static void GraphSetGetAttribute(int device, hipGraphMemAttributeType attr, size * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDeviceSetGraphMemAttribute_Positive_Default") { +TEST_CASE(Unit_hipDeviceSetGraphMemAttribute_Positive_Default) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); const auto attr_type = GENERATE(hipGraphMemAttrUsedMemHigh, hipGraphMemAttrReservedMemHigh); @@ -74,7 +58,7 @@ TEST_CASE("Unit_hipDeviceSetGraphMemAttribute_Positive_Default") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDeviceSetGraphMemAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipDeviceSetGraphMemAttribute_Negative_Parameters) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); diff --git a/catch/unit/graph/hipDrvGraphAddMemFreeNode.cc b/catch/unit/graph/hipDrvGraphAddMemFreeNode.cc index 8eaa7c3f3..3d4803b1d 100644 --- a/catch/unit/graph/hipDrvGraphAddMemFreeNode.cc +++ b/catch/unit/graph/hipDrvGraphAddMemFreeNode.cc @@ -1,23 +1,9 @@ /* -Copyright (c) 2024 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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 #include @@ -46,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipDrvGraphAddMemFreeNode_Negative_Params") { +TEST_CASE(Unit_hipDrvGraphAddMemFreeNode_Negative_Params) { constexpr size_t N = 1024; hipGraph_t graph; hipGraphNode_t alloc_node, free_node; @@ -101,7 +87,7 @@ TEST_CASE("Unit_hipDrvGraphAddMemFreeNode_Negative_Params") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipDrvGraphAddMemFreeNode_Positive") { +TEST_CASE(Unit_hipDrvGraphAddMemFreeNode_Positive) { constexpr size_t N = 1024; hipGraph_t graph; hipGraphExec_t graphExec; diff --git a/catch/unit/graph/hipDrvGraphAddMemcpyNode.cc b/catch/unit/graph/hipDrvGraphAddMemcpyNode.cc index 9edabb544..f585290a3 100644 --- a/catch/unit/graph/hipDrvGraphAddMemcpyNode.cc +++ b/catch/unit/graph/hipDrvGraphAddMemcpyNode.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -64,7 +51,7 @@ THE SOFTWARE. * - HIP_VERSION >= 6.1 */ #if HT_AMD -TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_Negative") { +TEST_CASE(Unit_hipDrvGraphAddMemcpyNode_Negative) { CHECK_IMAGE_SUPPORT constexpr size_t size = 1024; @@ -347,7 +334,7 @@ static void hipDrvGraphAddMemcpyNode_test(int deviceid = 0) { * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_test") { +TEST_CASE(Unit_hipDrvGraphAddMemcpyNode_test) { CHECK_IMAGE_SUPPORT hipDrvGraphAddMemcpyNode_test(); @@ -368,7 +355,7 @@ TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_test") { * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_MulitDevice", "[multigpu]") { +TEST_CASE(Unit_hipDrvGraphAddMemcpyNode_MulitDevice) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -398,7 +385,7 @@ TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_MulitDevice", "[multigpu]") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_Positive_Basic") { +TEST_CASE(Unit_hipDrvGraphAddMemcpyNode_Positive_Basic) { using namespace std::placeholders; constexpr bool async = false; @@ -438,7 +425,7 @@ TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_Positive_Basic") { HIP_CHECK(hipCtxDestroy(context)); } -TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_Positive_Array") { +TEST_CASE(Unit_hipDrvGraphAddMemcpyNode_Positive_Array) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -493,7 +480,7 @@ TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_Positive_Array") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvGraphAddMemcpyNode_Negative_Parameters") { +TEST_CASE(Unit_hipDrvGraphAddMemcpyNode_Negative_Parameters) { using namespace std::placeholders; HIP_CHECK(hipInit(0)); diff --git a/catch/unit/graph/hipDrvGraphAddMemsetNode.cc b/catch/unit/graph/hipDrvGraphAddMemsetNode.cc index db53cfbd0..0f2fddb1d 100644 --- a/catch/unit/graph/hipDrvGraphAddMemsetNode.cc +++ b/catch/unit/graph/hipDrvGraphAddMemsetNode.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -56,7 +41,7 @@ static char memSetVal = 'a'; * ------------------------ * - HIP_VERSION >= 6.0 */ -TEMPLATE_TEST_CASE("Unit_hipDrvGraphAddMemsetNode_Positive_Basic", "", uint8_t, uint16_t, +TEMPLATE_TEST_CASE(Unit_hipDrvGraphAddMemsetNode_Positive_Basic, uint8_t, uint16_t, uint32_t) { CHECK_IMAGE_SUPPORT @@ -116,7 +101,7 @@ TEMPLATE_TEST_CASE("Unit_hipDrvGraphAddMemsetNode_Positive_Basic", "", uint8_t, * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvGraphAddMemsetNode_Negative_Parameters") { +TEST_CASE(Unit_hipDrvGraphAddMemsetNode_Negative_Parameters) { using namespace std::placeholders; HIP_CHECK(hipInit(0)); @@ -511,7 +496,7 @@ TEST_CASE("Unit_hipDrvGraphAddMemsetNode_hipMalloc3D_1D") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvGraphAddMemsetNode_hipMalloc_1D") { +TEST_CASE(Unit_hipDrvGraphAddMemsetNode_hipMalloc_1D) { HIP_CHECK(hipInit(0)); hipDevice_t device; hipCtx_t context; @@ -594,7 +579,7 @@ TEST_CASE("Unit_hipDrvGraphAddMemsetNode_hipMalloc_1D") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvGraphAddMemsetNode_hipMallocManaged") { +TEST_CASE(Unit_hipDrvGraphAddMemsetNode_hipMallocManaged) { HIP_CHECK(hipInit(0)); hipDevice_t device; hipCtx_t context; diff --git a/catch/unit/graph/hipDrvGraphExecMemcpyNodeSetParams.cc b/catch/unit/graph/hipDrvGraphExecMemcpyNodeSetParams.cc index 8304c8b55..46ca9c867 100644 --- a/catch/unit/graph/hipDrvGraphExecMemcpyNodeSetParams.cc +++ b/catch/unit/graph/hipDrvGraphExecMemcpyNodeSetParams.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -42,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipDrvGraphExecMemcpyNodeSetParams_Negative") { +TEST_CASE(Unit_hipDrvGraphExecMemcpyNodeSetParams_Negative) { size_t size = 10; size_t numW = size * sizeof(int); // Host Vectors @@ -120,7 +107,7 @@ TEST_CASE("Unit_hipDrvGraphExecMemcpyNodeSetParams_Negative") { * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipDrvGraphExecMemcpyNodeSetParams_Positive") { +TEST_CASE(Unit_hipDrvGraphExecMemcpyNodeSetParams_Positive) { size_t size = 10; size_t numW = size * sizeof(int); // Host Vectors diff --git a/catch/unit/graph/hipDrvGraphExecMemsetNodeSetParams.cc b/catch/unit/graph/hipDrvGraphExecMemsetNodeSetParams.cc index 2c827c90c..54d865da3 100644 --- a/catch/unit/graph/hipDrvGraphExecMemsetNodeSetParams.cc +++ b/catch/unit/graph/hipDrvGraphExecMemsetNodeSetParams.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -47,7 +34,7 @@ const int value = 120; * ------------------------ * - catch/unit/memory/hipDrvGraphExecMemsetNodeSetParams.cc */ -TEST_CASE("Unit_hipDrvGraphExecMemsetNodeSetParams_BasicPositive") { +TEST_CASE(Unit_hipDrvGraphExecMemsetNodeSetParams_BasicPositive) { CHECK_IMAGE_SUPPORT HIP_CHECK(hipInit(0)); @@ -156,7 +143,7 @@ TEST_CASE("Unit_hipDrvGraphExecMemsetNodeSetParams_BasicPositive") { * ------------------------ * - catch/unit/memory/hipDrvGraphExecMemsetNodeSetParams.cc */ -TEST_CASE("Unit_hipDrvGraphExecMemsetNodeSetParams_Negative") { +TEST_CASE(Unit_hipDrvGraphExecMemsetNodeSetParams_Negative) { CHECK_IMAGE_SUPPORT HIP_CHECK(hipInit(0)); diff --git a/catch/unit/graph/hipDrvGraphMemcpyNodeGetParams.cc b/catch/unit/graph/hipDrvGraphMemcpyNodeGetParams.cc index 77c9985a6..97414b347 100644 --- a/catch/unit/graph/hipDrvGraphMemcpyNodeGetParams.cc +++ b/catch/unit/graph/hipDrvGraphMemcpyNodeGetParams.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -50,7 +34,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvGraphMemcpyNodeGetParams_Negative_Parameters") { +TEST_CASE(Unit_hipDrvGraphMemcpyNodeGetParams_Negative_Parameters) { HIP_CHECK(hipInit(0)); hipDevice_t device; hipCtx_t context; @@ -105,7 +89,7 @@ TEST_CASE("Unit_hipDrvGraphMemcpyNodeGetParams_Negative_Parameters") { * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipDrvGraphMemcpyNodeGetParams_Positive") { +TEST_CASE(Unit_hipDrvGraphMemcpyNodeGetParams_Positive) { size_t size = 10; size_t numW = size * sizeof(int); // Host Vectors diff --git a/catch/unit/graph/hipDrvGraphMemcpyNodeSetParams.cc b/catch/unit/graph/hipDrvGraphMemcpyNodeSetParams.cc index 296b5bed6..3a83a9238 100644 --- a/catch/unit/graph/hipDrvGraphMemcpyNodeSetParams.cc +++ b/catch/unit/graph/hipDrvGraphMemcpyNodeSetParams.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -49,7 +33,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvGraphMemcpyNodeSetParams_Positive_Basic") { +TEST_CASE(Unit_hipDrvGraphMemcpyNodeSetParams_Positive_Basic) { using namespace std::placeholders; constexpr bool async = false; @@ -94,7 +78,7 @@ TEST_CASE("Unit_hipDrvGraphMemcpyNodeSetParams_Positive_Basic") { HIP_CHECK(hipCtxDestroy(context)); } -TEST_CASE("Unit_hipDrvGraphMemcpyNodeSetParams_Positive_Array") { +TEST_CASE(Unit_hipDrvGraphMemcpyNodeSetParams_Positive_Array) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -144,7 +128,7 @@ TEST_CASE("Unit_hipDrvGraphMemcpyNodeSetParams_Positive_Array") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvGraphMemcpyNodeSetParams_Negative_Parameters") { +TEST_CASE(Unit_hipDrvGraphMemcpyNodeSetParams_Negative_Parameters) { using namespace std::placeholders; HIP_CHECK(hipInit(0)); diff --git a/catch/unit/graph/hipGetProcAddressGraphApis.cc b/catch/unit/graph/hipGetProcAddressGraphApis.cc index c4de10b16..eb6d8acb2 100644 --- a/catch/unit/graph/hipGetProcAddressGraphApis.cc +++ b/catch/unit/graph/hipGetProcAddressGraphApis.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -37,7 +24,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_StreamCapture") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_StreamCapture) { void* hipStreamBeginCapture_ptr = nullptr; void* hipStreamIsCapturing_ptr = nullptr; void* hipStreamEndCapture_ptr = nullptr; @@ -161,7 +148,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_StreamCapture") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_AddMemcpy1DKernelNodes") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_AddMemcpy1DKernelNodes) { void* hipGraphAddMemcpyNode1D_ptr = nullptr; void* hipGraphAddKernelNode_ptr = nullptr; @@ -257,7 +244,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_AddMemcpy1DKernelNodes") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_AddMemsetMemcpyNodes") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_AddMemsetMemcpyNodes) { CHECK_IMAGE_SUPPORT void* hipGraphAddMemsetNode_ptr = nullptr; @@ -353,7 +340,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_AddMemsetMemcpyNodes") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_SetGetParamsMemsetMemcpy") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_SetGetParamsMemsetMemcpy) { CHECK_IMAGE_SUPPORT void* hipGraphMemsetNodeSetParams_ptr = nullptr; @@ -561,7 +548,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_SetGetParamsMemsetMemcpy") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_KernelNodeSetGetParams") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_KernelNodeSetGetParams) { void* hipGraphKernelNodeGetParams_ptr = nullptr; void* hipGraphKernelNodeSetParams_ptr = nullptr; @@ -703,7 +690,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_KernelNodeSetGetParams") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_KernelNodeSetGetAttribute") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_KernelNodeSetGetAttribute) { void* hipGraphKernelNodeSetAttribute_ptr = nullptr; void* hipGraphKernelNodeGetAttribute_ptr = nullptr; @@ -777,7 +764,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_KernelNodeSetGetAttribute") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_HostNode") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_HostNode) { void* hipGraphAddHostNode_ptr = nullptr; void* hipGraphHostNodeGetParams_ptr = nullptr; void* hipGraphHostNodeSetParams_ptr = nullptr; @@ -927,7 +914,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_HostNode") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_ExecUpdate") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_ExecUpdate) { void* hipGraphExecUpdate_ptr = nullptr; int currentHipVersion = 0; @@ -1001,7 +988,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_ExecUpdate") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_Memcpy1DSetParams") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_Memcpy1DSetParams) { void* hipGraphMemcpyNodeSetParams1D_ptr = nullptr; void* hipGraphExecMemcpyNodeSetParams1D_ptr = nullptr; @@ -1122,7 +1109,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_Memcpy1DSetParams") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_MemAllocAndFree") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_MemAllocAndFree) { void* hipGraphAddMemAllocNode_ptr = nullptr; void* hipGraphAddMemFreeNode_ptr = nullptr; void* hipGraphMemAllocNodeGetParams_ptr = nullptr; @@ -1270,7 +1257,7 @@ TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_MemAllocAndFree") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_GraphAPIs_ExecMemsetMemcpySetParams") { +TEST_CASE(Unit_hipGetProcAddress_GraphAPIs_ExecMemsetMemcpySetParams) { CHECK_IMAGE_SUPPORT void* hipGraphExecMemsetNodeSetParams_ptr = nullptr; diff --git a/catch/unit/graph/hipGraph.cc b/catch/unit/graph/hipGraph.cc index c540e0902..6eb6b947f 100644 --- a/catch/unit/graph/hipGraph.cc +++ b/catch/unit/graph/hipGraph.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -300,7 +287,7 @@ static void hipGraphsManual(float* inputVec_h, float* inputVec_d, double* output * Tests basic functionality of hipGraph APIs by * Execution Without HIPGraphs, Manual HIPGraph, HIPGraphs Using StreamCapture. */ -TEST_CASE("Unit_hipGraph_BasicFunctional") { +TEST_CASE(Unit_hipGraph_BasicFunctional) { constexpr size_t size = 1 << 12; constexpr size_t maxBlocks = 512; float *inputVec_d{nullptr}, *inputVec_h{nullptr}; diff --git a/catch/unit/graph/hipGraphAddBatchMemOpNode.cc b/catch/unit/graph/hipGraphAddBatchMemOpNode.cc index d133df1f8..10dde31b5 100644 --- a/catch/unit/graph/hipGraphAddBatchMemOpNode.cc +++ b/catch/unit/graph/hipGraphAddBatchMemOpNode.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include /** @@ -39,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphAddBatchMemOpNode_NegativeTsts") { +TEST_CASE(Unit_hipGraphAddBatchMemOpNode_NegativeTsts) { HIP_CHECK(hipInit(0)); hipGraph_t graph; hipCtx_t ctx; diff --git a/catch/unit/graph/hipGraphAddChildGraphNode.cc b/catch/unit/graph/hipGraphAddChildGraphNode.cc index b8662d4fc..df96a2214 100644 --- a/catch/unit/graph/hipGraphAddChildGraphNode.cc +++ b/catch/unit/graph/hipGraphAddChildGraphNode.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios of hipGraphAddChildGraphNode API: @@ -76,7 +63,7 @@ Testcase Scenarios of hipGraphAddChildGraphNode API: This testcase verifies the negative scenarios of hipGraphAddChildGraphNode API */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_Negative") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_Negative) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph, childgraph1; @@ -120,7 +107,7 @@ This testcase verifies the following scenario Creates the graph, add the graph as a child node and verify the number of the nodes in the original graph */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_OrgGraphAsChildGraph") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_OrgGraphAsChildGraph) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph, childGraph; @@ -163,7 +150,7 @@ This testcase verifies the following scenario Create graph, Add child nodes to the graph and execute only the child graph node and verify the behaviour */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_ExecuteChildGraph") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_ExecuteChildGraph) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph, childgraph1; @@ -214,7 +201,7 @@ This testcase verifies the following scenario creates graph, Add child nodes to graph, clone the graph and execute the cloned graph */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CloneChildGraph") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CloneChildGraph) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph, childgraph1, clonedgraph; @@ -266,7 +253,7 @@ This testcase verifies the following scenario Create graph, add multiple child nodes and validates the behaviour */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_MultipleChildNodes") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_MultipleChildNodes) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -329,7 +316,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_MultipleChildNodes") { This testcase verifies hipGraphAddChildGraphNode functionality where root node is the child node. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_SingleChildNode") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_SingleChildNode) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -720,7 +707,7 @@ typedef class nestedGraph { Parent graph containing child graph, which in turn, contains another child graph. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_Cmplx_NestedGraphs") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_Cmplx_NestedGraphs) { hipGraph_t* graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -743,7 +730,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_Cmplx_NestedGraphs") { Complex Scenario: This testcase verifies cloned nested graph functionality. Clone the nested graph and execute the clone graph. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxClone_NestedGraphs") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CmplxClone_NestedGraphs) { hipGraph_t *graph, clonedGraph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -767,7 +754,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxClone_NestedGraphs") { /** Scenario: Adding an empty graph to Child Graph Node. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_EmptyGraphAsChildNode") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_EmptyGraphAsChildNode) { hipGraph_t graph, graphChild; hipGraphNode_t child_node; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -782,7 +769,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_EmptyGraphAsChildNode") { when one of the child graph node is updated. In this test the kernel node function is updated to a different function. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_UpdKerFun") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CmplxNstGrph_UpdKerFun) { hipGraph_t* graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -806,7 +793,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_UpdKerFun") { function is updated to a different function and the nested graph is cloned. Execute the cloned graph and validate the results. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_UpdKerFun_Clone") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CmplxNstGrph_UpdKerFun_Clone) { hipGraph_t *graph, clonedGraph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -831,7 +818,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_UpdKerFun_Clone") { when one of the child graph node is updated. In this test the kernel node parameters - blocksize and gridsize are updated. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_UpdKerDim") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CmplxNstGrph_UpdKerDim) { hipGraph_t* graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -854,7 +841,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_UpdKerDim") { when one of the nodes inside a child graph node is deleted and replaced with a new node. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_DelAddNode") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CmplxNstGrph_DelAddNode) { hipGraph_t* graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -878,7 +865,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_DelAddNode") { replaced with a new node. After modifying the original graph it is cloned and the cloned graph is executed and validated. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_AddNode_Clone") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CmplxNstGrph_AddNode_Clone) { hipGraph_t *graph, clonedGraph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -903,7 +890,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_AddNode_Clone") { when one of the nodes inside a child graph node is deleted and replaced with a new child graph node. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_AddChdNode") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CmplxNstGrph_AddChdNode) { hipGraph_t* graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -926,7 +913,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_AddChdNode") { when one of the nodes inside a child graph node is deleted and replaced with a new child graph node. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_AddChdNode_Clone") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CmplxNstGrph_AddChdNode_Clone) { hipGraph_t *graph, clonedGraph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -962,7 +949,7 @@ static void validateResults(int* A1_h, int* A2_h, size_t N) { memcpy d2h nodes. Graph1, graph2 and graph3 are added as child nodes in graph4. Graph4 is validated for functionality. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_MultGraphsAsSingleGraph") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_MultGraphsAsSingleGraph) { size_t size = 1024; constexpr auto blocksPerCU = 6; constexpr auto threadsPerBlock = 256; @@ -1084,7 +1071,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_MultGraphsAsSingleGraph") { in multi GPU environment. Create one nested graph per GPU context. Execute all the created graphs in their respective GPUs and validate the output. */ -TEST_CASE("Unit_hipGraphAddChildGraphNode_CmplxNstGrph_MultGPU", "[multigpu]") { +TEST_CASE(Unit_hipGraphAddChildGraphNode_CmplxNstGrph_MultGPU) { int devcount = 0; HIP_CHECK(hipGetDeviceCount(&devcount)); // If only single GPU is detected then return diff --git a/catch/unit/graph/hipGraphAddDependencies.cc b/catch/unit/graph/hipGraphAddDependencies.cc index f2ce24cf2..11bcbbe53 100644 --- a/catch/unit/graph/hipGraphAddDependencies.cc +++ b/catch/unit/graph/hipGraphAddDependencies.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -45,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddDependencies_Positive_Functional") { +TEST_CASE(Unit_hipGraphAddDependencies_Positive_Functional) { constexpr size_t N = 1024; hipGraph_t graph; hipStream_t streamForGraph; @@ -110,7 +97,7 @@ TEST_CASE("Unit_hipGraphAddDependencies_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddDependencies_Positive_Parameters") { +TEST_CASE(Unit_hipGraphAddDependencies_Positive_Parameters) { constexpr size_t Nbytes = 1024; hipGraphNode_t memcpyH2D_A; hipGraphNode_t memcpyD2H_A; @@ -191,7 +178,7 @@ TEST_CASE("Unit_hipGraphAddDependencies_Positive_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddDependencies_Negative_Parameters") { +TEST_CASE(Unit_hipGraphAddDependencies_Negative_Parameters) { // Initialize constexpr size_t Nbytes = 1024; hipGraph_t graph; diff --git a/catch/unit/graph/hipGraphAddDependencies_old.cc b/catch/unit/graph/hipGraphAddDependencies_old.cc deleted file mode 100644 index 2ecb515f6..000000000 --- a/catch/unit/graph/hipGraphAddDependencies_old.cc +++ /dev/null @@ -1,226 +0,0 @@ -/* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/** -Testcase Scenarios : - 1) Add different kinds of nodes to graph and add dependencies to nodes. - Verify sequence of graph execution is based on dependencies created. - 2) Negative Scenarios -*/ - -#include -#include -#include - -/** - * Functional Test for adding dependencies in graph and verifying execution. - */ -TEST_CASE("Unit_hipGraphAddDependencies_Functional") { - constexpr size_t N = 1024; - constexpr size_t Nbytes = N * sizeof(int); - constexpr auto blocksPerCU = 6; // to hide latency - constexpr auto threadsPerBlock = 256; - hipGraph_t graph; - hipGraphNode_t memset_A, memset_B, memsetKer_C; - hipGraphNode_t memcpyH2D_A, memcpyH2D_B, memcpyD2H_C; - hipGraphNode_t kernel_vecAdd; - hipKernelNodeParams kernelNodeParams{}; - hipStream_t streamForGraph; - int *A_d, *B_d, *C_d; - int *A_h, *B_h, *C_h; - hipGraphExec_t graphExec; - hipMemsetParams memsetParams{}; - int memsetVal{}; - size_t NElem{N}; - - HIP_CHECK(hipStreamCreate(&streamForGraph)); - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); - - HIP_CHECK(hipGraphCreate(&graph, 0)); - - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(A_d); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(B_d); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memset_B, graph, nullptr, 0, &memsetParams)); - - void* kernelArgs1[] = {&C_d, &memsetVal, reinterpret_cast(&NElem)}; - kernelNodeParams.func = reinterpret_cast(HipTest::memsetReverse); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs1); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&memsetKer_C, graph, nullptr, 0, &kernelNodeParams)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_B, graph, nullptr, 0, B_d, B_h, Nbytes, - hipMemcpyHostToDevice)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyD2H_C, graph, nullptr, 0, C_h, C_d, Nbytes, - hipMemcpyDeviceToHost)); - - void* kernelArgs2[] = {&A_d, &B_d, &C_d, reinterpret_cast(&NElem)}; - kernelNodeParams.func = reinterpret_cast(HipTest::vectorADD); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs2); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernel_vecAdd, graph, nullptr, 0, &kernelNodeParams)); - - // Create dependencies - HIP_CHECK(hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memset_B, &memcpyH2D_B, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_A, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_B, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memsetKer_C, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &kernel_vecAdd, &memcpyD2H_C, 1)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Verify graph execution result - HipTest::checkVectorADD(A_h, B_h, C_h, N); - - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); -} - -/** - * Negative Tests for hipGraphAddDependencies. - */ -TEST_CASE("Unit_hipGraphAddDependencies_NegTest") { - // Initialize - constexpr size_t Nbytes = 1024; - hipGraph_t graph; - HIP_CHECK(hipGraphCreate(&graph, 0)); - char* A_d; - hipGraphNode_t memset_A; - hipMemsetParams memsetParams{}; - HIP_CHECK(hipMalloc(&A_d, Nbytes)); - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(A_d); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - hipGraphNode_t memcpyH2D_A; - char* A_h; - A_h = reinterpret_cast(malloc(Nbytes)); - - SECTION("Null Graph") { - // Create dependencies - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(nullptr, &memset_A, &memcpyH2D_A, 1)); - } - - SECTION("numDependencies is zero") { - REQUIRE(hipSuccess == hipGraphAddDependencies(graph, nullptr, nullptr, 0)); - } - - SECTION("One Null Graph Node") { - // Create dependencies - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(graph, &memset_A, nullptr, 1)); - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(graph, nullptr, &memset_A, 1)); - } - - SECTION("Both Null Graph Node") { - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(graph, nullptr, nullptr, 1)); - } - - // The following tests fail on AMD. - SECTION("from belongs different graph") { - hipGraph_t graph1; - HIP_CHECK(hipGraphCreate(&graph1, 0)); - // Create dependencies - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph1, nullptr, 0, &memsetParams)); - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); - HIP_CHECK(hipGraphDestroy(graph1)); - } - - SECTION("To belongs different graph") { - hipGraph_t graph1; - HIP_CHECK(hipGraphCreate(&graph1, 0)); - // Create dependencies - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph1, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); - HIP_CHECK(hipGraphDestroy(graph1)); - } - - SECTION("From is uninitialized") { - // Create dependencies - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); - } - - SECTION("To is uninitialized") { - // Create dependencies - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); - } - - SECTION("Duplicate Dependencies") { - // Create dependencies - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - HIP_CHECK(hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); - } - - SECTION("Same Node Dependencies") { - // Create dependencies - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - REQUIRE(hipErrorInvalidValue == hipGraphAddDependencies(graph, &memset_A, &memset_A, 1)); - } - - // Destroy - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipGraphDestroy(graph)); - free(A_h); -} \ No newline at end of file diff --git a/catch/unit/graph/hipGraphAddEmptyNode.cc b/catch/unit/graph/hipGraphAddEmptyNode.cc index 5572186da..9c5448638 100644 --- a/catch/unit/graph/hipGraphAddEmptyNode.cc +++ b/catch/unit/graph/hipGraphAddEmptyNode.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -36,7 +23,7 @@ Testcase Scenarios : /** * Functional Test to add empty node with dependencies */ -TEST_CASE("Unit_hipGraphAddEmptyNode_Functional") { +TEST_CASE(Unit_hipGraphAddEmptyNode_Functional) { char* pOutBuff_d{}; constexpr size_t size = 1024; hipGraph_t graph{}; @@ -66,7 +53,7 @@ TEST_CASE("Unit_hipGraphAddEmptyNode_Functional") { /** * Negative Scenarios hipGraphAddEmptyNode */ -TEST_CASE("Unit_hipGraphAddEmptyNode_NegTest") { +TEST_CASE(Unit_hipGraphAddEmptyNode_NegTest) { char* pOutBuff_d{}; constexpr size_t size = 1024; hipGraph_t graph; @@ -124,7 +111,7 @@ static void validateOutData(int* A1_h, int* A2_h, size_t N) { /** * Functional Test to use empty node as barrier to wait for multiple nodes. */ -TEST_CASE("Unit_hipGraphAddEmptyNode_BarrierFunc") { +TEST_CASE(Unit_hipGraphAddEmptyNode_BarrierFunc) { size_t size = 1024; constexpr auto blocksPerCU = 6; constexpr auto threadsPerBlock = 256; diff --git a/catch/unit/graph/hipGraphAddEventRecordNode.cc b/catch/unit/graph/hipGraphAddEventRecordNode.cc index 8ec372b21..8b37daa0d 100644 --- a/catch/unit/graph/hipGraphAddEventRecordNode.cc +++ b/catch/unit/graph/hipGraphAddEventRecordNode.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -64,7 +51,7 @@ Verify that hipEventElapsedTime() returns error. * Scenario 1: Create s simple graph with just one event record * node and instantiate and launch the graph. */ -TEST_CASE("Unit_hipGraphAddEventRecordNode_Functional_Simple") { +TEST_CASE(Unit_hipGraphAddEventRecordNode_Functional_Simple) { hipGraph_t graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -200,7 +187,7 @@ static void validateAddEventRecordNode(bool measureTime, bool withFlags, int nst /** * Scenario 2: Validate event record nodes created without flags. */ -TEST_CASE("Unit_hipGraphAddEventRecordNode_Functional_WithoutFlags") { +TEST_CASE(Unit_hipGraphAddEventRecordNode_Functional_WithoutFlags) { // Create events without flags using hipEventCreate and // elapsed time is not validated validateAddEventRecordNode(false, false, 1); @@ -209,7 +196,7 @@ TEST_CASE("Unit_hipGraphAddEventRecordNode_Functional_WithoutFlags") { /** * Scenario 3: Validate elapsed time between 2 recorded events. */ -TEST_CASE("Unit_hipGraphAddEventRecordNode_Functional_ElapsedTime") { +TEST_CASE(Unit_hipGraphAddEventRecordNode_Functional_ElapsedTime) { // Create events without flags using hipEventCreate and // elapsed time is validated validateAddEventRecordNode(true, false, 1); @@ -219,7 +206,7 @@ TEST_CASE("Unit_hipGraphAddEventRecordNode_Functional_ElapsedTime") { * Scenario 4: Validate event record nodes created with different * event flags. */ -TEST_CASE("Unit_hipGraphAddEventRecordNode_Functional_WithFlags") { +TEST_CASE(Unit_hipGraphAddEventRecordNode_Functional_WithFlags) { // Create events with different flags using hipEventCreate and // elapsed time is not validated SECTION("Flag = hipEventDefault") { validateAddEventRecordNode(false, true, 1, hipEventDefault); } @@ -237,14 +224,14 @@ TEST_CASE("Unit_hipGraphAddEventRecordNode_Functional_WithFlags") { * Scenario 5: Validate hipGraphAddEventRecordNode by executing graph * 100 times in a loop. */ -TEST_CASE("Unit_hipGraphAddEventRecordNode_MultipleRun") { +TEST_CASE(Unit_hipGraphAddEventRecordNode_MultipleRun) { validateAddEventRecordNode(false, false, 100); } /** * Scenario 6: Validate hipGraphAddEventRecordNode with time disabled events. */ -TEST_CASE("Unit_hipGraphAddEventRecordNode_Functional_TimingDisabled") { +TEST_CASE(Unit_hipGraphAddEventRecordNode_Functional_TimingDisabled) { constexpr size_t Nbytes = 1024; hipGraph_t graph; hipStream_t streamForGraph; @@ -297,7 +284,7 @@ TEST_CASE("Unit_hipGraphAddEventRecordNode_Functional_TimingDisabled") { /** * Scenario 7: Positive parameter tests */ -TEST_CASE("Unit_hipGraphAddEventRecordNode_Positive_Parameters") { +TEST_CASE(Unit_hipGraphAddEventRecordNode_Positive_Parameters) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event; @@ -336,7 +323,7 @@ TEST_CASE("Unit_hipGraphAddEventRecordNode_Positive_Parameters") { /** * Scenario 8: All negative tests */ -TEST_CASE("Unit_hipGraphAddEventRecordNode_Negative") { +TEST_CASE(Unit_hipGraphAddEventRecordNode_Negative) { using namespace std::placeholders; hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphAddEventWaitNode.cc b/catch/unit/graph/hipGraphAddEventWaitNode.cc index 89e7e03d7..a437f60fd 100644 --- a/catch/unit/graph/hipGraphAddEventWaitNode.cc +++ b/catch/unit/graph/hipGraphAddEventWaitNode.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -55,7 +42,7 @@ both graphs. /** * Scenario 1 */ -TEST_CASE("Unit_hipGraphAddEventWaitNode_Functional_Simple") { +TEST_CASE(Unit_hipGraphAddEventWaitNode_Functional_Simple) { hipGraph_t graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -216,28 +203,28 @@ static void validate_hipGraphAddEventWaitNode_internodedep(int test, int nstep, /** * Scenario 2 */ -TEST_CASE("Unit_hipGraphAddEventWaitNode_MultGraphMultStrmDependency") { +TEST_CASE(Unit_hipGraphAddEventWaitNode_MultGraphMultStrmDependency) { validate_hipGraphAddEventWaitNode_internodedep(0, 1); } /** * Scenario 3 */ -TEST_CASE("Unit_hipGraphAddEventWaitNode_MultipleRun") { +TEST_CASE(Unit_hipGraphAddEventWaitNode_MultipleRun) { validate_hipGraphAddEventWaitNode_internodedep(0, 100); } /** * Scenario 4 */ -TEST_CASE("Unit_hipGraphAddEventWaitNode_MultGraphOneStrmDependency") { +TEST_CASE(Unit_hipGraphAddEventWaitNode_MultGraphOneStrmDependency) { validate_hipGraphAddEventWaitNode_internodedep(1, 1); } /** * Scenario 5 */ -TEST_CASE("Unit_hipGraphAddEventWaitNode_differentFlags") { +TEST_CASE(Unit_hipGraphAddEventWaitNode_differentFlags) { SECTION("flag = hipEventBlockingSync") { validate_hipGraphAddEventWaitNode_internodedep(0, 1, hipEventBlockingSync); } @@ -249,7 +236,7 @@ TEST_CASE("Unit_hipGraphAddEventWaitNode_differentFlags") { /** * Scenario 6: Positive parameter tests */ -TEST_CASE("Unit_hipGraphAddEventWaitNode_Positive_Parameters") { +TEST_CASE(Unit_hipGraphAddEventWaitNode_Positive_Parameters) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event; @@ -288,7 +275,7 @@ TEST_CASE("Unit_hipGraphAddEventWaitNode_Positive_Parameters") { /** * Scenario 7 */ -TEST_CASE("Unit_hipGraphAddEventWaitNode_Negative") { +TEST_CASE(Unit_hipGraphAddEventWaitNode_Negative) { using namespace std::placeholders; hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphAddHostNode.cc b/catch/unit/graph/hipGraphAddHostNode.cc index a6d9bf4f5..47c3912e1 100644 --- a/catch/unit/graph/hipGraphAddHostNode.cc +++ b/catch/unit/graph/hipGraphAddHostNode.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Test Case Scenarios of hipGraphAddHostNode API: @@ -77,7 +62,7 @@ static void vectorsquare_callback(void* ptr) { This test case verifies the negative scenarios of hipGraphAddHostNode API */ -TEST_CASE("Unit_hipGraphAddHostNode_Negative") { +TEST_CASE(Unit_hipGraphAddHostNode_Negative) { constexpr size_t N = 1024; hipGraph_t graph; int *A_d{nullptr}, *C_d{nullptr}; @@ -127,7 +112,7 @@ This test case verifies hipGraphAddHostNode API in cloned graph Creates graph, Add graph nodes and clone the graph Add HostNode to the cloned graph and validate the result */ -TEST_CASE("Unit_hipGraphAddHostNode_ClonedGraphWithHostNode") { +TEST_CASE(Unit_hipGraphAddHostNode_ClonedGraphWithHostNode) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; @@ -190,7 +175,7 @@ This test case verifies the square of number by creating graph, Add kernel node which does the square of number and the result is validated by hipGraphAddHostNode API */ -TEST_CASE("Unit_hipGraphAddHostNode_VectorSquare") { +TEST_CASE(Unit_hipGraphAddHostNode_VectorSquare) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; @@ -248,7 +233,7 @@ Create graph, calls the host function and updates the parameters in the callback function and validates it. */ -TEST_CASE("Unit_hipGraphAddHostNode_BasicFunc") { +TEST_CASE(Unit_hipGraphAddHostNode_BasicFunc) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; diff --git a/catch/unit/graph/hipGraphAddKernelNode.cc b/catch/unit/graph/hipGraphAddKernelNode.cc index ebffb4493..c0392ff29 100644 --- a/catch/unit/graph/hipGraphAddKernelNode.cc +++ b/catch/unit/graph/hipGraphAddKernelNode.cc @@ -1,23 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -57,7 +43,7 @@ THE SOFTWARE. constexpr size_t size = 1 << 12; enum fnType { normal, object }; -TEST_CASE("Unit_hipGraphAddKernelNode_Negative") { +TEST_CASE(Unit_hipGraphAddKernelNode_Negative) { constexpr int N = 1024; size_t NElem{N}; constexpr auto blocksPerCU = 6; // to hide latency @@ -225,7 +211,7 @@ static void kernelFnChange(int* A_d, int* A_h, int* B_d, int* B_h, int* C_d, int * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipGraphAddKernelNode_moduleLoadKernelFn_graphNclonedGraph") { +TEST_CASE(Unit_hipGraphAddKernelNode_moduleLoadKernelFn_graphNclonedGraph) { int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, size, false); @@ -296,7 +282,7 @@ TEST_CASE("Unit_hipGraphAddKernelNode_moduleLoadKernelFn_graphNclonedGraph") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipGraphAddKernelNode_moduleLoadKernelFn_kernelFnUpdate") { +TEST_CASE(Unit_hipGraphAddKernelNode_moduleLoadKernelFn_kernelFnUpdate) { size_t maxBlocks = 512; int *A_d, *B_d, *C_d; // Device pointers int *A_h, *B_h, *C_h; // Host Pointers @@ -324,7 +310,7 @@ TEST_CASE("Unit_hipGraphAddKernelNode_moduleLoadKernelFn_kernelFnUpdate") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipGraphAddKernelNode_moduleLoadKernelFn_childGraph") { +TEST_CASE(Unit_hipGraphAddKernelNode_moduleLoadKernelFn_childGraph) { int *A_d, *B_d, *C_d; // Device pointers int *A_h, *B_h, *C_h; // Host Pointers HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, size, false); @@ -401,7 +387,7 @@ TEST_CASE("Unit_hipGraphAddKernelNode_moduleLoadKernelFn_childGraph") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipGraphAddKernelNode_moduleLoadKernelFn_streamCapture") { +TEST_CASE(Unit_hipGraphAddKernelNode_moduleLoadKernelFn_streamCapture) { size_t maxBlocks = 512; size_t Nbytes = sizeof(int) * maxBlocks; diff --git a/catch/unit/graph/hipGraphAddMemAllocNode.cc b/catch/unit/graph/hipGraphAddMemAllocNode.cc index 4d19bd075..778dcbb49 100644 --- a/catch/unit/graph/hipGraphAddMemAllocNode.cc +++ b/catch/unit/graph/hipGraphAddMemAllocNode.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -68,7 +52,7 @@ __global__ void validateGPU(int* const vec, const int value, size_t N, unsigned * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Negative_Params") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Negative_Params) { constexpr size_t N = 1024; hipGraph_t graph; hipGraphNode_t alloc_node; @@ -169,7 +153,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Negative_Params") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Negative_NotSupported") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Negative_NotSupported) { constexpr size_t N = 1024; hipGraph_t graph; hipGraphNode_t alloc_node; @@ -292,7 +276,7 @@ static void createFreeGraph(hipGraphExec_t* graph_exec, int* device_alloc) { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Positive_FreeInGraph") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Positive_FreeInGraph) { hipGraphExec_t graph_exec; LinearAllocGuard host_alloc = @@ -324,7 +308,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Positive_FreeInGraph") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Positive_FreeOutsideStream") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Positive_FreeOutsideStream) { hipGraphExec_t graph_exec; LinearAllocGuard host_alloc(LinearAllocs::malloc, element_count * sizeof(int)); @@ -370,7 +354,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Positive_FreeOutsideStream") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Positive_FreeOutsideGraph") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Positive_FreeOutsideGraph) { hipGraphExec_t graph_exec; LinearAllocGuard host_alloc(LinearAllocs::malloc, element_count * sizeof(int)); @@ -416,7 +400,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Positive_FreeOutsideGraph") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Positive_FreeSeparateGraph") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Positive_FreeSeparateGraph) { hipGraphExec_t graph_exec1, graph_exec2; LinearAllocGuard host_alloc(LinearAllocs::malloc, element_count * sizeof(int)); @@ -466,7 +450,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Positive_FreeSeparateGraph") { *  - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Functional_1") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Functional_1) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -576,7 +560,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Functional_1") { * ------------------------ *  - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Functional_2", "[multigpu]") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Functional_2) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -645,7 +629,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Functional_2", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Functional_3", "[multigpu]") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Functional_3) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -719,7 +703,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Functional_3", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Functional_4", "[multigpu]") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Functional_4) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -808,7 +792,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Functional_4", "[multigpu]") { * ------------------------ *  - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Argument_Check") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Argument_Check) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -1028,7 +1012,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Argument_Check") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Negative_Instanciate_Graph_Again") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Negative_Instanciate_Graph_Again) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -1090,7 +1074,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Negative_Instanciate_Graph_Again") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Negative_Free_Alloc_Memory_Again") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Negative_Free_Alloc_Memory_Again) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -1155,7 +1139,7 @@ TEST_CASE("Unit_hipGraphAddMemAllocNode_Negative_Free_Alloc_Memory_Again") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphAddMemAllocNode_Negative_With_Cloneed_Graph") { +TEST_CASE(Unit_hipGraphAddMemAllocNode_Negative_With_Cloneed_Graph) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { diff --git a/catch/unit/graph/hipGraphAddMemFreeNode.cc b/catch/unit/graph/hipGraphAddMemFreeNode.cc index fd1e3d6d8..20b9429f4 100644 --- a/catch/unit/graph/hipGraphAddMemFreeNode.cc +++ b/catch/unit/graph/hipGraphAddMemFreeNode.cc @@ -1,23 +1,9 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -50,7 +36,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddMemFreeNode_Negative_Params") { +TEST_CASE(Unit_hipGraphAddMemFreeNode_Negative_Params) { constexpr size_t N = 1024; hipGraph_t graph; hipGraphNode_t alloc_node, free_node; @@ -128,7 +114,7 @@ TEST_CASE("Unit_hipGraphAddMemFreeNode_Negative_Params") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddMemFreeNode_Negative_NotSupported") { +TEST_CASE(Unit_hipGraphAddMemFreeNode_Negative_NotSupported) { constexpr size_t N = 1024; hipGraph_t graph1, graph2; hipGraphNode_t alloc_node, free_node; @@ -201,7 +187,7 @@ TEST_CASE("Unit_hipGraphAddMemFreeNode_Negative_NotSupported") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphAddMemFreeNode_Functional") { +TEST_CASE(Unit_hipGraphAddMemFreeNode_Functional) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { diff --git a/catch/unit/graph/hipGraphAddMemcpyNode.cc b/catch/unit/graph/hipGraphAddMemcpyNode.cc index 8c72ba163..515ea8ad7 100644 --- a/catch/unit/graph/hipGraphAddMemcpyNode.cc +++ b/catch/unit/graph/hipGraphAddMemcpyNode.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -51,7 +35,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddMemcpyNode_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddMemcpyNode_Positive_Basic) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -105,10 +89,15 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode_Positive_Basic") { * - Verify API behaviour with invalid arguments: * -# node is nullptr * -# graph is nullptr + * -# pCopyParams is nullptr + * -# pDependencies is nullptr when numDependencies is zero * -# pDependencies is nullptr when numDependencies is not zero * -# A node in pDependencies originates from a different graph * -# numDependencies is invalid * -# A node is duplicated in pDependencies + * -# srcArray and srcPtr.ptr are both nullptr + * -# dstArray and dstPtr.ptr are both nullptr + * -# srcArray and dstArray use incompatible extents * -# dst is nullptr * -# src is nullptr * -# kind is an invalid enum value @@ -122,7 +111,7 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddMemcpyNode_Negative_Parameters") { +TEST_CASE(Unit_hipGraphAddMemcpyNode_Negative_Parameters) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -139,6 +128,14 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode_Negative_Parameters") { GraphAddNodeCommonNegativeTests(std::bind(hipGraphAddMemcpyNode, _1, _2, _3, _4, ¶ms), graph); + SECTION("pCopyParams == nullptr") { + HIP_CHECK_ERROR(hipGraphAddMemcpyNode(&node, graph, nullptr, 0, nullptr), hipErrorInvalidValue); + } + + SECTION("pDependencies == nullptr with numDependencies == 0") { + HIP_CHECK(hipGraphAddMemcpyNode(&node, graph, nullptr, 0, ¶ms)); + } + SECTION("dst_ptr.ptr == nullptr") { hipPitchedPtr invalid_ptr = dst_ptr; invalid_ptr.ptr = nullptr; @@ -288,6 +285,52 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode_Negative_Parameters") { NegativeTests(dst_alloc.pitched_ptr(), make_hipPos(0, 0, 0), src_alloc.pitched_ptr(), make_hipPos(0, 0, 0), extent, hipMemcpyDeviceToDevice); } + + SECTION("Array parameter combinations") { + constexpr size_t width = 10; + constexpr size_t height = 10; + constexpr size_t depth = 10; + const hipExtent array_extent = make_hipExtent(width, height, depth); + constexpr size_t host_size = width * height * depth * sizeof(int); + + ArrayAllocGuard src_array(array_extent); + ArrayAllocGuard dst_array(array_extent); + LinearAllocGuard host_alloc(LinearAllocs::malloc, host_size); + + hipGraph_t graph = nullptr; + HIP_CHECK(hipGraphCreate(&graph, 0)); + hipGraphNode_t node = nullptr; + + SECTION("srcArray and srcPtr.ptr are nullptr") { + hipMemcpy3DParms params = {}; + params.dstArray = dst_array.ptr(); + params.extent = array_extent; + params.kind = hipMemcpyHostToDevice; + + HIP_CHECK_ERROR(hipGraphAddMemcpyNode(&node, graph, nullptr, 0, ¶ms), hipErrorInvalidValue); + } + + SECTION("dstArray and dstPtr.ptr are nullptr") { + hipMemcpy3DParms params = {}; + params.srcPtr = make_hipPitchedPtr(host_alloc.ptr(), width * sizeof(int), width, height); + params.extent = array_extent; + params.kind = hipMemcpyHostToDevice; + + HIP_CHECK_ERROR(hipGraphAddMemcpyNode(&node, graph, nullptr, 0, ¶ms), hipErrorInvalidValue); + } + + SECTION("srcArray and dstArray use different extents") { + const hipExtent mismatched_extent = make_hipExtent(width + 1, height + 1, depth + 1); + ArrayAllocGuard mismatched_dst_array(mismatched_extent); + auto params = GetMemcpy3DParms(dst_array.ptr(), make_hipPos(0, 0, 0), src_array.ptr(), + make_hipPos(0, 0, 0), array_extent, hipMemcpyDeviceToDevice); + params.dstArray = mismatched_dst_array.ptr(); + + HIP_CHECK_ERROR(hipGraphAddMemcpyNode(&node, graph, nullptr, 0, ¶ms), hipErrorInvalidValue); + } + + HIP_CHECK(hipGraphDestroy(graph)); + } } /** diff --git a/catch/unit/graph/hipGraphAddMemcpyNode1D.cc b/catch/unit/graph/hipGraphAddMemcpyNode1D.cc index 0425c4661..5bc96daaa 100644 --- a/catch/unit/graph/hipGraphAddMemcpyNode1D.cc +++ b/catch/unit/graph/hipGraphAddMemcpyNode1D.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -50,7 +35,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddMemcpyNode1D_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddMemcpyNode1D_Positive_Basic) { constexpr auto f = [](void* dst, void* src, size_t count, hipMemcpyKind direction) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -142,7 +127,7 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode1D_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddMemcpyNode1D_Negative_Parameters") { +TEST_CASE(Unit_hipGraphAddMemcpyNode1D_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphAddMemcpyNode1D_old.cc b/catch/unit/graph/hipGraphAddMemcpyNode1D_old.cc index 1730f63eb..8f6779cbe 100644 --- a/catch/unit/graph/hipGraphAddMemcpyNode1D_old.cc +++ b/catch/unit/graph/hipGraphAddMemcpyNode1D_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2023 - 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -115,7 +102,7 @@ static void validateMemcpyNode1DArray(bool peerAccess, * For Peer device test: Memory allocations happen on device(0) and memcpy operations * are performed from device(1). */ -TEST_CASE("Unit_hipGraphAddMemcpyNode1D_Functional", "[multigpu]") { +TEST_CASE(Unit_hipGraphAddMemcpyNode1D_Functional) { SECTION("Memcpy with 1D array on default device") { validateMemcpyNode1DArray(false); } SECTION("Memcpy with 1D array using DeviceToDeviceNoCU") { validateMemcpyNode1DArray(false, hipMemcpyDeviceToDeviceNoCU); @@ -139,7 +126,7 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode1D_Functional", "[multigpu]") { /** * Negative Test for API hipGraphAddMemcpyNode1D */ -TEST_CASE("Unit_hipGraphAddMemcpyNode1D_Negative") { +TEST_CASE(Unit_hipGraphAddMemcpyNode1D_Negative) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); int *A_d, *A_h; @@ -205,7 +192,7 @@ TEST_CASE("Unit_hipGraphAddMemcpyNode1D_Negative") { * hipGraphAddMemcpyNode1D with data transfer kind hipMemcpyHostToHost. * Validate the output. */ -TEST_CASE("Unit_hipGraphAddMemcpyNode1D_HostToHost") { +TEST_CASE(Unit_hipGraphAddMemcpyNode1D_HostToHost) { constexpr size_t size = 1024; size_t numBytes{size * sizeof(int)}; diff --git a/catch/unit/graph/hipGraphAddMemcpyNodeFromSymbol.cc b/catch/unit/graph/hipGraphAddMemcpyNodeFromSymbol.cc index 8bef11529..8f7caba20 100644 --- a/catch/unit/graph/hipGraphAddMemcpyNodeFromSymbol.cc +++ b/catch/unit/graph/hipGraphAddMemcpyNodeFromSymbol.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -85,7 +70,7 @@ void GraphMemcpyFromSymbolShell(void* symbol, size_t offset, const std::vector= 5.2 */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeFromSymbol_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeFromSymbol_Positive_Basic) { SECTION("char") { HIP_GRAPH_ADD_MEMCPY_NODE_TO_FROM_SYMBOL_TEST(GraphMemcpyFromSymbolShell, 1, char); } @@ -127,7 +112,7 @@ TEST_CASE("Unit_hipGraphAddMemcpyNodeFromSymbol_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeFromSymbol_Negative_Parameters") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeFromSymbol_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphAddMemcpyNodeFromSymbol_old.cc b/catch/unit/graph/hipGraphAddMemcpyNodeFromSymbol_old.cc index 64caeb4f9..b237cfe07 100644 --- a/catch/unit/graph/hipGraphAddMemcpyNodeFromSymbol_old.cc +++ b/catch/unit/graph/hipGraphAddMemcpyNodeFromSymbol_old.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios of hipGraphAddMemcpyNodeFromSymbol API: @@ -69,7 +56,7 @@ __global__ void MemcpyFromSymbolKernel(int* B_d) { /* This testcase verifies negative scenarios of hipGraphAddMemcpyNodeFromSymbol API */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeFromSymbol_Negative") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeFromSymbol_Negative) { constexpr size_t Nbytes = SIZE * sizeof(int); int *A_d{nullptr}, *B_d{nullptr}; int *A_h{nullptr}, *B_h{nullptr}; @@ -235,7 +222,7 @@ This testcase verifies allocating global symbol memory, add the MemcpyNodeFromSymbol node to the graph and erifying the result */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalMemory") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalMemory) { hipGraphAddMemcpyNodeFromSymbol_GlobalMemory(false, false); } @@ -245,7 +232,7 @@ add the MemcpyNodeFromSymbol node to the graph and verifying the result */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalConstMemory") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalConstMemory) { hipGraphAddMemcpyNodeFromSymbol_GlobalMemory(false, true); } @@ -255,8 +242,7 @@ in GPU-0 and add the MemcpyNodeFromSymbol node to the graph and verifying the result in GPU-1 */ #if HT_NVIDIA -TEST_CASE("Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalMemoryPeerDevice", - "[multigpu]") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalMemoryPeerDevice) { int numDevices = 0; int canAccessPeer = 0; if (numDevices > 1) { @@ -277,8 +263,7 @@ in GPU-0 and add the MemcpyNodeFromSymbol node to the graph and verifying the result in GPU-1 */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalConstMemoryPeerDevice", - "[multigpu]") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalConstMemoryPeerDevice) { int numDevices = 0; int canAccessPeer = 0; if (numDevices > 1) { @@ -298,7 +283,7 @@ This testcaser verifies allocating global memory, Add MemcpyFromSymbolNode,KernelNode and memcpynode and validating the behaviour */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalMemoryWithKernel") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeFromSymbol_GlobalMemoryWithKernel) { constexpr size_t Nbytes = SIZE * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; diff --git a/catch/unit/graph/hipGraphAddMemcpyNodeToSymbol.cc b/catch/unit/graph/hipGraphAddMemcpyNodeToSymbol.cc index b8c8bde8c..5234e4bcb 100644 --- a/catch/unit/graph/hipGraphAddMemcpyNodeToSymbol.cc +++ b/catch/unit/graph/hipGraphAddMemcpyNodeToSymbol.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -88,7 +72,7 @@ void GraphMemcpyToSymbolShell(const void* symbol, size_t offset, const std::vect * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeToSymbol_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeToSymbol_Positive_Basic) { SECTION("char") { HIP_GRAPH_ADD_MEMCPY_NODE_TO_FROM_SYMBOL_TEST(GraphMemcpyToSymbolShell, 10, char); } @@ -130,7 +114,7 @@ TEST_CASE("Unit_hipGraphAddMemcpyNodeToSymbol_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeToSymbol_Negative_Parameters") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeToSymbol_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphAddMemcpyNodeToSymbol_old.cc b/catch/unit/graph/hipGraphAddMemcpyNodeToSymbol_old.cc index 582a93d80..69024a350 100644 --- a/catch/unit/graph/hipGraphAddMemcpyNodeToSymbol_old.cc +++ b/catch/unit/graph/hipGraphAddMemcpyNodeToSymbol_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios of hipGraphAddMemcpyNodeToSymbol API: @@ -62,7 +49,7 @@ __global__ void MemcpyToSymbolKernel(int* B_d) { /* This testcase verifies negative scenarios of hipGraphAddMemcpyNodeToSymbol API */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeToSymbol_Negative") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeToSymbol_Negative) { constexpr size_t Nbytes = SIZE * sizeof(int); int* A_d{nullptr}; int *A_h{nullptr}, *B_h{nullptr}; @@ -218,7 +205,7 @@ This testcase verifies allocating global symbol memory, add the MemcpyNodeToSymbol node to the graph and erifying the result */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeToSymbol_GlobalMemory") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeToSymbol_GlobalMemory) { hipGraphAddMemcpyNodeToSymbol_GlobalMemory(false, false); } @@ -227,7 +214,7 @@ This testcase verifies allocating global const symbol memory, add the MemcpyNodeToSymbol node to the graph and verifying the result */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeToSymbol_GlobalConstMemory") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeToSymbol_GlobalConstMemory) { hipGraphAddMemcpyNodeToSymbol_GlobalMemory(false, true); } @@ -237,7 +224,7 @@ This testcase verifies allocating global symbol memory and device variables in GPU-0 and add the MemcpyNodeToSymbol node to the graph and verifying the result in GPU-1 */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeToSymbol_GlobalMemoryPeerDevice") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeToSymbol_GlobalMemoryPeerDevice) { int numDevices = 0; int canAccessPeer = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -257,8 +244,7 @@ This testcase verifies allocating global const symbol memory and device variable in GPU-0 and add the MemcpyNodeToSymbol node to the graph and verifying the result in GPU-1 */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeToSymbol_GlobalConstMemoryPeerDevice", - "[multigpu]") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeToSymbol_GlobalConstMemoryPeerDevice) { int numDevices = 0; int canAccessPeer = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -279,8 +265,7 @@ This testcaser verifies allocating global memory, Add MemcpyToSymbolNode,KernelNode and memcpynode and validating the behaviour */ -TEST_CASE("Unit_hipGraphAddMemcpyNodeToSymbol_MemcpyToSymbolNodeWithKernel", - "[multigpu]") { +TEST_CASE(Unit_hipGraphAddMemcpyNodeToSymbol_MemcpyToSymbolNodeWithKernel) { constexpr size_t Nbytes = SIZE * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; diff --git a/catch/unit/graph/hipGraphAddMemcpyNode_old.cc b/catch/unit/graph/hipGraphAddMemcpyNode_old.cc deleted file mode 100644 index b04cff418..000000000 --- a/catch/unit/graph/hipGraphAddMemcpyNode_old.cc +++ /dev/null @@ -1,551 +0,0 @@ -/* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/** -Testcase Scenarios : Negative -1) Pass pGraphNode as nullptr and check if api returns error. -2) When graph is un-initialized argument(skipping graph creation), - api should return error code. -3) Passing pDependencies as nullptr, api should return success. -4) When numDependencies is max(size_t) and pDependencies is not valid ptr, - api expected to return error code. -5) When pDependencies is nullptr, but numDependencies is non-zero, - api expected to return error. -6) When pCopyParams is nullptr, api expected to return error code. -7) API expects atleast one memcpy src pointer to be set. - When hipMemcpy3DParms::srcArray and hipMemcpy3DParms::srcPtr.ptr both - are nullptr, api expected to return error code. -8) API expects atleast one memcpy dst pointer to be set. - When hipMemcpy3DParms::dstArray and hipMemcpy3DParms::dstPtr.ptr both - are nullptr, api expected to return error code. -9) Passing different element size for hipMemcpy3DParms::srcArray and - hipMemcpy3DParms::dstArray is expected to return error code. - -Testcase Scenarios : Functional -1) Add memcpy node to graph and verify memcpy operation is success for all - memcpy kinds(H2D, D2H and D2D). - Memcpy nodes are added and assigned to default device. -2) Perform memcpy operation for 1D, 2D and 3D arrays on default device and - verify the results. -3) Add memcpy node to graph and verify memcpy operation is success for all - memcpy kinds(H2D, D2H and D2D). - Memcpy nodes are added and assigned to Peer device. -4) Perform memcpy operation for 1D, 2D and 3D arrays on Peer device and - verify the results. -5) Create two host pointers, copy the data between them by the api - hipGraphAddMemcpyNode with data transfer kind hipMemcpyHostToHost. - Validate the output. -*/ - -#include -#include -#include -#include - -#define ZSIZE 32 -#define YSIZE 32 -#define XSIZE 32 - -/* Test verifies hipGraphAddMemcpyNode API Negative scenarios. - */ - -TEST_CASE("Unit_hipGraphAddMemcpyNode_Negative") { - CHECK_IMAGE_SUPPORT - - constexpr int width{10}, height{10}, depth{10}; - hipArray_t devArray1; - hipChannelFormatKind formatKind = hipChannelFormatKindSigned; - hipMemcpy3DParms myparams; - uint32_t size = width * height * depth * sizeof(int); - hipGraph_t graph; - hipGraphNode_t memcpyNode; - hipStream_t streamForGraph; - hipError_t ret; - - int* hData = reinterpret_cast(malloc(size)); - int* hOutputData = reinterpret_cast(malloc(size)); - - REQUIRE(hData != nullptr); - REQUIRE(hOutputData != nullptr); - memset(hData, 0, size); - memset(hOutputData, 0, size); - - HIP_CHECK(hipStreamCreate(&streamForGraph)); - HIP_CHECK(hipGraphCreate(&graph, 0)); - - // Initialize host buffer - for (int i = 0; i < depth; i++) { - for (int j = 0; j < height; j++) { - for (int k = 0; k < width; k++) { - hData[i * width * height + j * width + k] = i * width * height + j * width + k; - } - } - } - - hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(int) * 8, 0, 0, 0, formatKind); - HIP_CHECK(hipMalloc3DArray(&devArray1, &channelDesc, make_hipExtent(width, height, depth), - hipArrayDefault)); - - // Host to Device - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.extent = make_hipExtent(width, height, depth); - myparams.srcPtr = make_hipPitchedPtr(hData, width * sizeof(int), width, height); - myparams.dstArray = devArray1; - myparams.kind = hipMemcpyHostToDevice; - - SECTION("Pass pGraphNode as nullptr") { - ret = hipGraphAddMemcpyNode(nullptr, graph, nullptr, 0, &myparams); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("When graph is nullptr") { - ret = hipGraphAddMemcpyNode(&memcpyNode, nullptr, nullptr, 0, &myparams); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("Passing pDependencies as nullptr") { - ret = hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, &myparams); - REQUIRE(hipSuccess == ret); - } - SECTION("When numDependencies is max and pDependencies is not valid ptr") { - ret = hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, INT_MAX, &myparams); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("When pDependencies is nullptr, but numDependencies is non-zero") { - ret = hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 11, &myparams); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("Pass pCopyParams as nullptr") { - ret = hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, nullptr); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("API expects atleast one memcpy src pointer to be set") { - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.extent = make_hipExtent(width, height, depth); - myparams.dstArray = devArray1; - myparams.kind = hipMemcpyHostToDevice; - ret = hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, &myparams); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("API expects atleast one memcpy dst pointer to be set") { - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.extent = make_hipExtent(width, height, depth); - myparams.srcPtr = make_hipPitchedPtr(hData, width * sizeof(int), width, height); - myparams.kind = hipMemcpyHostToDevice; - ret = hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, &myparams); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION( - "Passing different element size for hipMemcpy3DParms::srcArray" - "and hipMemcpy3DParms::dstArray") { - myparams.srcArray = devArray1; - hipArray_t devArray2; - HIP_CHECK(hipMalloc3DArray(&devArray2, &channelDesc, - make_hipExtent(width + 1, height + 1, depth + 1), hipArrayDefault)); - myparams.dstArray = devArray2; - ret = hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, &myparams); - REQUIRE(hipErrorInvalidValue == ret); - HIP_CHECK(hipFreeArray(devArray2)); - } - - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); - HIP_CHECK(hipFreeArray(devArray1)); - free(hData); - free(hOutputData); -} - -static void validateMemcpyNode3DArray(bool peerAccess = false) { - constexpr int width{10}, height{10}, depth{10}; - hipArray_t devArray1, devArray2; - hipChannelFormatKind formatKind = hipChannelFormatKindSigned; - hipMemcpy3DParms myparams; - uint32_t size = width * height * depth * sizeof(int); - hipGraph_t graph; - hipGraphNode_t memcpyNode; - std::vector dependencies; - hipStream_t streamForGraph; - hipGraphExec_t graphExec; - - HIP_CHECK(hipSetDevice(0)); - int* hData = reinterpret_cast(malloc(size)); - int* hOutputData = reinterpret_cast(malloc(size)); - - REQUIRE(hData != nullptr); - REQUIRE(hOutputData != nullptr); - memset(hData, 0, size); - memset(hOutputData, 0, size); - - HIP_CHECK(hipStreamCreate(&streamForGraph)); - - // Initialize host buffer - for (int i = 0; i < depth; i++) { - for (int j = 0; j < height; j++) { - for (int k = 0; k < width; k++) { - hData[i * width * height + j * width + k] = i * width * height + j * width + k; - } - } - } - - hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(int) * 8, 0, 0, 0, formatKind); - HIP_CHECK(hipMalloc3DArray(&devArray1, &channelDesc, make_hipExtent(width, height, depth), - hipArrayDefault)); - HIP_CHECK(hipMalloc3DArray(&devArray2, &channelDesc, make_hipExtent(width, height, depth), - hipArrayDefault)); - HIP_CHECK(hipGraphCreate(&graph, 0)); - - // For peer access test, Memory is allocated on device(0) - // while memcpy nodes are allocated and assigned to peer device(1) - if (peerAccess) { - HIP_CHECK(hipSetDevice(1)); - } - - // Host to Device - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.extent = make_hipExtent(width, height, depth); - myparams.srcPtr = make_hipPitchedPtr(hData, width * sizeof(int), width, height); - myparams.dstArray = devArray1; - myparams.kind = hipMemcpyHostToDevice; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, &myparams)); - dependencies.push_back(memcpyNode); - - // Device to Device - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.srcArray = devArray1; - myparams.dstArray = devArray2; - myparams.extent = make_hipExtent(width, height, depth); - myparams.kind = hipMemcpyDeviceToDevice; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), dependencies.size(), - &myparams)); - dependencies.clear(); - dependencies.push_back(memcpyNode); - - // Device to host - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.dstPtr = make_hipPitchedPtr(hOutputData, width * sizeof(int), width, height); - myparams.srcArray = devArray2; - myparams.extent = make_hipExtent(width, height, depth); - myparams.kind = hipMemcpyDeviceToHost; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), dependencies.size(), - &myparams)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Check result - HipTest::checkArray(hData, hOutputData, width, height, depth); - - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); - HIP_CHECK(hipFreeArray(devArray1)); - HIP_CHECK(hipFreeArray(devArray2)); - free(hData); - free(hOutputData); -} - -static void validateMemcpyNode2DArray(bool peerAccess = false) { - int harray2D[YSIZE][XSIZE]{}; - int harray2Dres[YSIZE][XSIZE]{}; - constexpr int width{XSIZE}, height{YSIZE}; - hipArray_t devArray1, devArray2; - hipChannelFormatKind formatKind = hipChannelFormatKindSigned; - hipMemcpy3DParms myparams; - hipGraph_t graph; - hipGraphNode_t memcpyNode; - std::vector dependencies; - hipStream_t streamForGraph; - hipGraphExec_t graphExec; - - HIP_CHECK(hipSetDevice(0)); - HIP_CHECK(hipStreamCreate(&streamForGraph)); - // Initialize 2D object - for (int i = 0; i < YSIZE; i++) { - for (int j = 0; j < XSIZE; j++) { - harray2D[i][j] = i + j + 1; - } - } - - hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(int) * 8, 0, 0, 0, formatKind); - // Allocate 2D device array by passing depth(0) - HIP_CHECK(hipMalloc3DArray(&devArray1, &channelDesc, make_hipExtent(width, height, 0), - hipArrayDefault)); - HIP_CHECK(hipMalloc3DArray(&devArray2, &channelDesc, make_hipExtent(width, height, 0), - hipArrayDefault)); - HIP_CHECK(hipGraphCreate(&graph, 0)); - - // For peer access test, Memory is allocated on device(0) - // while memcpy nodes are allocated and assigned to peer device(1) - if (peerAccess) { - HIP_CHECK(hipSetDevice(1)); - } - - // Host to Device - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.extent = make_hipExtent(width, height, 1); - myparams.srcPtr = make_hipPitchedPtr(harray2D, width * sizeof(int), width, height); - myparams.dstArray = devArray1; - myparams.kind = hipMemcpyHostToDevice; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, &myparams)); - dependencies.push_back(memcpyNode); - - // Device to Device - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.srcArray = devArray1; - myparams.dstArray = devArray2; - myparams.extent = make_hipExtent(width, height, 1); - myparams.kind = hipMemcpyDeviceToDevice; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), dependencies.size(), - &myparams)); - dependencies.clear(); - dependencies.push_back(memcpyNode); - - // Device to host - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.extent = make_hipExtent(width, height, 1); - myparams.dstPtr = make_hipPitchedPtr(harray2Dres, width * sizeof(int), width, height); - myparams.srcArray = devArray2; - myparams.kind = hipMemcpyDeviceToHost; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), dependencies.size(), - &myparams)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Validate result - for (int i = 0; i < YSIZE; i++) { - for (int j = 0; j < XSIZE; j++) { - if (harray2D[i][j] != harray2Dres[i][j]) { - INFO("harray2D: " << harray2D[i][j] << "harray2Dres: " << harray2Dres[i][j] - << " mismatch at (i,j) : " << i << j); - REQUIRE(false); - } - } - } - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); - HIP_CHECK(hipFreeArray(devArray1)); - HIP_CHECK(hipFreeArray(devArray2)); -} - -static void validateMemcpyNode1DArray(bool peerAccess = false) { - int harray1D[XSIZE]{}; - int harray1Dres[XSIZE]{}; - constexpr int width{XSIZE}; - hipArray_t devArray1, devArray2; - hipChannelFormatKind formatKind = hipChannelFormatKindSigned; - hipMemcpy3DParms myparams; - hipGraph_t graph; - hipGraphNode_t memcpyNode; - std::vector dependencies; - hipStream_t streamForGraph; - hipGraphExec_t graphExec; - - HIP_CHECK(hipSetDevice(0)); - HIP_CHECK(hipStreamCreate(&streamForGraph)); - // Initialize 1D object - for (int i = 0; i < XSIZE; i++) { - harray1D[i] = i + 1; - } - - hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(int) * 8, 0, 0, 0, formatKind); - // Allocate 1D device array by passing depth(0), height(0) - HIP_CHECK( - hipMalloc3DArray(&devArray1, &channelDesc, make_hipExtent(width, 0, 0), hipArrayDefault)); - HIP_CHECK( - hipMalloc3DArray(&devArray2, &channelDesc, make_hipExtent(width, 0, 0), hipArrayDefault)); - HIP_CHECK(hipGraphCreate(&graph, 0)); - - // For peer access test, Memory is allocated on device(0) - // while memcpy nodes are allocated and assigned to peer device(1) - if (peerAccess) { - HIP_CHECK(hipSetDevice(1)); - } - - // Host to Device - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.extent = make_hipExtent(width, 1, 1); - myparams.srcPtr = make_hipPitchedPtr(harray1D, width * sizeof(int), width, 1); - myparams.dstArray = devArray1; - myparams.kind = hipMemcpyHostToDevice; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, nullptr, 0, &myparams)); - dependencies.push_back(memcpyNode); - - // Device to Device - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.srcArray = devArray1; - myparams.dstArray = devArray2; - myparams.extent = make_hipExtent(width, 1, 1); - myparams.kind = hipMemcpyDeviceToDevice; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), dependencies.size(), - &myparams)); - dependencies.clear(); - dependencies.push_back(memcpyNode); - - // Device to host - memset(&myparams, 0x0, sizeof(hipMemcpy3DParms)); - myparams.srcPos = make_hipPos(0, 0, 0); - myparams.dstPos = make_hipPos(0, 0, 0); - myparams.extent = make_hipExtent(width, 1, 1); - myparams.dstPtr = make_hipPitchedPtr(harray1Dres, width * sizeof(int), width, 1); - myparams.srcArray = devArray2; - myparams.kind = hipMemcpyDeviceToHost; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), dependencies.size(), - &myparams)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Validate result - for (int i = 0; i < XSIZE; i++) { - if (harray1D[i] != harray1Dres[i]) { - INFO("harray1D: " << harray1D[i] << " harray1Dres: " << harray1Dres[i] - << " mismatch at : " << i); - REQUIRE(false); - } - } - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); - HIP_CHECK(hipFreeArray(devArray1)); - HIP_CHECK(hipFreeArray(devArray2)); -} - -/** - * Basic Functional Tests adds memcpy nodes of types H2D, D2D and D2H to graph - * and verifies execution sequence by launching graph on default device. - * Tests also verify memcpy node addition with 1D, 2D and 3D objects. - */ -TEST_CASE("Unit_hipGraphAddMemcpyNode_BasicFunctional") { - CHECK_IMAGE_SUPPORT - - SECTION("Memcpy with 3D array on default device") { validateMemcpyNode3DArray(); } - - SECTION("Memcpy with 2D array on default device") { validateMemcpyNode2DArray(); } - - SECTION("Memcpy with 1D array on default device") { validateMemcpyNode1DArray(); } -} - -/** - * Peer access tests adds and assigns memcpy nodes of types H2D, D2D and D2H - * to peer device. Memory allocations happen on device(0) and memcpy operations - * are performed from device(1). - * Tests also verify memcpy node addition with 1D, 2D and 3D objects. - */ -TEST_CASE("Unit_hipGraphAddMemcpyNode_PeerAccessFunctional", "[multigpu]") { - CHECK_IMAGE_SUPPORT - - int numDevices{}, peerAccess{}; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - HIP_CHECK(hipDeviceCanAccessPeer(&peerAccess, 1, 0)); - } - - if (!peerAccess) { - WARN("Skipping test as peer device access is not found!"); - return; - } - - SECTION("Memcpy with 3D array on peer device") { validateMemcpyNode3DArray(true); } - - SECTION("Memcpy with 2D array on peer device") { validateMemcpyNode2DArray(true); } - - SECTION("Memcpy with 1D array on peer device") { validateMemcpyNode1DArray(true); } -} -/* - * Create two host pointers, copy the data between them by the api - * hipGraphAddMemcpyNode with data transfer kind hipMemcpyHostToHost. - * Validate the output. - */ -TEST_CASE("Unit_hipGraphAddMemcpyNode_HostToHost") { - constexpr size_t size = 1024; - size_t numW = size * sizeof(int); - // Host Vectors - std::vector A_h(numW); - std::vector B_h(numW); - // Initialization - std::iota(A_h.begin(), A_h.end(), 0); - std::fill_n(B_h.begin(), size, 0); - - hipGraph_t graph; - hipStream_t streamForGraph; - hipGraphExec_t graphExec; - hipGraphNode_t memcpyH2H; - HIP_CHECK(hipGraphCreate(&graph, 0)); - HIP_CHECK(hipStreamCreate(&streamForGraph)); - - hipMemcpy3DParms myparms{}; - myparms.srcPos = make_hipPos(0, 0, 0); - myparms.dstPos = make_hipPos(0, 0, 0); - myparms.srcPtr = make_hipPitchedPtr(A_h.data(), numW, numW, 1); - myparms.dstPtr = make_hipPitchedPtr(B_h.data(), numW, numW, 1); - myparms.extent = make_hipExtent(numW, 1, 1); - myparms.kind = hipMemcpyHostToHost; - - // Host to Host - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyH2H, graph, nullptr, 0, &myparms)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); - - // Validation - REQUIRE(memcmp(A_h.data(), B_h.data(), numW) == 0); -} diff --git a/catch/unit/graph/hipGraphAddMemsetNode.cc b/catch/unit/graph/hipGraphAddMemsetNode.cc index e600ed2c4..bc9f99d25 100644 --- a/catch/unit/graph/hipGraphAddMemsetNode.cc +++ b/catch/unit/graph/hipGraphAddMemsetNode.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -54,7 +39,7 @@ static char memSetVal = 'a'; * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_hipGraphAddMemsetNode_Positive_Basic", "", uint8_t, uint16_t, uint32_t) { +TEMPLATE_TEST_CASE(Unit_hipGraphAddMemsetNode_Positive_Basic, uint8_t, uint16_t, uint32_t) { CHECK_IMAGE_SUPPORT const auto f = [](hipMemsetParams* params) { @@ -104,7 +89,7 @@ TEMPLATE_TEST_CASE("Unit_hipGraphAddMemsetNode_Positive_Basic", "", uint8_t, uin * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphAddMemsetNode_Negative_Parameters") { +TEST_CASE(Unit_hipGraphAddMemsetNode_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -129,7 +114,7 @@ TEST_CASE("Unit_hipGraphAddMemsetNode_Negative_Parameters") { * using hipGraphAddMemsetNode. Copy the values in device memory to host using * hipGraphAddMemcpyNode. Verify the results. */ -TEST_CASE("Unit_hipGraphAddMemsetNode_hipMallocPitch_2D") { +TEST_CASE(Unit_hipGraphAddMemsetNode_hipMallocPitch_2D) { CHECK_IMAGE_SUPPORT size_t width = SIZE * sizeof(char), numW{SIZE}, numH{SIZE}, pitch_A; @@ -196,7 +181,7 @@ TEST_CASE("Unit_hipGraphAddMemsetNode_hipMallocPitch_2D") { * hipGraphAddMemsetNode. Copy the values in device memory to host using * hipGraphAddMemcpyNode. Verify the results. */ -TEST_CASE("Unit_hipGraphAddMemsetNode_hipMallocPitch_1D") { +TEST_CASE(Unit_hipGraphAddMemsetNode_hipMallocPitch_1D) { CHECK_IMAGE_SUPPORT size_t width = SIZE * sizeof(char), numW{SIZE}, pitch_A; @@ -257,7 +242,7 @@ TEST_CASE("Unit_hipGraphAddMemsetNode_hipMallocPitch_1D") { * hipGraphAddMemsetNode. Copy the values in device memory to host using * hipGraphAddMemcpyNode. Verify the results. */ -TEST_CASE("Unit_hipGraphAddMemsetNode_hipMalloc3D_2D") { +TEST_CASE(Unit_hipGraphAddMemsetNode_hipMalloc3D_2D) { CHECK_IMAGE_SUPPORT size_t width = SIZE * sizeof(char); @@ -334,7 +319,7 @@ TEST_CASE("Unit_hipGraphAddMemsetNode_hipMalloc3D_2D") { * memory using hipGraphAddMemsetNode. Copy the values in device * memory to host using hipGraphAddMemcpyNode. Verify the results. */ -TEST_CASE("Unit_hipGraphAddMemsetNode_hipMalloc3D_1D") { +TEST_CASE(Unit_hipGraphAddMemsetNode_hipMalloc3D_1D) { CHECK_IMAGE_SUPPORT size_t width = SIZE * sizeof(char); @@ -404,7 +389,7 @@ TEST_CASE("Unit_hipGraphAddMemsetNode_hipMalloc3D_1D") { * hipGraphAddMemsetNode. Copy the values in device memory to host using * hipGraphAddMemcpyNode. Verify the results. */ -TEST_CASE("Unit_hipGraphAddMemsetNode_hipMalloc_1D") { +TEST_CASE(Unit_hipGraphAddMemsetNode_hipMalloc_1D) { char* A_d; size_t NumW = SIZE; size_t Nbytes1D = SIZE * sizeof(char); @@ -463,7 +448,7 @@ TEST_CASE("Unit_hipGraphAddMemsetNode_hipMalloc_1D") { HIP_CHECK(hipFree(A_d)); } -TEST_CASE("Unit_hipGraphAddMemsetNode_hipMallocManaged") { +TEST_CASE(Unit_hipGraphAddMemsetNode_hipMallocManaged) { int managed = 0; HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, 0)); INFO("hipDeviceAttributeManagedMemory: " << managed); diff --git a/catch/unit/graph/hipGraphAddNode.cc b/catch/unit/graph/hipGraphAddNode.cc index a36689e2a..7f9141496 100644 --- a/catch/unit/graph/hipGraphAddNode.cc +++ b/catch/unit/graph/hipGraphAddNode.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -71,7 +56,7 @@ static void __global__ vector_square(int* A_d) { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEMPLATE_TEST_CASE("Unit_hipGraphAddNodeTypeMemset_Positive_Basic", "", uint8_t, uint16_t, +TEMPLATE_TEST_CASE(Unit_hipGraphAddNodeTypeMemset_Positive_Basic, uint8_t, uint16_t, uint32_t) { const auto f = [](hipMemsetParams* params) { hipGraph_t graph = nullptr; @@ -115,7 +100,7 @@ TEMPLATE_TEST_CASE("Unit_hipGraphAddNodeTypeMemset_Positive_Basic", "", uint8_t, * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddNodeTypeKernel_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddNodeTypeKernel_Positive_Basic) { constexpr size_t allocation_size = N * sizeof(int); hipGraph_t graph; hipGraphExec_t graphExec; @@ -182,7 +167,7 @@ TEST_CASE("Unit_hipGraphAddNodeTypeKernel_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddNodeTypeHost_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddNodeTypeHost_Positive_Basic) { constexpr size_t allocation_size = N * sizeof(int); hipGraph_t graph; hipGraphExec_t graphExec; @@ -230,7 +215,7 @@ TEST_CASE("Unit_hipGraphAddNodeTypeHost_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddNodeTypeChildGraph_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddNodeTypeChildGraph_Positive_Basic) { constexpr size_t allocation_size = N * sizeof(int); hipGraph_t graph, childgraph; hipGraphExec_t graphExec; @@ -325,7 +310,7 @@ static hipError_t MemcpyType3DWrapper(PtrVariant dst_ptr, hipPos dst_pos, PtrVar * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddNodeTypeMemcpy_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddNodeTypeMemcpy_Positive_Basic) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -384,7 +369,7 @@ TEST_CASE("Unit_hipGraphAddNodeTypeMemcpy_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddNodeTypeEventRecord_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddNodeTypeEventRecord_Positive_Basic) { hipGraph_t graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -422,7 +407,7 @@ TEST_CASE("Unit_hipGraphAddNodeTypeEventRecord_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddNodeTypeEventWait_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddNodeTypeEventWait_Positive_Basic) { hipGraph_t graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -468,7 +453,7 @@ TEST_CASE("Unit_hipGraphAddNodeTypeEventWait_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddNodeTypeMemAlloc_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddNodeTypeMemAlloc_Positive_Basic) { constexpr size_t allocation_size = N * sizeof(int); hipGraph_t graph; hipStream_t streamForGraph; @@ -525,7 +510,7 @@ TEST_CASE("Unit_hipGraphAddNodeTypeMemAlloc_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddNode_Negative_Parameters") { +TEST_CASE(Unit_hipGraphAddNode_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphAddNodeBeginCapture.cc b/catch/unit/graph/hipGraphAddNodeBeginCapture.cc index 461c80645..fb04f3999 100644 --- a/catch/unit/graph/hipGraphAddNodeBeginCapture.cc +++ b/catch/unit/graph/hipGraphAddNodeBeginCapture.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -84,7 +71,7 @@ static void CpuCallback(void* args) { *  - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamBeginCapture_with_hipGraphAddHostNode") { +TEST_CASE(Unit_hipStreamBeginCapture_with_hipGraphAddHostNode) { hipGraph_t graph; hipGraphExec_t graphExec; hipGraphNode_t cpuGraphNode; @@ -141,7 +128,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_with_hipGraphAddHostNode") { *  - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamEndCapture_later_and_add_a_node_inbetween") { +TEST_CASE(Unit_hipStreamEndCapture_later_and_add_a_node_inbetween) { hipGraphExec_t graphExec; hipGraphNode_t memcpyD2H_C; hipStream_t stream; @@ -487,7 +474,7 @@ TEST_CASE("Unit_hipStreamEndCapture_later_and_add_a_node_inbetween") { *  - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamEndCapture_first_and_add_a_node_later") { +TEST_CASE(Unit_hipStreamEndCapture_first_and_add_a_node_later) { hipGraph_t graph; hipGraphExec_t graphExec; hipGraphNode_t memcpyD2H_C; @@ -785,7 +772,7 @@ TEST_CASE("Unit_hipStreamEndCapture_first_and_add_a_node_later") { *  - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamEndCapture_first_and_add_other_graph_node_later") { +TEST_CASE(Unit_hipStreamEndCapture_first_and_add_other_graph_node_later) { hipGraph_t graph; hipGraphExec_t graphExec; hipGraphNode_t memcpyH2D_A, memcpyH2D_B, memcpyD2H_AC, memcpyH2D_C; @@ -853,7 +840,7 @@ TEST_CASE("Unit_hipStreamEndCapture_first_and_add_other_graph_node_later") { *  - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamEndCapture_later_and_addEmptyNode") { +TEST_CASE(Unit_hipStreamEndCapture_later_and_addEmptyNode) { hipGraphExec_t graphExec; hipGraphNode_t memcpyD2H_C; hipStream_t stream; diff --git a/catch/unit/graph/hipGraphAsyncUserObj.cc b/catch/unit/graph/hipGraphAsyncUserObj.cc index b110a6e86..f86ba44f4 100644 --- a/catch/unit/graph/hipGraphAsyncUserObj.cc +++ b/catch/unit/graph/hipGraphAsyncUserObj.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024-2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -114,7 +102,7 @@ void hipUserObjectCreate_int_float_Objects(T* hostArr, T* devArr, void destroyOb * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipGraphUserObj_Int_float_Objects") { +TEST_CASE(Unit_hipGraphUserObj_Int_float_Objects) { SECTION("Called with Int Obj") { std::thread t1(threadFunc_dltMemory); int* hostArr = nullptr; @@ -162,7 +150,7 @@ void destroyHostRegObj(void* ptr) { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipGraphUserObj_HostRegister") { +TEST_CASE(Unit_hipGraphUserObj_HostRegister) { int clockrate = 0; HIP_CHECK(hipDeviceGetAttribute(&clockrate, hipDeviceAttributeMemoryClockRate, 0)); int* A_h = new int(); @@ -249,7 +237,7 @@ template void hipUserObjectCreate_Struct_Class_Objects(T* Obj_h, T* * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipGraphUserObj_Struct_Class_Ojects") { +TEST_CASE(Unit_hipGraphUserObj_Struct_Class_Ojects) { SECTION("Called with Struct Object") { std::thread t1(threadFunc_dltMemory); BoxStruct* structObj_h; @@ -291,7 +279,7 @@ TEST_CASE("Unit_hipGraphUserObj_Struct_Class_Ojects") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipGraphUserObj_ClonedGraph") { +TEST_CASE(Unit_hipGraphUserObj_ClonedGraph) { int clockrate = 0; HIP_CHECK(hipDeviceGetAttribute(&clockrate, hipDeviceAttributeMemoryClockRate, 0)); std::thread t1(threadFunc_dltMemory); @@ -362,7 +350,7 @@ __global__ void ManualGraphKernelFn(int* Ad, int clockrate, int WaitSecs) { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipGraphUserObj_ManualGraph") { +TEST_CASE(Unit_hipGraphUserObj_ManualGraph) { int clockrate = 0; HIP_CHECK(hipDeviceGetAttribute(&clockrate, hipDeviceAttributeMemoryClockRate, 0)); std::thread t1(threadFunc_dltMemory); diff --git a/catch/unit/graph/hipGraphBatchMemOpNodeSetParams.cc b/catch/unit/graph/hipGraphBatchMemOpNodeSetParams.cc index 3a92767fe..e782e287b 100644 --- a/catch/unit/graph/hipGraphBatchMemOpNodeSetParams.cc +++ b/catch/unit/graph/hipGraphBatchMemOpNodeSetParams.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include /** @@ -38,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphBatchMemOpNodeSetParams_NegativeTsts") { +TEST_CASE(Unit_hipGraphBatchMemOpNodeSetParams_NegativeTsts) { HIP_CHECK(hipInit(0)); hipGraph_t graph; hipCtx_t ctx; @@ -129,7 +117,7 @@ TEST_CASE("Unit_hipGraphBatchMemOpNodeSetParams_NegativeTsts") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphBatchMemOpNodeGetParams_NegativeTsts") { +TEST_CASE(Unit_hipGraphBatchMemOpNodeGetParams_NegativeTsts) { hipBatchMemOpNodeParams retrievedNodeParams; HIP_CHECK_ERROR(hipGraphBatchMemOpNodeGetParams(nullptr, &retrievedNodeParams), hipErrorInvalidValue); diff --git a/catch/unit/graph/hipGraphChildGraphNodeGetGraph.cc b/catch/unit/graph/hipGraphChildGraphNodeGetGraph.cc index 72444b626..a62aeaf9b 100644 --- a/catch/unit/graph/hipGraphChildGraphNodeGetGraph.cc +++ b/catch/unit/graph/hipGraphChildGraphNodeGetGraph.cc @@ -1,20 +1,8 @@ -/*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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios of hipGraphChildGraphNodeGetGraph API: @@ -39,7 +27,7 @@ Create graph, add multiple child nodes and gets the graph of one of the child nodes using hipGraphChildGraphNodeGetGraph API executes it and validates the results */ -TEST_CASE("Unit_hipGraphChildGraphNodeGetGraph_Functional") { +TEST_CASE(Unit_hipGraphChildGraphNodeGetGraph_Functional) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -109,7 +97,7 @@ TEST_CASE("Unit_hipGraphChildGraphNodeGetGraph_Functional") { This testcase verifies the negative scenarios of hipGraphChildGraphNodeGetGraph API */ -TEST_CASE("Unit_hipGraphChildGraphNodeGetGraph_Negative") { +TEST_CASE(Unit_hipGraphChildGraphNodeGetGraph_Negative) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph, childgraph1; diff --git a/catch/unit/graph/hipGraphClone.cc b/catch/unit/graph/hipGraphClone.cc index 4b37f4a64..5999c4483 100644 --- a/catch/unit/graph/hipGraphClone.cc +++ b/catch/unit/graph/hipGraphClone.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Testcase Scenarios of hipGraphClone API: @@ -43,7 +30,7 @@ Testcase Scenarios of hipGraphClone API: /* This test covers the negative scenarios of hipGraphClone API */ -TEST_CASE("Unit_hipGraphClone_Negative") { +TEST_CASE(Unit_hipGraphClone_Negative) { SECTION("Passing nullptr to Cloned graph") { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -229,7 +216,7 @@ This testcase verifies following scenarios validate the result of the cloned graph 3. Device context change for cloned graph */ -TEST_CASE("Unit_hipGraphClone_Functional", "[multigpu]") { +TEST_CASE(Unit_hipGraphClone_Functional) { SECTION("hipGraphClone Basic Functionality") { hipGraphClone_Func(); } SECTION("hipGraphClone Modify Original graph") { hipGraphClone_Func(true); } @@ -258,7 +245,7 @@ hipGraphClone is failing in CUDA in multi threaded scenario so excluded for nvidia */ #if HT_AMD -TEST_CASE("Unit_hipGraphClone_MultiThreaded") { +TEST_CASE(Unit_hipGraphClone_MultiThreaded) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; diff --git a/catch/unit/graph/hipGraphCloneComplx.cc b/catch/unit/graph/hipGraphCloneComplx.cc index 56bc65d08..0970c1f47 100644 --- a/catch/unit/graph/hipGraphCloneComplx.cc +++ b/catch/unit/graph/hipGraphCloneComplx.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -229,7 +216,7 @@ static void hipGraphClone_Test_hipGraphKernelNodeSetParams() { HIP_CHECK(hipGraphDestroy(clonedGraph)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphKernelNodeSetParams") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphKernelNodeSetParams) { hipGraphClone_Test_hipGraphKernelNodeSetParams(); } @@ -276,7 +263,7 @@ static void hipGraphClone_Test_hipGraphExecKernelNodeSetParams() { HIP_CHECK(hipGraphDestroy(clonedGraph)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphExecKernelNodeSetParams") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphExecKernelNodeSetParams) { hipGraphClone_Test_hipGraphExecKernelNodeSetParams(); } @@ -339,7 +326,7 @@ static void hipGraphClone_Test_hipGraphAddMemcpy_and_memset() { HIP_CHECK(hipGraphDestroy(clonedGraph)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphAddMemcpy_and_memset") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphAddMemcpy_and_memset) { hipGraphClone_Test_hipGraphAddMemcpy_and_memset(); } @@ -449,7 +436,7 @@ static void hipGraphClone_Test_hipGraphMemcpyNodeSetParams() { HipTest::freeArrays(nullptr, nullptr, nullptr, hData, hDataTemp, hOutputData, false); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphMemcpyNodeSetParams") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphMemcpyNodeSetParams) { CHECK_IMAGE_SUPPORT hipGraphClone_Test_hipGraphMemcpyNodeSetParams(); @@ -564,7 +551,7 @@ static void hipGraphClone_Test_hipGraphExecMemcpyNodeSetParams() { HIP_CHECK(hipFreeArray(devArray3)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphExecMemcpyNodeSetParams") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphExecMemcpyNodeSetParams) { CHECK_IMAGE_SUPPORT hipGraphClone_Test_hipGraphExecMemcpyNodeSetParams(); @@ -645,7 +632,7 @@ static void hipGraphClone_Test_hipGraphMemcpyNodeSetParams1D_and_exec() { HIP_CHECK(hipGraphDestroy(clonedGraph_2)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphMemcpyNodeSetParams1D_and_exec") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphMemcpyNodeSetParams1D_and_exec) { hipGraphClone_Test_hipGraphMemcpyNodeSetParams1D_and_exec(); } @@ -739,7 +726,7 @@ static void hipGraphClone_hipGraphMemcpyNodeSetParamsFromSymbol_exec() { HIP_CHECK(hipGraphDestroy(clonedGraph_2)); } -TEST_CASE("Unit_hipGraphClone_hipGraphMemcpyNodeSetParamsFromSymbol_exec") { +TEST_CASE(Unit_hipGraphClone_hipGraphMemcpyNodeSetParamsFromSymbol_exec) { hipGraphClone_hipGraphMemcpyNodeSetParamsFromSymbol_exec(); } @@ -832,7 +819,7 @@ static void hipGraphClone_hipGraphMemcpyNodeSetParamsToSymbol_exec() { HIP_CHECK(hipGraphDestroy(clonedGraph_2)); } -TEST_CASE("Unit_hipGraphClone_hipGraphMemcpyNodeSetParamsToSymbol_exec") { +TEST_CASE(Unit_hipGraphClone_hipGraphMemcpyNodeSetParamsToSymbol_exec) { hipGraphClone_hipGraphMemcpyNodeSetParamsToSymbol_exec(); } @@ -944,7 +931,7 @@ static void hipGraphClone_Test_hipGraphMemsetNodeSetParams_exec() { HIP_CHECK(hipGraphDestroy(clonedGraph_2)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphMemsetNodeSetParams_exec") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphMemsetNodeSetParams_exec) { hipGraphClone_Test_hipGraphMemsetNodeSetParams_exec(); } @@ -1013,7 +1000,7 @@ static void hipGraphClone_Test_hipGraphRemoveDependencies() { HIP_CHECK(hipGraphDestroy(clonedGraph)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphRemoveDependencies") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphRemoveDependencies) { hipGraphClone_Test_hipGraphRemoveDependencies(); } #endif @@ -1112,7 +1099,7 @@ static void hipGraphClone_Test_hipGraphExecChildGraphNodeSetParams() { HIP_CHECK(hipGraphDestroy(childgraph2)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphExecChildGraphNodeSetParams") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphExecChildGraphNodeSetParams) { hipGraphClone_Test_hipGraphExecChildGraphNodeSetParams(); } @@ -1306,7 +1293,7 @@ static void hipGraphClone_Test_hipGraphEventRecordNodeSetEvent_and_Exec() { HIP_CHECK(hipEventDestroy(event_end)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphEventRecordNodeSetEvent_and_Exec") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphEventRecordNodeSetEvent_and_Exec) { hipGraphClone_Test_hipGraphEventRecordNodeSetEvent_and_Exec(); } @@ -1480,7 +1467,7 @@ static void hipGraphClone_Test_hipGraphEventWaitNodeSetEvent_and_Exec() { HIP_CHECK(hipEventDestroy(event_1)); } -TEST_CASE("Unit_hipGraphClone_Test_hipGraphEventWaitNodeSetEvent_and_Exec") { +TEST_CASE(Unit_hipGraphClone_Test_hipGraphEventWaitNodeSetEvent_and_Exec) { hipGraphClone_Test_hipGraphEventWaitNodeSetEvent_and_Exec(); } @@ -1490,7 +1477,7 @@ TEST_CASE("Unit_hipGraphClone_Test_hipGraphEventWaitNodeSetEvent_and_Exec") { Execute both original graph and cloned graph in loop: with multiple device. Loop: Update input data -> Launch Graph -> Validate output data -> Goto Loop */ -TEST_CASE("Unit_hipGraphClone_address_change_in_loop", "[multigpu]") { +TEST_CASE(Unit_hipGraphClone_address_change_in_loop) { constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; @@ -1644,7 +1631,7 @@ static void hipGraphClone_address_change_in_thread(hipGraph_t* graph, hipGraphNo memory addresses in each Node and create executable graphs. Launch the graphs in their respective GPUs. Validate the outputs. */ -TEST_CASE("Unit_hipGraphClone_address_change_in_thread", "[multigpu]") { +TEST_CASE(Unit_hipGraphClone_address_change_in_thread) { constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; @@ -1735,7 +1722,7 @@ static void hipGraphClone_Test_All_API(int dev) { Create a graph with Memcpy and Kernel nodes. and its cloned graph. Run all the above writen test cases for multiple GPU scenarios */ -TEST_CASE("Unit_hipGraphClone_multi_GPU_test", "[multigpu]") { +TEST_CASE(Unit_hipGraphClone_multi_GPU_test) { // FIXME: This test tests 3D as well, decouple it CHECK_IMAGE_SUPPORT @@ -1768,7 +1755,7 @@ static void destroyFloatObj(void* ptr) { Launch the graphs. Validate the outputs. Release the reference by calling hipGraphReleaseUserObject with count. */ -TEST_CASE("Unit_hipGraphClone_hipUserObject_hipGraphUserObject") { +TEST_CASE(Unit_hipGraphClone_hipUserObject_hipGraphUserObject) { ComplexGrph cg; // This will create skeleton of Graph and ClonedGraph int* object_i = new int(); @@ -1805,7 +1792,7 @@ TEST_CASE("Unit_hipGraphClone_hipUserObject_hipGraphUserObject") { (Negative - Check this should give error and reference was created for Oroginal graph and releasing it for other graph)*/ -TEST_CASE("Unit_hipGraphClone_hipUserObject_hipGraphUserObject_Negative") { +TEST_CASE(Unit_hipGraphClone_hipUserObject_hipGraphUserObject_Negative) { ComplexGrph cg; // This will create skeleton of Graph and ClonedGraph int* object_i = new int(); @@ -1847,7 +1834,7 @@ TEST_CASE("Unit_hipGraphClone_hipUserObject_hipGraphUserObject_Negative") { (Negative - Check this should give error and reference was created for Oroginal graph and releasing it for other graph) */ -TEST_CASE("Unit_hipGraphChild_hipUserObject_hipGraphUserObject") { +TEST_CASE(Unit_hipGraphChild_hipUserObject_hipGraphUserObject) { constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; diff --git a/catch/unit/graph/hipGraphCreate.cc b/catch/unit/graph/hipGraphCreate.cc index 992954847..9c3280e98 100644 --- a/catch/unit/graph/hipGraphCreate.cc +++ b/catch/unit/graph/hipGraphCreate.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -40,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphCreate_Negative_Parameters") { +TEST_CASE(Unit_hipGraphCreate_Negative_Parameters) { hipGraph_t graph = nullptr; SECTION("pGraph is nullptr") { @@ -62,7 +49,7 @@ TEST_CASE("Unit_hipGraphCreate_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphCreate_Positive_Basic") { +TEST_CASE(Unit_hipGraphCreate_Positive_Basic) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphCycle.cc b/catch/unit/graph/hipGraphCycle.cc index f11ea8c43..3e890331d 100644 --- a/catch/unit/graph/hipGraphCycle.cc +++ b/catch/unit/graph/hipGraphCycle.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -34,7 +21,7 @@ Testcase Scenarios : * Adding manual empty nodes * Cyclic graph, cycle formation first, then adding more nodes */ -TEST_CASE("Unit_hipGraph_BasicCyclic1") { +TEST_CASE(Unit_hipGraph_BasicCyclic1) { hipGraph_t graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -64,7 +51,7 @@ TEST_CASE("Unit_hipGraph_BasicCyclic1") { * Adding manual empty nodes * Cyclic graph, cycle formation first, Remove edge to resolve cycle */ -TEST_CASE("Unit_hipGraph_BasicCyclic2") { +TEST_CASE(Unit_hipGraph_BasicCyclic2) { hipGraph_t graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -95,7 +82,7 @@ TEST_CASE("Unit_hipGraph_BasicCyclic2") { * Cyclic graph, cycle formation first, Remove edge causes disconnected graph which is still * cyclic */ -TEST_CASE("Unit_hipGraph_BasicCyclic3") { +TEST_CASE(Unit_hipGraph_BasicCyclic3) { hipGraph_t graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; @@ -126,7 +113,7 @@ TEST_CASE("Unit_hipGraph_BasicCyclic3") { * Adding manual empty nodes * Uncyclic graph, removing edge from middle of linear graph */ -TEST_CASE("Unit_hipGraph_BasicCyclic4") { +TEST_CASE(Unit_hipGraph_BasicCyclic4) { int N = 1024 * 1024; int Nbytes = N * sizeof(int); hipGraph_t graph; @@ -185,7 +172,7 @@ TEST_CASE("Unit_hipGraph_BasicCyclic4") { * Adding manual empty nodes * cyclic graph, removing edge to resolve cycle and remove edge from middle of graph */ -TEST_CASE("Unit_hipGraph_BasicCyclic5") { +TEST_CASE(Unit_hipGraph_BasicCyclic5) { int N = 1024 * 1024; int Nbytes = N * sizeof(int); hipGraph_t graph; diff --git a/catch/unit/graph/hipGraphDebugDotPrint.cc b/catch/unit/graph/hipGraphDebugDotPrint.cc index 80b0faebd..fb6cfda3e 100644 --- a/catch/unit/graph/hipGraphDebugDotPrint.cc +++ b/catch/unit/graph/hipGraphDebugDotPrint.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipGraphDebugDotPrint hipGraphDebugDotPrint @@ -282,7 +269,7 @@ static void hipGraphDebugDotPrint_Functional(const char* fName, unsigned int fla Call hipGraphDebugDotPrint and provice path where to write the DOT file. Verify that DOT file get created or not for each flag passed. */ -TEST_CASE("Unit_hipGraphDebugDotPrint_Functional") { +TEST_CASE(Unit_hipGraphDebugDotPrint_Functional) { CHECK_IMAGE_SUPPORT SECTION("Call with hipGraphDebugDotFlagsVerbose flag") { @@ -343,7 +330,7 @@ TEST_CASE("Unit_hipGraphDebugDotPrint_Functional") { #define DOT_FILE_PATH_NEG "./graphDotFileNeg.dot" -TEST_CASE("Unit_hipGraphDebugDotPrint_Argument_Check") { +TEST_CASE(Unit_hipGraphDebugDotPrint_Argument_Check) { hipGraph_t graph; hipError_t ret; diff --git a/catch/unit/graph/hipGraphDestroy.cc b/catch/unit/graph/hipGraphDestroy.cc index e2e2ebef1..b60a9a39e 100644 --- a/catch/unit/graph/hipGraphDestroy.cc +++ b/catch/unit/graph/hipGraphDestroy.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -39,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphDestroy_Positive_Basic") { +TEST_CASE(Unit_hipGraphDestroy_Positive_Basic) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -60,7 +47,7 @@ TEST_CASE("Unit_hipGraphDestroy_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphDestroy_Negative_Parameters") { +TEST_CASE(Unit_hipGraphDestroy_Negative_Parameters) { HIP_CHECK_ERROR(hipGraphDestroy(static_cast(nullptr)), hipErrorInvalidValue); } diff --git a/catch/unit/graph/hipGraphDestroyNode.cc b/catch/unit/graph/hipGraphDestroyNode.cc index 920a38cec..5f661a248 100644 --- a/catch/unit/graph/hipGraphDestroyNode.cc +++ b/catch/unit/graph/hipGraphDestroyNode.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Testcase Scenarios of hipGraphDestroyNode API: @@ -56,7 +43,7 @@ static __global__ void dummyKernel() { return; } /* This test covers the negative scenarios of hipGraphDestroyNode API */ -TEST_CASE("Unit_hipGraphDestroyNode_Negative") { +TEST_CASE(Unit_hipGraphDestroyNode_Negative) { SECTION("Passing nullptr to graph Node") { REQUIRE(hipGraphDestroyNode(nullptr) == hipErrorInvalidValue); } @@ -66,7 +53,7 @@ TEST_CASE("Unit_hipGraphDestroyNode_Negative") { hipGraphDestroyNode API where we create and destroy the node */ -TEST_CASE("Unit_hipGraphDestroyNode_BasicFunctionality") { +TEST_CASE(Unit_hipGraphDestroyNode_BasicFunctionality) { char* pOutBuff_d{}; constexpr size_t size = 1024; hipGraph_t graph{}; @@ -92,7 +79,7 @@ This testcase verifies the following scenario where graph is created with dependencies and one of the dependency is destroyed before execute the graph */ -TEST_CASE("Unit_hipGraphDestroyNode_DestroyDependencyNode") { +TEST_CASE(Unit_hipGraphDestroyNode_DestroyDependencyNode) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -157,7 +144,7 @@ TEST_CASE("Unit_hipGraphDestroyNode_DestroyDependencyNode") { * Functional Test to test hipGraphDestroyNode using hipGraphGetNodes * and hipGraphGetEdges APIs. */ -TEST_CASE("Unit_hipGraphDestroyNode_Complx_ChkNumOfNodesNDep") { +TEST_CASE(Unit_hipGraphDestroyNode_Complx_ChkNumOfNodesNDep) { hipGraph_t graph; hipGraphNode_t kernelnode[NUM_OF_DUMMY_NODES]; hipKernelNodeParams kernelNodeParams[NUM_OF_DUMMY_NODES]; @@ -197,7 +184,7 @@ TEST_CASE("Unit_hipGraphDestroyNode_Complx_ChkNumOfNodesNDep") { * Functional Test to test hipGraphDestroyNode using hipGraphGetNodes * and hipGraphGetEdges APIs on a cloned graph */ -TEST_CASE("Unit_hipGraphDestroyNode_Complx_ChkNumOfNodesNDep_ClonedGrph") { +TEST_CASE(Unit_hipGraphDestroyNode_Complx_ChkNumOfNodesNDep_ClonedGrph) { hipGraph_t graph, clonedgraph; hipGraphNode_t kernelnode[NUM_OF_DUMMY_NODES]; hipKernelNodeParams kernelNodeParams[NUM_OF_DUMMY_NODES]; @@ -243,7 +230,7 @@ TEST_CASE("Unit_hipGraphDestroyNode_Complx_ChkNumOfNodesNDep_ClonedGrph") { * Functional Test to test hipGraphDestroyNode on child node using * hipGraphGetNodes and hipGraphGetEdges APIs on a cloned graph. */ -TEST_CASE("Unit_hipGraphDestroyNode_Complx_ChkNumOfNodesNDep_ChldNode") { +TEST_CASE(Unit_hipGraphDestroyNode_Complx_ChkNumOfNodesNDep_ChldNode) { hipGraph_t graph0, graph1; hipGraphNode_t kernelnode[NUM_OF_DUMMY_NODES], childGraphNode; hipKernelNodeParams kernelNodeParams[NUM_OF_DUMMY_NODES]; diff --git a/catch/unit/graph/hipGraphEventRecordNodeGetEvent.cc b/catch/unit/graph/hipGraphEventRecordNodeGetEvent.cc index 223d05703..94afec219 100644 --- a/catch/unit/graph/hipGraphEventRecordNodeGetEvent.cc +++ b/catch/unit/graph/hipGraphEventRecordNodeGetEvent.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -55,7 +42,7 @@ static void validateEventRecordNodeGetEvent(unsigned flag) { /** * Scenario: Validate scenario 1 for different event flags. */ -TEST_CASE("Unit_hipGraphEventRecordNodeGetEvent_Functional") { +TEST_CASE(Unit_hipGraphEventRecordNodeGetEvent_Functional) { // Create event nodes with different flags and validate with // hipGraphEventRecordNodeGetEvent. SECTION("Flag = hipEventDefault") { validateEventRecordNodeGetEvent(hipEventDefault); } @@ -70,7 +57,7 @@ TEST_CASE("Unit_hipGraphEventRecordNodeGetEvent_Functional") { /** * Scenario 2: Negative tests. */ -TEST_CASE("Unit_hipGraphEventRecordNodeGetEvent_Negative") { +TEST_CASE(Unit_hipGraphEventRecordNodeGetEvent_Negative) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event_out; diff --git a/catch/unit/graph/hipGraphEventRecordNodeSetEvent.cc b/catch/unit/graph/hipGraphEventRecordNodeSetEvent.cc index 2b5370de0..442bf7577 100644 --- a/catch/unit/graph/hipGraphEventRecordNodeSetEvent.cc +++ b/catch/unit/graph/hipGraphEventRecordNodeSetEvent.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -86,7 +73,7 @@ static void setEventWaitNode() { /** * Scenario 2: Validate Change of event property in event record node. */ -TEST_CASE("Unit_hipGraphEventRecordNodeSetEvent_SetEventProperty") { +TEST_CASE(Unit_hipGraphEventRecordNodeSetEvent_SetEventProperty) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); // Create events @@ -155,7 +142,7 @@ TEST_CASE("Unit_hipGraphEventRecordNodeSetEvent_SetEventProperty") { /** * Scenario 1: Validate Set Get test for all Event flags */ -TEST_CASE("Unit_hipGraphEventRecordNodeSetEvent_SetGet") { +TEST_CASE(Unit_hipGraphEventRecordNodeSetEvent_SetGet) { SECTION("Flag = hipEventDefault") { validateEventRecordNodeSetEvent(hipEventDefault); } SECTION("Flag = hipEventBlockingSync") { validateEventRecordNodeSetEvent(hipEventBlockingSync); } @@ -168,7 +155,7 @@ TEST_CASE("Unit_hipGraphEventRecordNodeSetEvent_SetGet") { /** * Scenario 3: Negative Tests */ -TEST_CASE("Unit_hipGraphEventRecordNodeSetEvent_Negative") { +TEST_CASE(Unit_hipGraphEventRecordNodeSetEvent_Negative) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event1, event2; diff --git a/catch/unit/graph/hipGraphEventWaitNodeGetEvent.cc b/catch/unit/graph/hipGraphEventWaitNodeGetEvent.cc index 50a0b64de..097593424 100644 --- a/catch/unit/graph/hipGraphEventWaitNodeGetEvent.cc +++ b/catch/unit/graph/hipGraphEventWaitNodeGetEvent.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -56,7 +43,7 @@ static void validateEventWaitNodeGetEvent(unsigned flag) { /** * Scenario 1 */ -TEST_CASE("Unit_hipGraphEventWaitNodeGetEvent_Functional") { +TEST_CASE(Unit_hipGraphEventWaitNodeGetEvent_Functional) { // Create event nodes with different flags and validate with // hipGraphEventWaitNodeGetEvent. SECTION("Flag = hipEventDefault") { validateEventWaitNodeGetEvent(hipEventDefault); } @@ -69,7 +56,7 @@ TEST_CASE("Unit_hipGraphEventWaitNodeGetEvent_Functional") { /** * Scenario 2 */ -TEST_CASE("Unit_hipGraphEventWaitNodeGetEvent_Negative") { +TEST_CASE(Unit_hipGraphEventWaitNodeGetEvent_Negative) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event_out; diff --git a/catch/unit/graph/hipGraphEventWaitNodeSetEvent.cc b/catch/unit/graph/hipGraphEventWaitNodeSetEvent.cc index 9d5eb712f..64bd4c79d 100644 --- a/catch/unit/graph/hipGraphEventWaitNodeSetEvent.cc +++ b/catch/unit/graph/hipGraphEventWaitNodeSetEvent.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -88,7 +75,7 @@ static void setEventRecordNode() { /** * Scenario 2 */ -TEST_CASE("Unit_hipGraphEventWaitNodeSetEvent_SetProp") { +TEST_CASE(Unit_hipGraphEventWaitNodeSetEvent_SetProp) { constexpr size_t N = 512; size_t memsize = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -218,7 +205,7 @@ TEST_CASE("Unit_hipGraphEventWaitNodeSetEvent_SetProp") { /** * Scenario 1 */ -TEST_CASE("Unit_hipGraphEventWaitNodeSetEvent_SetGet") { +TEST_CASE(Unit_hipGraphEventWaitNodeSetEvent_SetGet) { SECTION("Flag = hipEventDefault") { validateEventWaitNodeSetEvent(hipEventDefault); } SECTION("Flag = hipEventBlockingSync") { validateEventWaitNodeSetEvent(hipEventBlockingSync); } @@ -229,7 +216,7 @@ TEST_CASE("Unit_hipGraphEventWaitNodeSetEvent_SetGet") { /** * Scenario 3 */ -TEST_CASE("Unit_hipGraphEventWaitNodeSetEvent_Negative") { +TEST_CASE(Unit_hipGraphEventWaitNodeSetEvent_Negative) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event1, event2; diff --git a/catch/unit/graph/hipGraphExecBatchMemOpNodeSetParams.cc b/catch/unit/graph/hipGraphExecBatchMemOpNodeSetParams.cc index 978fba1e6..0e5794ca9 100644 --- a/catch/unit/graph/hipGraphExecBatchMemOpNodeSetParams.cc +++ b/catch/unit/graph/hipGraphExecBatchMemOpNodeSetParams.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include /** @@ -39,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphExecBatchMemOpNodeSetParams_NegativeTsts") { +TEST_CASE(Unit_hipGraphExecBatchMemOpNodeSetParams_NegativeTsts) { HIP_CHECK(hipInit(0)); hipGraph_t graph, graph1; hipGraphExec_t graphExec; diff --git a/catch/unit/graph/hipGraphExecChildGraphNodeSetParams.cc b/catch/unit/graph/hipGraphExecChildGraphNodeSetParams.cc index 37d0ca675..6cff830a3 100644 --- a/catch/unit/graph/hipGraphExecChildGraphNodeSetParams.cc +++ b/catch/unit/graph/hipGraphExecChildGraphNodeSetParams.cc @@ -1,20 +1,8 @@ -/*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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios of hipGraphExecChildGraphNodeSetParams API: @@ -40,7 +28,7 @@ THE SOFTWARE. #include -TEST_CASE("Unit_hipGraphExecChildGraphNodeSetParams_Negative") { +TEST_CASE(Unit_hipGraphExecChildGraphNodeSetParams_Negative) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph, childgraph1, childgraph2; @@ -122,7 +110,7 @@ TEST_CASE("Unit_hipGraphExecChildGraphNodeSetParams_Negative") { using hipGraphExecChildGraphNodeSetParams API and execute it */ -TEST_CASE("Unit_hipGraphExecChildGraphNodeSetParams_BasicFunc") { +TEST_CASE(Unit_hipGraphExecChildGraphNodeSetParams_BasicFunc) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph, childgraph1, childgraph2; @@ -194,7 +182,7 @@ TEST_CASE("Unit_hipGraphExecChildGraphNodeSetParams_BasicFunc") { using hipGraphExecChildGraphNodeSetParams API and execute it */ -TEST_CASE("Unit_hipGraphExecChildGraphNodeSetParams_ChildTopology") { +TEST_CASE(Unit_hipGraphExecChildGraphNodeSetParams_ChildTopology) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency diff --git a/catch/unit/graph/hipGraphExecDestroy.cc b/catch/unit/graph/hipGraphExecDestroy.cc index f0c8b913d..78c4ef0eb 100644 --- a/catch/unit/graph/hipGraphExecDestroy.cc +++ b/catch/unit/graph/hipGraphExecDestroy.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -40,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecDestroy_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExecDestroy_Negative_Parameters) { SECTION("Pass hipGraphExecDestroy with nullptr") { HIP_CHECK_ERROR(hipGraphExecDestroy(nullptr), hipErrorInvalidValue); } @@ -63,7 +50,7 @@ TEST_CASE("Unit_hipGraphExecDestroy_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecDestroy_Positive_Basic") { +TEST_CASE(Unit_hipGraphExecDestroy_Positive_Basic) { hipGraph_t graph; hipGraphExec_t graphExec; hipStream_t streamForGraph; diff --git a/catch/unit/graph/hipGraphExecEventRecordNodeSetEvent.cc b/catch/unit/graph/hipGraphExecEventRecordNodeSetEvent.cc index fa27fc637..444e3f4c7 100644 --- a/catch/unit/graph/hipGraphExecEventRecordNodeSetEvent.cc +++ b/catch/unit/graph/hipGraphExecEventRecordNodeSetEvent.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -65,7 +52,7 @@ static __global__ void copy_ker_func(int* a, int* b, size_t N) { /** * Scenario 1: Functional scenario (See description Above) */ -TEST_CASE("Unit_hipGraphExecEventRecordNodeSetEvent_Functional") { +TEST_CASE(Unit_hipGraphExecEventRecordNodeSetEvent_Functional) { constexpr size_t gridSize = 512; constexpr size_t blockSize = 512; constexpr size_t N = gridSize * blockSize; @@ -162,7 +149,7 @@ TEST_CASE("Unit_hipGraphExecEventRecordNodeSetEvent_Functional") { * Scenario 2: This test verifies that changes to executable graph does * not impact the original graph. */ -TEST_CASE("Unit_hipGraphExecEventRecordNodeSetEvent_VerifyEventNotChanged") { +TEST_CASE(Unit_hipGraphExecEventRecordNodeSetEvent_VerifyEventNotChanged) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event1, event2, event_out; @@ -187,8 +174,7 @@ TEST_CASE("Unit_hipGraphExecEventRecordNodeSetEvent_VerifyEventNotChanged") { * Scenario 3: This test verifies event in node of the executable graph can be changed to event on * different device */ -TEST_CASE("Unit_hipGraphExecEventRecordNodeSetEvent_Positive_DifferentDevices", - "[multigpu]") { +TEST_CASE(Unit_hipGraphExecEventRecordNodeSetEvent_Positive_DifferentDevices) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -228,7 +214,7 @@ TEST_CASE("Unit_hipGraphExecEventRecordNodeSetEvent_Positive_DifferentDevices", /** * Scenario 4: Negative Parameter Tests */ -TEST_CASE("Unit_hipGraphExecEventRecordNodeSetEvent_Negative") { +TEST_CASE(Unit_hipGraphExecEventRecordNodeSetEvent_Negative) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event1, event2; diff --git a/catch/unit/graph/hipGraphExecEventWaitNodeSetEvent.cc b/catch/unit/graph/hipGraphExecEventWaitNodeSetEvent.cc index 0dcba1940..9d19047ae 100644 --- a/catch/unit/graph/hipGraphExecEventWaitNodeSetEvent.cc +++ b/catch/unit/graph/hipGraphExecEventWaitNodeSetEvent.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -62,7 +49,7 @@ static __global__ void sqr_ker_func(int* a, int* b, size_t N) { /** * Scenario 1: Test to validate setting different events in executable graph. */ -TEST_CASE("Unit_hipGraphExecEventWaitNodeSetEvent_SetAndVerifyMemory") { +TEST_CASE(Unit_hipGraphExecEventWaitNodeSetEvent_SetAndVerifyMemory) { constexpr size_t gridSize = 64; constexpr size_t blockSize = 256; constexpr size_t N = gridSize * blockSize; @@ -176,7 +163,7 @@ TEST_CASE("Unit_hipGraphExecEventWaitNodeSetEvent_SetAndVerifyMemory") { * Scenario 2: Test to validate setting a different event in an executable * graph does not impact the original graph and nodes. */ -TEST_CASE("Unit_hipGraphExecEventWaitNodeSetEvent_VerifyEventNotChanged") { +TEST_CASE(Unit_hipGraphExecEventWaitNodeSetEvent_VerifyEventNotChanged) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event1, event2, event_out; @@ -200,7 +187,7 @@ TEST_CASE("Unit_hipGraphExecEventWaitNodeSetEvent_VerifyEventNotChanged") { /** * Scenario 3: Negative and Parameter Tests. */ -TEST_CASE("Unit_hipGraphExecEventWaitNodeSetEvent_Negative") { +TEST_CASE(Unit_hipGraphExecEventWaitNodeSetEvent_Negative) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event1, event2; diff --git a/catch/unit/graph/hipGraphExecGetFlags.cc b/catch/unit/graph/hipGraphExecGetFlags.cc index 9c6b5b233..4013d05e4 100644 --- a/catch/unit/graph/hipGraphExecGetFlags.cc +++ b/catch/unit/graph/hipGraphExecGetFlags.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include /** @@ -38,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphExecGetFlags_Negative") { +TEST_CASE(Unit_hipGraphExecGetFlags_Negative) { hipGraphExec_t graphExec; unsigned long long flags; // NOLINT constexpr size_t Nbytes = 10 * sizeof(int); @@ -77,7 +65,7 @@ TEST_CASE("Unit_hipGraphExecGetFlags_Negative") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphExecGetFlags_positive") { +TEST_CASE(Unit_hipGraphExecGetFlags_Positive) { hipGraphExec_t graphExec; unsigned long long flags; // NOLINT hipGraph_t graph; diff --git a/catch/unit/graph/hipGraphExecHostNodeSetParams.cc b/catch/unit/graph/hipGraphExecHostNodeSetParams.cc index f2afd35af..add175e3d 100644 --- a/catch/unit/graph/hipGraphExecHostNodeSetParams.cc +++ b/catch/unit/graph/hipGraphExecHostNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Test Case Scenarios of hipGraphExecHostNodeSetParams API: @@ -62,7 +47,7 @@ void callbackfunc_setparams(void* B_h) { This test case verifies the negative scenarios of hipGraphExecHostNodeSetParams API */ -TEST_CASE("Unit_hipGraphExecHostNodeSetParams_Negative") { +TEST_CASE(Unit_hipGraphExecHostNodeSetParams_Negative) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; @@ -154,7 +139,7 @@ Creates graph, Add graph nodes and clone the graph Add HostNode to the cloned graph,update the host params using hipGraphExecHostNodeSetParams API and validates the result */ -TEST_CASE("Unit_hipGraphExecHostNodeSetParams_ClonedGraphWithHostNode") { +TEST_CASE(Unit_hipGraphExecHostNodeSetParams_ClonedGraphWithHostNode) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; @@ -217,7 +202,7 @@ Create graph, Adds host node to the graph, updates the host params using hipGraphExecHostNodeSetParams API and validates the result */ -TEST_CASE("Unit_hipGraphExecHostNodeSetParams_BasicFunc") { +TEST_CASE(Unit_hipGraphExecHostNodeSetParams_BasicFunc) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; diff --git a/catch/unit/graph/hipGraphExecKernelNodeSetParams.cc b/catch/unit/graph/hipGraphExecKernelNodeSetParams.cc index 524e38b46..2f5364b8e 100644 --- a/catch/unit/graph/hipGraphExecKernelNodeSetParams.cc +++ b/catch/unit/graph/hipGraphExecKernelNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Test Case Scenarios : @@ -39,7 +24,7 @@ Functional - /** * Negative Test for API hipGraphExecKernelNodeSetParams */ -TEST_CASE("Unit_hipGraphExecKernelNodeSetParams_Negative") { +TEST_CASE(Unit_hipGraphExecKernelNodeSetParams_Negative) { constexpr size_t N = 1024; constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; @@ -128,7 +113,7 @@ TEST_CASE("Unit_hipGraphExecKernelNodeSetParams_Negative") { /** * Functional Test for API Exec Kernel Params */ -TEST_CASE("Unit_hipGraphExecKernelNodeSetParams_Functional") { +TEST_CASE(Unit_hipGraphExecKernelNodeSetParams_Functional) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency diff --git a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams.cc b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams.cc index 2593f00bb..4bd7d9bf6 100644 --- a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams.cc +++ b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -51,7 +35,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Positive_Basic") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams_Positive_Basic) { constexpr auto f = [](void* dst, void* src, size_t count, hipMemcpyKind direction) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -158,7 +142,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -230,7 +214,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Changing_Memcpy_Direction") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams_Negative_Changing_Memcpy_Direction) { int *host, *dev, *src, *dst; HIP_CHECK(hipHostMalloc(&host, sizeof(int))); HIP_CHECK(hipMalloc(&dev, sizeof(int))); diff --git a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams1D.cc b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams1D.cc index 2cea42c65..b4ab621ec 100644 --- a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams1D.cc +++ b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams1D.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -50,7 +35,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Positive_Basic") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams1D_Positive_Basic) { constexpr auto f = [](void* dst, void* src, size_t count, hipMemcpyKind direction) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -151,7 +136,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams1D_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -217,7 +202,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Negative_Changing_Memcpy_Direction") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams1D_Negative_Changing_Memcpy_Direction) { int *host1, *host2, *dev1, *dev2; HIP_CHECK(hipHostMalloc(&host1, sizeof(int))); HIP_CHECK(hipHostMalloc(&host2, sizeof(int))); diff --git a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams1D_old.cc b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams1D_old.cc index aaa429524..b278c9f6f 100644 --- a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams1D_old.cc +++ b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams1D_old.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Testcase Scenarios : @@ -45,7 +32,7 @@ the hipMemcpyKind from H2D to D2H but allocate pointer memory for H2D, api shoul /* Test verifies hipGraphExecMemcpyNodeSetParams1D API Functional scenarios. */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Functional") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams1D_Functional) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -117,7 +104,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Functional") { /* Test verifies hipGraphExecMemcpyNodeSetParams1D API Negative scenarios. */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Negative") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams1D_Negative) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); diff --git a/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsFromSymbol.cc b/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsFromSymbol.cc index 6b76ef103..b1d42d00d 100644 --- a/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsFromSymbol.cc +++ b/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsFromSymbol.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -98,7 +83,7 @@ void GraphExecMemcpyFromSymbolSetParamsShell(const void* symbol, const void* alt * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Positive_Basic") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Positive_Basic) { SECTION("char") { HIP_GRAPH_MEMCPY_NODE_SET_PARAMS_TO_FROM_SYMBOL_TEST(GraphExecMemcpyFromSymbolSetParamsShell, 1, char); @@ -142,7 +127,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsFromSymbol_old.cc b/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsFromSymbol_old.cc index b6cf9e567..b74fdc978 100644 --- a/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsFromSymbol_old.cc +++ b/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsFromSymbol_old.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios of hipGraphExecMemcpyNodeSetParamsFromSymbol API: @@ -51,7 +38,7 @@ __device__ __constant__ int globalConst[SIZE]; /* Test verifies hipGraphExecMemcpyNodeSetParamsFromSymbol API Negative scenarios. */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Negative") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Negative) { constexpr size_t Nbytes = SIZE * sizeof(int); int *A_d{nullptr}, *B_d{nullptr}; int *A_h{nullptr}, *B_h{nullptr}; @@ -232,7 +219,7 @@ static void hipGraphExecMemcpyNodeSetParamsFromSymbol_GlobalMem(bool useConstVar obtain executable graph and update the node params with set exec api call. Make sure they are taking effect. */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Functional") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParamsFromSymbol_Functional) { SECTION("Check and update with Global Device Symbol Memory") { hipGraphExecMemcpyNodeSetParamsFromSymbol_GlobalMem(false); } diff --git a/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsToSymbol.cc b/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsToSymbol.cc index d895b2fd8..3d78b5d4c 100644 --- a/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsToSymbol.cc +++ b/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsToSymbol.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -98,7 +83,7 @@ void GraphExecMemcpyToSymbolSetParamsShell(const void* symbol, const void* alt_s * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Positive_Basic") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Positive_Basic) { SECTION("char") { HIP_GRAPH_MEMCPY_NODE_SET_PARAMS_TO_FROM_SYMBOL_TEST(GraphExecMemcpyToSymbolSetParamsShell, 10, char); @@ -142,8 +127,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Negative_Parameters", - "[multigpu]") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsToSymbol_old.cc b/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsToSymbol_old.cc index 1c14f524f..233d52090 100644 --- a/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsToSymbol_old.cc +++ b/catch/unit/graph/hipGraphExecMemcpyNodeSetParamsToSymbol_old.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios of hipGraphExecMemcpyNodeSetParamsToSymbol API: @@ -61,7 +48,7 @@ __global__ void MemcpyToConstSymbolExecKernel(int* B_d) { /* This testcase verifies negative scenarios of hipGraphExecMemcpyNodeSetParamsToSymbol API */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Negative") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Negative) { constexpr size_t Nbytes = SIZE * sizeof(int); int *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; int *A_h{nullptr}, *B_h{nullptr}; @@ -251,7 +238,7 @@ static void hipGraphExecMemcpyNodeSetParamsToSymbol_GlobalMem(bool useConstVar) obtain executable graph and update the node params with set exec api call. Make sure they are taking effect. */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Functional") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParamsToSymbol_Functional) { SECTION("Check and update with Global Device Symbol Memory") { hipGraphExecMemcpyNodeSetParamsToSymbol_GlobalMem(false); } diff --git a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams_old.cc b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams_old.cc index c9c740005..583c47b3d 100644 --- a/catch/unit/graph/hipGraphExecMemcpyNodeSetParams_old.cc +++ b/catch/unit/graph/hipGraphExecMemcpyNodeSetParams_old.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -38,7 +25,7 @@ verify api returns error code. /* Test verifies hipGraphExecMemcpyNodeSetParams API Negative scenarios. */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams_Negative) { CHECK_IMAGE_SUPPORT constexpr int width{10}, height{10}, depth{10}; @@ -151,7 +138,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative") { /* Test verifies hipGraphExecMemcpyNodeSetParams API Functional scenarios. */ -TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Functional") { +TEST_CASE(Unit_hipGraphExecMemcpyNodeSetParams_Functional) { CHECK_IMAGE_SUPPORT constexpr int XSIZE = 1024; diff --git a/catch/unit/graph/hipGraphExecMemsetNodeSetParams.cc b/catch/unit/graph/hipGraphExecMemsetNodeSetParams.cc index d8a7594b2..d769390f6 100644 --- a/catch/unit/graph/hipGraphExecMemsetNodeSetParams.cc +++ b/catch/unit/graph/hipGraphExecMemsetNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -53,7 +38,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_hipGraphExecMemsetNodeSetParams_Positive_Basic", "", uint8_t, uint16_t, +TEMPLATE_TEST_CASE(Unit_hipGraphExecMemsetNodeSetParams_Positive_Basic, uint8_t, uint16_t, uint32_t) { CHECK_IMAGE_SUPPORT @@ -129,8 +114,7 @@ TEMPLATE_TEST_CASE("Unit_hipGraphExecMemsetNodeSetParams_Positive_Basic", "", ui * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemsetNodeSetParams_Negative_Parameters", - "[multigpu]") { +TEST_CASE(Unit_hipGraphExecMemsetNodeSetParams_Negative_Parameters) { // FIXME: this test tests 1D/2D/3D stuff in one single go, need to decouple it so that it can run // on devices with no image support CHECK_IMAGE_SUPPORT @@ -192,7 +176,7 @@ TEST_CASE("Unit_hipGraphExecMemsetNodeSetParams_Negative_Parameters", * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphExecMemsetNodeSetParams_Negative_Updating_Non1D_Node") { +TEST_CASE(Unit_hipGraphExecMemsetNodeSetParams_Negative_Updating_Non1D_Node) { CHECK_IMAGE_SUPPORT hipGraph_t graph = nullptr; diff --git a/catch/unit/graph/hipGraphExecNodeSetParams.cc b/catch/unit/graph/hipGraphExecNodeSetParams.cc index 47979f2c6..2f17933eb 100644 --- a/catch/unit/graph/hipGraphExecNodeSetParams.cc +++ b/catch/unit/graph/hipGraphExecNodeSetParams.cc @@ -1,23 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -46,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphExecNodeSetParams_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExecNodeSetParams_Negative_Parameters) { hipGraph_t graph; hipGraphExec_t graphExec; hipGraphNode_t node; @@ -97,7 +82,7 @@ TEST_CASE("Unit_hipGraphExecNodeSetParams_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphExecNodeSetParams_Positive") { +TEST_CASE(Unit_hipGraphExecNodeSetParams_Positive) { hipGraph_t graph; hipGraphExec_t graphExec; hipGraphNode_t node; diff --git a/catch/unit/graph/hipGraphExecUpdate.cc b/catch/unit/graph/hipGraphExecUpdate.cc index fb053e177..df5802664 100644 --- a/catch/unit/graph/hipGraphExecUpdate.cc +++ b/catch/unit/graph/hipGraphExecUpdate.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipGraphExecUpdate hipGraphExecUpdate @@ -42,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Negative_Basic") { +TEST_CASE(Unit_hipGraphExecUpdate_Negative_Basic) { hipError_t ret; hipGraph_t graph{}; hipGraphExec_t graphExec{}; @@ -79,7 +66,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_Basic") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Negative_TypeChange") { +TEST_CASE(Unit_hipGraphExecUpdate_Negative_TypeChange) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(char); constexpr size_t val = 0; @@ -135,7 +122,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_TypeChange") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Negative_CountDiffer") { +TEST_CASE(Unit_hipGraphExecUpdate_Negative_CountDiffer) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -231,7 +218,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_CountDiffer") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Functional") { +TEST_CASE(Unit_hipGraphExecUpdate_Functional) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -336,7 +323,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Functional") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Negative_Functional_ParametersChanged") { +TEST_CASE(Unit_hipGraphExecUpdate_Negative_Functional_ParametersChanged) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); int *A_d, *B_d, *C_d, *A_h, *B_h, *C_h; @@ -390,7 +377,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_Functional_ParametersChanged") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Negative_Functional_CountDiffer_1") { +TEST_CASE(Unit_hipGraphExecUpdate_Negative_Functional_CountDiffer_1) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); int *A_d, *B_d, *C_d, *A_h, *B_h, *C_h; @@ -444,7 +431,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_Functional_CountDiffer_1") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Negative_Functional_CountDiffer_2") { +TEST_CASE(Unit_hipGraphExecUpdate_Negative_Functional_CountDiffer_2) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); int *A_d, *B_d, *C_d, *A_h, *B_h, *C_h; @@ -519,7 +506,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_Functional_CountDiffer_2") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Negative_Dependent_NodesDiffer") { +TEST_CASE(Unit_hipGraphExecUpdate_Negative_Dependent_NodesDiffer) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); int *A_d, *B_d, *C_d, *A_h, *B_h, *C_h; @@ -578,7 +565,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_Dependent_NodesDiffer") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Negative_NodeType_Changed") { +TEST_CASE(Unit_hipGraphExecUpdate_Negative_NodeType_Changed) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); int *A_d, *B_d, *C_d, *A_h, *B_h, *C_h; @@ -639,8 +626,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_NodeType_Changed") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Negative_MultiDevice_Context_Changed", - "[multigpu]") { +TEST_CASE(Unit_hipGraphExecUpdate_Negative_MultiDevice_Context_Changed) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -740,7 +726,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_MultiDevice_Context_Changed", * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecUpdate_Functional_KernelFunction_Changed") { +TEST_CASE(Unit_hipGraphExecUpdate_Functional_KernelFunction_Changed) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency diff --git a/catch/unit/graph/hipGraphGetEdges.cc b/catch/unit/graph/hipGraphGetEdges.cc index 1b8fd4c85..0ddd1d393 100644 --- a/catch/unit/graph/hipGraphGetEdges.cc +++ b/catch/unit/graph/hipGraphGetEdges.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -104,7 +91,7 @@ static void validate_hipGraphGetEdges_fromto(size_t testNumEdges, GraphGetNodesT * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphGetEdges_Positive_Functional") { +TEST_CASE(Unit_hipGraphGetEdges_Positive_Functional) { constexpr size_t N = 1024; hipGraph_t graph; int *A_d, *B_d, *C_d; @@ -173,7 +160,7 @@ TEST_CASE("Unit_hipGraphGetEdges_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphGetEdges_Positive_CapturedStream") { +TEST_CASE(Unit_hipGraphGetEdges_Positive_CapturedStream) { hipGraph_t graph{nullptr}; constexpr size_t N = 1024; constexpr int numMemcpy[2]{2, 3}, numKernel[2]{2, 3}, numMemset[2]{2, 0}; @@ -253,7 +240,7 @@ TEST_CASE("Unit_hipGraphGetEdges_Positive_CapturedStream") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphGetEdges_Negative_Parameters") { +TEST_CASE(Unit_hipGraphGetEdges_Negative_Parameters) { hipGraph_t graph{}, graph_uninit{}; HIP_CHECK(hipGraphCreate(&graph, 0)); hipGraphNode_t nodes_from[kNumOfEdges]{}, nodes_to[kNumOfEdges]{}; diff --git a/catch/unit/graph/hipGraphGetEdges_old.cc b/catch/unit/graph/hipGraphGetEdges_old.cc deleted file mode 100644 index 6ede299ec..000000000 --- a/catch/unit/graph/hipGraphGetEdges_old.cc +++ /dev/null @@ -1,236 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/** -Testcase Scenarios : - 1) Add nodes to graph with dependencies defined. Call api and verify number - of edges and from/to list returned corresponds to the dependencies defined. - 2) Pass from and to as nullptr and verify the api returns number of edges. - 3) Pass numEdges lesser than actual number and verify the api returns from/to - list with requested number of edges. - 4) Pass numEdges greater than actual number and verify the remaining entries - in from/to list are set to null and number of edges actually returned will - be written to numEdges. - 5) Validate numEdges when 0 or 1 node is present in graph. - 6) Negative Test Cases - - Input graph parameter is a nullptr. - - From node parameter is a nullptr. - - To node parameter is a nullptr. - - numEdges parameter is a nullptr. - - Input graph parameter is uninitialized. -*/ - -#include -#include -#include - -#define EXPECTED_NUM_OF_EDGES 6 - -/** - * Local Function to validate number of edges. - */ -static void validate_hipGraphGetEdges_fromto(size_t numEdgesToGet, int testnum, - hipGraphNode_t* nodes_from, hipGraphNode_t* nodes_to, - hipGraph_t graph) { - - size_t numEdges = numEdgesToGet; - hipGraphNode_t* fromnode = new hipGraphNode_t[numEdges]{}; - hipGraphNode_t* tonode = new hipGraphNode_t[numEdges]{}; - HIP_CHECK(hipGraphGetEdges(graph, fromnode, tonode, &numEdges)); - bool nodeFound; - int found_count = 0; - for (int idx_from = 0; idx_from < numEdges; idx_from++) { - nodeFound = false; - int idx = 0; - for (; idx < numEdges; idx++) { - if (nodes_from[idx_from] == fromnode[idx]) { - nodeFound = true; - break; - } - } - if (nodeFound && (tonode[idx] == nodes_to[idx_from])) { - found_count++; - } - } - - // Validate - if (testnum == 0) { - REQUIRE(found_count == EXPECTED_NUM_OF_EDGES); - } else if (testnum == 1) { - REQUIRE(found_count == numEdges); - } else if (testnum == 2) { - REQUIRE(found_count == EXPECTED_NUM_OF_EDGES); - for (int idx = (EXPECTED_NUM_OF_EDGES - 1); idx > (numEdges - 1); idx++) { - REQUIRE(fromnode[idx] == nullptr); - REQUIRE(tonode[idx] == nullptr); - } - } - - delete[] tonode; - delete[] fromnode; -} - -/** - * Scenario 1: Finctionality tests to validate hipGraphGetEdges() - * for different number of edges. - */ -TEST_CASE("Unit_hipGraphGetEdges_Functionality") { - constexpr size_t N = 1024; - constexpr size_t Nbytes = N * sizeof(int); - constexpr auto blocksPerCU = 6; // to hide latency - constexpr auto threadsPerBlock = 256; - hipGraph_t graph; - hipGraphNode_t memset_A, memset_B, memsetKer_C; - hipGraphNode_t memcpyH2D_A, memcpyH2D_B, memcpyD2H_C; - hipGraphNode_t kernel_vecAdd; - hipKernelNodeParams kernelNodeParams{}; - int *A_d, *B_d, *C_d; - int *A_h, *B_h, *C_h; - hipMemsetParams memsetParams{}; - int memsetVal{}; - size_t NElem{N}; - - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); - - HIP_CHECK(hipGraphCreate(&graph, 0)); - - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(A_d); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(B_d); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memset_B, graph, nullptr, 0, &memsetParams)); - - void* kernelArgs1[] = {&C_d, &memsetVal, reinterpret_cast(&NElem)}; - kernelNodeParams.func = reinterpret_cast(HipTest::memsetReverse); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs1); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&memsetKer_C, graph, nullptr, 0, &kernelNodeParams)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_B, graph, nullptr, 0, B_d, B_h, Nbytes, - hipMemcpyHostToDevice)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyD2H_C, graph, nullptr, 0, C_h, C_d, Nbytes, - hipMemcpyDeviceToHost)); - - void* kernelArgs2[] = {&A_d, &B_d, &C_d, reinterpret_cast(&NElem)}; - kernelNodeParams.func = reinterpret_cast(HipTest::vectorADD); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs2); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernel_vecAdd, graph, nullptr, 0, &kernelNodeParams)); - - // Create dependencies - HIP_CHECK(hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memset_B, &memcpyH2D_B, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_A, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_B, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memsetKer_C, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &kernel_vecAdd, &memcpyD2H_C, 1)); - - hipGraphNode_t nodes_from[EXPECTED_NUM_OF_EDGES] = {memset_A, memset_B, memcpyH2D_A, - memcpyH2D_B, memsetKer_C, kernel_vecAdd}; - hipGraphNode_t nodes_to[EXPECTED_NUM_OF_EDGES] = {memcpyH2D_A, memcpyH2D_B, kernel_vecAdd, - kernel_vecAdd, kernel_vecAdd, memcpyD2H_C}; - // Validate hipGraphGetEdges() API - // Scenario 1 - SECTION("Validate number of edges") { - size_t numEdges = 0; - HIP_CHECK(hipGraphGetEdges(graph, nullptr, nullptr, &numEdges)); - REQUIRE(numEdges == EXPECTED_NUM_OF_EDGES); - } - // Scenario 2 - SECTION("Validate from/to list when numEdges = num of edges") { - validate_hipGraphGetEdges_fromto(EXPECTED_NUM_OF_EDGES, 0, nodes_from, nodes_to, graph); - } - // Scenario 3 - SECTION("Validate from/to list when numEdges = less than num of edges") { - validate_hipGraphGetEdges_fromto(EXPECTED_NUM_OF_EDGES - 1, 1, nodes_from, nodes_to, graph); - } - // Scenario 4 - SECTION("Validate from/to list when numEdges = more than num of edges") { - validate_hipGraphGetEdges_fromto(EXPECTED_NUM_OF_EDGES + 1, 2, nodes_from, nodes_to, graph); - } - // Scenario 5 - SECTION("Validate number of edges when zero or one node in graph") { - size_t numEdges = 0; - hipGraph_t graphempty; - HIP_CHECK(hipGraphCreate(&graphempty, 0)); - HIP_CHECK(hipGraphGetEdges(graphempty, nullptr, nullptr, &numEdges)); - REQUIRE(numEdges == 0); - // Add an empty node - hipGraphNode_t emptyNode{}; - HIP_CHECK(hipGraphAddEmptyNode(&emptyNode, graphempty, nullptr, 0)); - HIP_CHECK(hipGraphGetEdges(graphempty, nullptr, nullptr, &numEdges)); - REQUIRE(numEdges == 0); - HIP_CHECK(hipGraphDestroy(graphempty)); - } - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); - HIP_CHECK(hipGraphDestroy(graph)); -} - -/** - * Scenario 5: Negative Test Cases - */ -TEST_CASE("Unit_hipGraphGetEdges_Negative") { - hipGraph_t graph{}, graph_uninit{}; - HIP_CHECK(hipGraphCreate(&graph, 0)); - hipGraphNode_t nodes_from[EXPECTED_NUM_OF_EDGES]{}, nodes_to[EXPECTED_NUM_OF_EDGES]{}; - size_t numEdges = 0; - SECTION("graph is nullptr") { - REQUIRE(hipErrorInvalidValue == hipGraphGetEdges(nullptr, nodes_from, nodes_to, &numEdges)); - } - SECTION("from is nullptr") { - REQUIRE(hipErrorInvalidValue == hipGraphGetEdges(graph, nullptr, nodes_to, &numEdges)); - } - - SECTION("to is nullptr") { - REQUIRE(hipErrorInvalidValue == hipGraphGetEdges(graph, nodes_from, nullptr, &numEdges)); - } - SECTION("numEdges is nullptr") { - REQUIRE(hipErrorInvalidValue == hipGraphGetEdges(graph, nodes_from, nodes_to, nullptr)); - } - - SECTION("graph is uninitialized") { - REQUIRE(hipErrorInvalidValue == - hipGraphGetEdges(graph_uninit, nodes_from, nodes_to, &numEdges)); - } - - HIP_CHECK(hipGraphDestroy(graph)); -} \ No newline at end of file diff --git a/catch/unit/graph/hipGraphGetNodes.cc b/catch/unit/graph/hipGraphGetNodes.cc index 19208c50f..2abf629a4 100644 --- a/catch/unit/graph/hipGraphGetNodes.cc +++ b/catch/unit/graph/hipGraphGetNodes.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -54,7 +41,7 @@ inline constexpr size_t kNumOfNodes = 7; * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphGetNodes_Positive_Functional") { +TEST_CASE(Unit_hipGraphGetNodes_Positive_Functional) { using namespace std::placeholders; constexpr size_t N = 1024; hipGraph_t graph; @@ -137,7 +124,7 @@ TEST_CASE("Unit_hipGraphGetNodes_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphGetNodes_Positive_CapturedStream") { +TEST_CASE(Unit_hipGraphGetNodes_Positive_CapturedStream) { hipGraph_t graph{nullptr}; hipGraphExec_t graphExec{nullptr}; constexpr size_t N = 1000000; @@ -237,7 +224,7 @@ TEST_CASE("Unit_hipGraphGetNodes_Positive_CapturedStream") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphGetNodes_Negative_Parameters") { +TEST_CASE(Unit_hipGraphGetNodes_Negative_Parameters) { hipGraph_t graph{nullptr}; size_t numNodes{0}; diff --git a/catch/unit/graph/hipGraphGetNodes_old.cc b/catch/unit/graph/hipGraphGetNodes_old.cc deleted file mode 100644 index fdf5ea011..000000000 --- a/catch/unit/graph/hipGraphGetNodes_old.cc +++ /dev/null @@ -1,325 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/** -Testcase Scenarios ------------------- -Functional :: -1) Add nodes to graph and get nodes. Verify the added nodes are present in returned list. -2) Pass nodes as nullptr and verify numNodes returns actual number of nodes added to graph. -3) If numNodes passed is greater than the actual number of nodes, the remaining entries in nodes -will be set to NULL, and the number of nodes actually obtained will be returned in numNodes. -4) Begin stream capture and push operations to stream. Verify nodes of created graph are matching -the operations pushed. - -Argument Validation :: -1) Pass graph as nullptr and verify api returns error code. -2) Pass numNodes as nullptr and other params as valid values. Expect api to return error code. -3) When there are no nodes in graph, expect numNodes to be set to zero. -4) Pass numNodes less than actual number of nodes. Expect api to populate requested number of node -entries and does update numNodes. -*/ - -#include -#include -#include - -/** - * Functional Test for hipGraphGetNodes API fetching node list - */ -TEST_CASE("Unit_hipGraphGetNodes_Functional") { - constexpr size_t N = 1024; - constexpr size_t Nbytes = N * sizeof(int); - constexpr auto blocksPerCU = 6; // to hide latency - constexpr auto threadsPerBlock = 256; - constexpr auto addlEntries = 4; - hipGraph_t graph; - hipGraphNode_t memcpyNode, kernelNode; - hipKernelNodeParams kernelNodeParams{}; - hipStream_t streamForGraph; - int *A_d, *B_d, *C_d; - int *A_h, *B_h, *C_h; - std::vector dependencies, nodelist; - hipGraphExec_t graphExec; - size_t NElem{N}; - - HIP_CHECK(hipStreamCreate(&streamForGraph)); - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); - - HIP_CHECK(hipGraphCreate(&graph, 0)); - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyNode, graph, NULL, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - dependencies.push_back(memcpyNode); - nodelist.push_back(memcpyNode); - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyNode, graph, NULL, 0, B_d, B_h, Nbytes, - hipMemcpyHostToDevice)); - dependencies.push_back(memcpyNode); - nodelist.push_back(memcpyNode); - - void* kernelArgs[] = {&A_d, &B_d, &C_d, reinterpret_cast(&NElem)}; - kernelNodeParams.func = reinterpret_cast(HipTest::vectorADD); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernelNode, graph, dependencies.data(), dependencies.size(), - &kernelNodeParams)); - dependencies.clear(); - dependencies.push_back(kernelNode); - nodelist.push_back(kernelNode); - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyNode, graph, dependencies.data(), dependencies.size(), - C_h, C_d, Nbytes, hipMemcpyDeviceToHost)); - nodelist.push_back(memcpyNode); - - // Get numNodes by passing nodes as nullptr. - // verify : numNodes is set to actual number of nodes added - size_t numNodes{}; - HIP_CHECK(hipGraphGetNodes(graph, nullptr, &numNodes)); - INFO("Num of nodes returned by GetNodes : " << numNodes); - REQUIRE(numNodes == nodelist.size()); - - // Request for extra/additional nodes. - // verify : totNodes is reset to actual number of nodes - // verify : additional entries in nodes are set to nullptr - size_t totNodes = numNodes + addlEntries; - int numBytes = sizeof(hipGraphNode_t) * totNodes; - hipGraphNode_t* nodes = reinterpret_cast(malloc(numBytes)); - REQUIRE(nodes != nullptr); - HIP_CHECK(hipGraphGetNodes(graph, nodes, &totNodes)); - REQUIRE(totNodes == nodelist.size()); - for (auto i = numNodes; i < numNodes + addlEntries; i++) { - REQUIRE(nodes[i] == nullptr); - } - - // Verify added nodes are present in the node entries returned - for (auto Node : nodelist) { - bool found = false; - for (size_t i = 0; i < numNodes; i++) { - if (Node == nodes[i]) { - found = true; - break; - } - } - - if (!found) { - INFO("Added node " << Node << " not present in returned list"); - REQUIRE(false); - } - } - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, NULL, NULL, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Verify graph execution result - HipTest::checkVectorADD(A_h, B_h, C_h, N); - - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); - free(nodes); -} - -/** - * Begin stream capture and push operations to stream. - * Verify nodes of created graph are matching the operations pushed. - */ -TEST_CASE("Unit_hipGraphGetNodes_CapturedStream") { - hipGraph_t graph{nullptr}; - hipGraphExec_t graphExec{nullptr}; - constexpr size_t N = 1000000; - constexpr unsigned threadsPerBlock = 256; - constexpr unsigned blocks = - (N % threadsPerBlock == 0) ? (N / threadsPerBlock) : ((N / threadsPerBlock) + 1); - size_t Nbytes = N * sizeof(float); - constexpr int numMemcpy{2}, numKernel{1}, numMemset{1}; - int cntMemcpy{}, cntKernel{}, cntMemset{}; - hipStream_t stream, streamForGraph; - hipGraphNodeType nodeType; - float *A_d, *C_d; - float *A_h, *C_h; - - A_h = reinterpret_cast(malloc(Nbytes)); - C_h = reinterpret_cast(malloc(Nbytes)); - REQUIRE(A_h != nullptr); - REQUIRE(C_h != nullptr); - HIP_CHECK(hipMalloc(&A_d, Nbytes)); - HIP_CHECK(hipMalloc(&C_d, Nbytes)); - REQUIRE(A_d != nullptr); - REQUIRE(C_d != nullptr); - - HIP_CHECK(hipStreamCreate(&streamForGraph)); - // Initialize input buffer - for (size_t i = 0; i < N; ++i) { - A_h[i] = 3.146f + i; // Pi - } - - HIP_CHECK(hipStreamCreate(&stream)); - HIP_CHECK(hipStreamBeginCapture(stream, hipStreamCaptureModeGlobal)); - HIP_CHECK(hipMemcpyAsync(A_d, A_h, Nbytes, hipMemcpyHostToDevice, stream)); - HIP_CHECK(hipMemsetAsync(C_d, 0, Nbytes, stream)); - hipLaunchKernelGGL(HipTest::vector_square, dim3(blocks), dim3(threadsPerBlock), 0, stream, A_d, - C_d, N); - HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, stream)); - HIP_CHECK(hipStreamEndCapture(stream, &graph)); - REQUIRE(graph != nullptr); - - size_t numNodes{}; - HIP_CHECK(hipGraphGetNodes(graph, nullptr, &numNodes)); - INFO("Num of nodes returned by GetNodes : " << numNodes); - REQUIRE(numNodes == numMemcpy + numKernel + numMemset); - - int numBytes = sizeof(hipGraphNode_t) * numNodes; - hipGraphNode_t* nodes = reinterpret_cast(malloc(numBytes)); - REQUIRE(nodes != nullptr); - - HIP_CHECK(hipGraphGetNodes(graph, nodes, &numNodes)); - for (size_t i = 0; i < numNodes; i++) { - HIP_CHECK(hipGraphNodeGetType(nodes[i], &nodeType)); - - switch (nodeType) { - case hipGraphNodeTypeMemcpy: - cntMemcpy++; - break; - - case hipGraphNodeTypeKernel: - cntKernel++; - break; - - case hipGraphNodeTypeMemset: - cntMemset++; - break; - - default: - INFO("Unexpected nodetype returned : " << nodeType); - REQUIRE(false); - } - } - - REQUIRE(cntMemcpy == numMemcpy); - REQUIRE(cntKernel == numKernel); - REQUIRE(cntMemset == numMemset); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, NULL, NULL, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Validate the computation - for (size_t i = 0; i < N; i++) { - if (C_h[i] != A_h[i] * A_h[i]) { - INFO("A and C not matching at " << i << " C_h[i] " << C_h[i] << " A_h[i] " << A_h[i]); - REQUIRE(false); - } - } - - HIP_CHECK(hipStreamDestroy(streamForGraph)); - HIP_CHECK(hipStreamDestroy(stream)); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - free(A_h); - free(C_h); - free(nodes); - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipFree(C_d)); -} - -/** - * Test performs api parameter validation by passing various values - * as input and output parameters and validates the behavior. - * Test will include both negative and positive scenarios. - */ -TEST_CASE("Unit_hipGraphGetNodes_ParamValidation") { - hipStream_t stream{nullptr}; - hipGraph_t graph{nullptr}; - constexpr unsigned blocks = 512; - constexpr unsigned threadsPerBlock = 256; - constexpr size_t N = 1000000; - size_t Nbytes = N * sizeof(float), numNodes{}; - float *A_d, *C_d; - float *A_h, *C_h; - A_h = reinterpret_cast(malloc(Nbytes)); - C_h = reinterpret_cast(malloc(Nbytes)); - REQUIRE(A_h != nullptr); - REQUIRE(C_h != nullptr); - HIP_CHECK(hipMalloc(&A_d, Nbytes)); - HIP_CHECK(hipMalloc(&C_d, Nbytes)); - REQUIRE(A_d != nullptr); - REQUIRE(C_d != nullptr); - - HIP_CHECK(hipStreamCreate(&stream)); - HIP_CHECK(hipStreamBeginCapture(stream, hipStreamCaptureModeGlobal)); - HIP_CHECK(hipMemcpyAsync(A_d, A_h, Nbytes, hipMemcpyHostToDevice, stream)); - HIP_CHECK(hipMemsetAsync(C_d, 0, Nbytes, stream)); - hipLaunchKernelGGL(HipTest::vector_square, dim3(blocks), dim3(threadsPerBlock), 0, stream, A_d, - C_d, N); - HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, stream)); - HIP_CHECK(hipStreamEndCapture(stream, &graph)); - HIP_CHECK(hipGraphGetNodes(graph, nullptr, &numNodes)); - INFO("Num of nodes returned by GetNodes : " << numNodes); - - int numBytes = sizeof(hipGraphNode_t) * numNodes; - hipGraphNode_t* nodes = reinterpret_cast(malloc(numBytes)); - REQUIRE(nodes != nullptr); - - SECTION("graph as nullptr") { - hipError_t ret = hipGraphGetNodes(nullptr, nodes, &numNodes); - REQUIRE(ret == hipErrorInvalidValue); - } - - SECTION("numNodes as nullptr") { - hipError_t ret = hipGraphGetNodes(graph, nodes, nullptr); - REQUIRE(ret == hipErrorInvalidValue); - } - - SECTION("no nodes in graph") { - hipGraph_t emptyGraph{}; - HIP_CHECK(hipGraphCreate(&emptyGraph, 0)); - HIP_CHECK(hipGraphGetNodes(emptyGraph, nullptr, &numNodes)); - REQUIRE(numNodes == 0); - HIP_CHECK(hipGraphDestroy(emptyGraph)); - } - - SECTION("numNodes less than actual number of nodes") { - size_t numPartNodes = numNodes - 1; - hipGraphNodeType nodeType; - HIP_CHECK(hipGraphGetNodes(graph, nodes, &numPartNodes)); - - // verify numPartNodes is unchanged - REQUIRE(numPartNodes == numNodes - 1); - // verify partial node list returned has valid nodes - for (size_t i = 0; i < numPartNodes; i++) { - HIP_CHECK(hipGraphNodeGetType(nodes[i], &nodeType)); - REQUIRE(nodeType >= 0); - REQUIRE(nodeType < hipGraphNodeTypeCount); - } - } - - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(stream)); - free(A_h); - free(C_h); - free(nodes); - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipFree(C_d)); -} \ No newline at end of file diff --git a/catch/unit/graph/hipGraphGetRootNodes.cc b/catch/unit/graph/hipGraphGetRootNodes.cc index d77527cab..b1d69eb99 100644 --- a/catch/unit/graph/hipGraphGetRootNodes.cc +++ b/catch/unit/graph/hipGraphGetRootNodes.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -54,7 +41,7 @@ inline constexpr size_t kNumOfRootNodes = 3; * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphGetRootNodes_Positive_Functional") { +TEST_CASE(Unit_hipGraphGetRootNodes_Positive_Functional) { using namespace std::placeholders; constexpr size_t N = 1024; hipGraph_t graph; @@ -140,7 +127,7 @@ TEST_CASE("Unit_hipGraphGetRootNodes_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphGetRootNodes_Positive_CapturedStream") { +TEST_CASE(Unit_hipGraphGetRootNodes_Positive_CapturedStream) { hipStream_t streamForGraph{nullptr}; hipGraph_t graph{nullptr}; hipGraphExec_t graphExec{nullptr}; @@ -226,7 +213,7 @@ TEST_CASE("Unit_hipGraphGetRootNodes_Positive_CapturedStream") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphGetRootNodes_Negative_Parameters") { +TEST_CASE(Unit_hipGraphGetRootNodes_Negative_Parameters) { hipGraph_t graph{nullptr}; size_t numRootNodes{0}; diff --git a/catch/unit/graph/hipGraphGetRootNodes_old.cc b/catch/unit/graph/hipGraphGetRootNodes_old.cc index 62ac2e50a..07e3dbe31 100644 --- a/catch/unit/graph/hipGraphGetRootNodes_old.cc +++ b/catch/unit/graph/hipGraphGetRootNodes_old.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios @@ -52,7 +39,7 @@ static __global__ void dummyKernel() { return; } /** * Functional Test for API fetching root node list */ -TEST_CASE("Unit_hipGraphGetRootNodes_Functional") { +TEST_CASE(Unit_hipGraphGetRootNodes_Functional) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -155,7 +142,7 @@ TEST_CASE("Unit_hipGraphGetRootNodes_Functional") { * Create a graph with stream capture done on multiple dependent streams. Verify root nodes * of created graph are matching the operations pushed which doesn't have dependencies. */ -TEST_CASE("Unit_hipGraphGetRootNodes_CapturedStream") { +TEST_CASE(Unit_hipGraphGetRootNodes_CapturedStream) { hipStream_t stream1{nullptr}, stream2{nullptr}, mstream{nullptr}; hipStream_t streamForGraph{nullptr}; hipEvent_t memsetEvent1, memsetEvent2, forkStreamEvent; @@ -261,7 +248,7 @@ TEST_CASE("Unit_hipGraphGetRootNodes_CapturedStream") { * as input and output parameters and validates the behavior. * Test will include both negative and positive scenarios. */ -TEST_CASE("Unit_hipGraphGetRootNodes_ParamValidation") { +TEST_CASE(Unit_hipGraphGetRootNodes_ParamValidation) { hipStream_t stream1{nullptr}, stream2{nullptr}, mstream{nullptr}; hipEvent_t memsetEvent1, memsetEvent2, forkStreamEvent; hipGraph_t graph{nullptr}; @@ -358,7 +345,7 @@ TEST_CASE("Unit_hipGraphGetRootNodes_ParamValidation") { * Functional Test to validate number of root nodes when dependencies * in the graph are dynamically varied. */ -TEST_CASE("Unit_hipGraphGetRootNodes_Complx_NumRootNodes") { +TEST_CASE(Unit_hipGraphGetRootNodes_Complx_NumRootNodes) { hipGraph_t graph; hipGraphNode_t kernelnode[NUM_OF_DUMMY_NODES]; hipKernelNodeParams kernelNodeParams[NUM_OF_DUMMY_NODES]; @@ -391,7 +378,7 @@ TEST_CASE("Unit_hipGraphGetRootNodes_Complx_NumRootNodes") { * Functional Test to validate number of root nodes when dependencies * in the graph are dynamically varied in a cloned graph. */ -TEST_CASE("Unit_hipGraphGetRootNodes_Complx_NumRootNodes_ClonedGrph") { +TEST_CASE(Unit_hipGraphGetRootNodes_Complx_NumRootNodes_ClonedGrph) { hipGraph_t graph, clonedgraph; hipGraphNode_t kernelnode[NUM_OF_DUMMY_NODES]; hipKernelNodeParams kernelNodeParams[NUM_OF_DUMMY_NODES]; @@ -429,7 +416,7 @@ TEST_CASE("Unit_hipGraphGetRootNodes_Complx_NumRootNodes_ClonedGrph") { * Functional Test to validate number of root nodes when a graph with N * independent nodes is added as a child node to another graph. */ -TEST_CASE("Unit_hipGraphGetRootNodes_Complx_NRootNodesAsChildGraph") { +TEST_CASE(Unit_hipGraphGetRootNodes_Complx_NRootNodesAsChildGraph) { hipGraph_t graph, graph1; hipGraphNode_t kernelnode[NUM_OF_DUMMY_NODES]; hipKernelNodeParams kernelNodeParams[NUM_OF_DUMMY_NODES]; diff --git a/catch/unit/graph/hipGraphHostNodeGetParams.cc b/catch/unit/graph/hipGraphHostNodeGetParams.cc index 41b367414..fac6dd827 100644 --- a/catch/unit/graph/hipGraphHostNodeGetParams.cc +++ b/catch/unit/graph/hipGraphHostNodeGetParams.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Test Case Scenarios of hipGraphHostNodeGetParams API: @@ -59,7 +44,7 @@ static void callbackfunc_setparams(void* B_h) { This test case verifies the negative scenarios of hipGraphHostNodeGetParams API */ -TEST_CASE("Unit_hipGraphHostNodeGetParams_Negative") { +TEST_CASE(Unit_hipGraphHostNodeGetParams_Negative) { constexpr size_t N = 1024; hipGraph_t graph; int *A_d{nullptr}, *C_d{nullptr}; @@ -102,7 +87,7 @@ Add HostNode to the cloned graph, update hostNode using hipGraphHostNodeSetParam then get the host node params using hipGraphHostNodeGetParams API and compare it. */ -TEST_CASE("Unit_hipGraphHostNodeGetParams_ClonedGraphWithHostNode") { +TEST_CASE(Unit_hipGraphHostNodeGetParams_ClonedGraphWithHostNode) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; @@ -246,7 +231,7 @@ This test case verifies hipGraphHostNodeGetParams API by adding host node to graph and gets the host params and validates it */ -TEST_CASE("Unit_hipGraphHostNodeGetParams_BasicFunc") { hipGraphHostNodeGetParams_func(false); } +TEST_CASE(Unit_hipGraphHostNodeGetParams_BasicFunc) { hipGraphHostNodeGetParams_func(false); } /* This test case verifies hipGraphHostNodeGetParams API by @@ -254,4 +239,4 @@ adding host node to graph, updates host node params using hipGraphHostNodeSetParams and gets the host params validates it */ -TEST_CASE("Unit_hipGraphHostNodeGetParams_SetParams") { hipGraphHostNodeGetParams_func(true); } +TEST_CASE(Unit_hipGraphHostNodeGetParams_SetParams) { hipGraphHostNodeGetParams_func(true); } diff --git a/catch/unit/graph/hipGraphHostNodeSetParams.cc b/catch/unit/graph/hipGraphHostNodeSetParams.cc index e526fce20..2ffe9b055 100644 --- a/catch/unit/graph/hipGraphHostNodeSetParams.cc +++ b/catch/unit/graph/hipGraphHostNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Test Case Scenarios of hipGraphHostNodeSetParams API: @@ -59,7 +44,7 @@ static void callbackfunc_setparams(void* B_h) { This test case verifies the negative scenarios of hipGraphHostNodeSetParams API */ -TEST_CASE("Unit_hipGraphHostNodeSetParams_Negative") { +TEST_CASE(Unit_hipGraphHostNodeSetParams_Negative) { constexpr size_t N = 1024; hipGraph_t graph; int *A_d{nullptr}, *C_d{nullptr}; @@ -110,7 +95,7 @@ Creates graph, Add graph nodes and clone the graph Add HostNode to the cloned graph,update the host params using hipGraphHostNodeSetParams API and validates the result */ -TEST_CASE("Unit_hipGraphHostNodeSetParams_ClonedGraphWithHostNode") { +TEST_CASE(Unit_hipGraphHostNodeSetParams_ClonedGraphWithHostNode) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; @@ -170,7 +155,7 @@ Create graph, Adds host node to the graph, updates the host params using hipGraphHostNodeSetParams API and validates the result */ -TEST_CASE("Unit_hipGraphHostNodeSetParams_BasicFunc") { +TEST_CASE(Unit_hipGraphHostNodeSetParams_BasicFunc) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; diff --git a/catch/unit/graph/hipGraphInstantiate.cc b/catch/unit/graph/hipGraphInstantiate.cc index 4d63692f8..5434536bc 100644 --- a/catch/unit/graph/hipGraphInstantiate.cc +++ b/catch/unit/graph/hipGraphInstantiate.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -53,7 +40,7 @@ Negative - /* Test verifies hipGraphInstantiate API Negative scenarios. */ -TEST_CASE("Unit_hipGraphInstantiate_Negative") { +TEST_CASE(Unit_hipGraphInstantiate_Negative) { hipError_t ret; hipGraphExec_t gExec{}; hipGraph_t graph; @@ -83,7 +70,7 @@ TEST_CASE("Unit_hipGraphInstantiate_Negative") { /* Test verifies hipGraphInstantiate Basic scenarios. Create a graph and then used it for hipGraphInstantiate without adding any node to graph. */ -TEST_CASE("Unit_hipGraphInstantiate_Basic") { +TEST_CASE(Unit_hipGraphInstantiate_Basic) { hipGraph_t graph; hipGraphExec_t graphExec; @@ -98,7 +85,7 @@ TEST_CASE("Unit_hipGraphInstantiate_Basic") { /* Test Functional Scenario 2.a, 2.b, 2.c with hipGraphInstantiate and hipGraphInstantiateWithFlags. */ -TEST_CASE("Unit_hipGraphInstantiate_InvalidCyclicGraph") { +TEST_CASE(Unit_hipGraphInstantiate_InvalidCyclicGraph) { hipGraph_t graph; hipGraphExec_t graphExec; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -194,7 +181,7 @@ static void init_input(int* a, size_t size) { /* Test Functional Scenario 3.a, 3.b and 3.c. */ -TEST_CASE("Unit_hipGraphInstantiate_functionalScenarios") { +TEST_CASE(Unit_hipGraphInstantiate_functionalScenarios) { hipGraph_t graph; hipGraphExec_t graphExec[NUM_OF_INSTANCES]; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphInstantiateWithFlags.cc b/catch/unit/graph/hipGraphInstantiateWithFlags.cc index 121b1a5d0..1ec125a88 100644 --- a/catch/unit/graph/hipGraphInstantiateWithFlags.cc +++ b/catch/unit/graph/hipGraphInstantiateWithFlags.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* hipGraphInstantiateWithFlags(hipGraphExec_t* pGraphExec, hipGraph_t graph, unsigned long long @@ -65,7 +52,7 @@ static __global__ void doubleKernel(int* arr, int size) { /* This test covers the negative scenarios of hipGraphInstantiateWithFlags API */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_Negative") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_Negative) { SECTION("Passing nullptr pGraphExec") { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -259,7 +246,7 @@ This testcase verifies hipGraphInstantiateWithFlags API by creating dependency graph and instantiate, launching and verifying the result */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_DependencyGraph") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_DependencyGraph) { GraphInstantiateWithFlags_DependencyGraph(); } @@ -268,7 +255,7 @@ This testcase verifies hipGraphInstantiateWithFlags API by creating dependency graph on GPU-0 and instantiate, launching and verifying the result on GPU-1 */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_DependencyGraphDeviceCtxtChg", "[multigpu]") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_DependencyGraphDeviceCtxtChg) { int numDevices = 0; int canAccessPeer = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -289,7 +276,7 @@ This testcase verifies hipGraphInstantiateWithFlags API by creating capture graph and instantiate, launching and verifying the result */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_StreamCapture") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_StreamCapture) { int numDevices = 0; int canAccessPeer = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -310,7 +297,7 @@ This testcase verifies hipGraphInstantiateWithFlags API by creating capture graph on GPU-0 and instantiate, launching and verifying the result on GPU-1 */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_StreamCaptureDeviceContextChg", "[multigpu]") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_StreamCaptureDeviceContextChg) { int numDevices = 0; int canAccessPeer = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -335,7 +322,7 @@ Note - This test case is just to check if hipGraphInstantiateFlagAutoFreeOnLaunc is not resulting in compilation error or api failure. Real functional test will be added once the feature is fully implemented. */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_FlagAutoFreeOnLaunch_check") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_FlagAutoFreeOnLaunch_check) { constexpr size_t size = 512 * 1024 * 1024; constexpr size_t Nbytes = size * sizeof(int); @@ -409,7 +396,7 @@ TEST_CASE("Unit_hipGraphInstantiateWithFlags_FlagAutoFreeOnLaunch_check") { * ------------------------ * - unit/graph/hipGraphInstantiateWithFlags.cc */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_AutoFreeOnLaunchInLoop") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_AutoFreeOnLaunchInLoop) { constexpr size_t NBytes = 1024 * 1024 * 1024; void* devMem = nullptr; @@ -471,7 +458,7 @@ TEST_CASE("Unit_hipGraphInstantiateWithFlags_AutoFreeOnLaunchInLoop") { * ------------------------ * - unit/graph/hipGraphInstantiateWithFlags.cc */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_AutoFreeOnLaunchFillKernel") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_AutoFreeOnLaunchFillKernel) { int value = 100; int* hostMemDst = new int[SIZE]; @@ -564,7 +551,7 @@ TEST_CASE("Unit_hipGraphInstantiateWithFlags_AutoFreeOnLaunchFillKernel") { * ------------------------ * - unit/graph/hipGraphInstantiateWithFlags.cc */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_AutoFreeOnLaunchDoubleKernel") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_AutoFreeOnLaunchDoubleKernel) { int* hostMemSrc = new int[SIZE]; REQUIRE(hostMemSrc != nullptr); @@ -671,7 +658,7 @@ TEST_CASE("Unit_hipGraphInstantiateWithFlags_AutoFreeOnLaunchDoubleKernel") { * ------------------------ * - unit/graph/hipGraphInstantiateWithFlags.cc */ -TEST_CASE("Unit_hipGraphInstantiateWithFlags_WithDefaultAndAutoFreeOnLaunch") { +TEST_CASE(Unit_hipGraphInstantiateWithFlags_WithDefaultAndAutoFreeOnLaunch) { int* hostMem1 = new int[SIZE]; REQUIRE(hostMem1 != nullptr); int* hostMem2 = new int[SIZE]; diff --git a/catch/unit/graph/hipGraphInstantiateWithParams.cc b/catch/unit/graph/hipGraphInstantiateWithParams.cc index f1dc3f0e0..ac96dca94 100644 --- a/catch/unit/graph/hipGraphInstantiateWithParams.cc +++ b/catch/unit/graph/hipGraphInstantiateWithParams.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* hipGraphInstantiateWithParams(hipGraphExec_t* pGraphExec, hipGraph_t graph, @@ -51,7 +38,7 @@ constexpr size_t N = 1000000; * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGraphInstantiateWithParams_Negative") { +TEST_CASE(Unit_hipGraphInstantiateWithParams_Negative) { SECTION("Passing nullptr pGraphExec") { hipGraph_t graph; hipGraphInstantiateParams params; @@ -256,7 +243,7 @@ void GraphInstantiateWithParams_StreamCapture() { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGraphInstantiateWithParams_DependencyGraph") { +TEST_CASE(Unit_hipGraphInstantiateWithParams_DependencyGraph) { GraphInstantiateWithParams_DependencyGraph(); } @@ -274,7 +261,7 @@ TEST_CASE("Unit_hipGraphInstantiateWithParams_DependencyGraph") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGraphInstantiateWithParams_StreamCapture") { +TEST_CASE(Unit_hipGraphInstantiateWithParams_StreamCapture) { GraphInstantiateWithParams_StreamCapture(); } diff --git a/catch/unit/graph/hipGraphKernelNodeCopyAttributes.cc b/catch/unit/graph/hipGraphKernelNodeCopyAttributes.cc index 78cf567d3..b18b09cf0 100644 --- a/catch/unit/graph/hipGraphKernelNodeCopyAttributes.cc +++ b/catch/unit/graph/hipGraphKernelNodeCopyAttributes.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -58,7 +45,7 @@ static bool validateKernelNodeAttrValue(hipKernelNodeAttrValue in, hipKernelNode return true; } -TEST_CASE("Unit_hipGraphKernelNodeCopyAttributes_Functional") { +TEST_CASE(Unit_hipGraphKernelNodeCopyAttributes_Functional) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -212,7 +199,7 @@ TEST_CASE("Unit_hipGraphKernelNodeCopyAttributes_Functional") { *  - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipGraphKernelNodeCopyAttributes_Attribute_Negative") { +TEST_CASE(Unit_hipGraphKernelNodeCopyAttributes_Attribute_Negative) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency diff --git a/catch/unit/graph/hipGraphKernelNodeGetAttribute.cc b/catch/unit/graph/hipGraphKernelNodeGetAttribute.cc index 7051853e7..793bc0957 100644 --- a/catch/unit/graph/hipGraphKernelNodeGetAttribute.cc +++ b/catch/unit/graph/hipGraphKernelNodeGetAttribute.cc @@ -1,31 +1,15 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include #define THREADS_PER_BLOCK 512 -TEST_CASE("Unit_hipGraphKernelNodeGetAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipGraphKernelNodeGetAttribute_Negative_Parameters) { constexpr int N = 1024; int *A_d, *B_d, *C_d; diff --git a/catch/unit/graph/hipGraphKernelNodeGetParams.cc b/catch/unit/graph/hipGraphKernelNodeGetParams.cc index 810576865..9bb336a43 100644 --- a/catch/unit/graph/hipGraphKernelNodeGetParams.cc +++ b/catch/unit/graph/hipGraphKernelNodeGetParams.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Test Case Scenarios : @@ -38,7 +23,7 @@ Functional - /* Test verifies hipGraphKernelNodeGetParams API Negative scenarios. */ -TEST_CASE("Unit_hipGraphKernelNodeGetParams_Negative") { +TEST_CASE(Unit_hipGraphKernelNodeGetParams_Negative) { constexpr int N = 1024; size_t NElem{N}; int *A_d, *B_d, *C_d; @@ -106,7 +91,7 @@ static bool node_compare(hipKernelNodeParams* kNode1, hipKernelNodeParams* kNode /* Test verifies hipGraphKernelNodeGetParams API Functional scenarios. */ -TEST_CASE("Unit_hipGraphKernelNodeGetParams_Functional") { +TEST_CASE(Unit_hipGraphKernelNodeGetParams_Functional) { constexpr int N = 1024; size_t NElem{N}; int *A_d, *B_d, *C_d; diff --git a/catch/unit/graph/hipGraphKernelNodeSetAttribute.cc b/catch/unit/graph/hipGraphKernelNodeSetAttribute.cc index 6a3d5580b..e7c3df447 100644 --- a/catch/unit/graph/hipGraphKernelNodeSetAttribute.cc +++ b/catch/unit/graph/hipGraphKernelNodeSetAttribute.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -39,7 +23,7 @@ static bool CompareAccessPolicyWindow(const hipKernelNodeAttrValue& lhs, lhs.accessPolicyWindow.missProp == rhs.accessPolicyWindow.missProp; } -TEST_CASE("Unit_hipGraphKernelNodeSetAttribute_Positive_AccessPolicyWindow") { +TEST_CASE(Unit_hipGraphKernelNodeSetAttribute_Positive_AccessPolicyWindow) { constexpr int N = 1024; const auto hit_prop = GENERATE(from_range(begin(kAccessProperties), end(kAccessProperties))); @@ -93,7 +77,7 @@ TEST_CASE("Unit_hipGraphKernelNodeSetAttribute_Positive_AccessPolicyWindow") { HIP_CHECK(hipFree(C_d)); } -TEST_CASE("Unit_hipGraphKernelNodeSetAttribute_Positive_Cooperative") { +TEST_CASE(Unit_hipGraphKernelNodeSetAttribute_Positive_Cooperative) { constexpr int N = 1024; int *A_d, *B_d, *C_d; @@ -135,7 +119,7 @@ TEST_CASE("Unit_hipGraphKernelNodeSetAttribute_Positive_Cooperative") { HIP_CHECK(hipFree(C_d)); } -TEST_CASE("Unit_hipGraphKernelNodeSetAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipGraphKernelNodeSetAttribute_Negative_Parameters) { constexpr int N = 1024; int *A_d, *B_d, *C_d; diff --git a/catch/unit/graph/hipGraphKernelNodeSetAttribute_old.cc b/catch/unit/graph/hipGraphKernelNodeSetAttribute_old.cc index 95bed61f7..fa3281f06 100644 --- a/catch/unit/graph/hipGraphKernelNodeSetAttribute_old.cc +++ b/catch/unit/graph/hipGraphKernelNodeSetAttribute_old.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -57,7 +44,7 @@ static bool validateKernelNodeAttrValue(hipKernelNodeAttrValue in, hipKernelNode return true; } -TEST_CASE("Unit_hipGraphKernelNodeSetAttribute_Functional") { +TEST_CASE(Unit_hipGraphKernelNodeSetAttribute_Functional) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -206,7 +193,7 @@ TEST_CASE("Unit_hipGraphKernelNodeSetAttribute_Functional") { *  - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipGraphKernelNodeSetAttribute_Negative") { +TEST_CASE(Unit_hipGraphKernelNodeSetAttribute_Negative) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency diff --git a/catch/unit/graph/hipGraphKernelNodeSetParams.cc b/catch/unit/graph/hipGraphKernelNodeSetParams.cc index eb561c05e..686f1a990 100644 --- a/catch/unit/graph/hipGraphKernelNodeSetParams.cc +++ b/catch/unit/graph/hipGraphKernelNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Test Case Scenarios : @@ -38,7 +23,7 @@ Functional - /* Test verifies hipGraphKernelNodeSetParams API Negative scenarios. */ -TEST_CASE("Unit_hipGraphKernelNodeSetParams_Negative") { +TEST_CASE(Unit_hipGraphKernelNodeSetParams_Negative) { constexpr int N = 1024; size_t NElem{N}; constexpr auto blocksPerCU = 6; // to hide latency @@ -101,7 +86,7 @@ TEST_CASE("Unit_hipGraphKernelNodeSetParams_Negative") { /** * Functional Test for API Set Kernel Params */ -TEST_CASE("Unit_hipGraphKernelNodeSetParams_Functional") { +TEST_CASE(Unit_hipGraphKernelNodeSetParams_Functional) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -264,7 +249,7 @@ class GraphKernelNodeGetSetParam { } }; -TEST_CASE("Unit_hipGraphKernelNodeGetSetParams_Functional") { +TEST_CASE(Unit_hipGraphKernelNodeGetSetParams_Functional) { hipGraph_t* graph; hipStream_t streamForGraph; hipGraphExec_t graphExec; diff --git a/catch/unit/graph/hipGraphLaunch.cc b/catch/unit/graph/hipGraphLaunch.cc index 7e194c710..417bc2514 100644 --- a/catch/unit/graph/hipGraphLaunch.cc +++ b/catch/unit/graph/hipGraphLaunch.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -85,7 +72,7 @@ static void HipGraphLaunch_Positive_Simple(hipStream_t stream) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphLaunch_Positive") { +TEST_CASE(Unit_hipGraphLaunch_Positive) { SECTION("stream as a created stream") { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); @@ -113,7 +100,7 @@ TEST_CASE("Unit_hipGraphLaunch_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphLaunch_Negative_Parameters") { +TEST_CASE(Unit_hipGraphLaunch_Negative_Parameters) { SECTION("graphExec is nullptr and stream is a created stream") { hipStream_t stream; hipError_t ret; diff --git a/catch/unit/graph/hipGraphLaunch_old.cc b/catch/unit/graph/hipGraphLaunch_old.cc index a0b70b924..0921affef 100644 --- a/catch/unit/graph/hipGraphLaunch_old.cc +++ b/catch/unit/graph/hipGraphLaunch_old.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -42,155 +29,6 @@ Functional Scenario - #define SIZE 1024 #define TEST_LOOP_SIZE 3 -TEST_CASE("Unit_hipGraphLaunch_Negative") { - hipError_t ret; - SECTION("Pass pGraphExec as nullptr") { - hipStream_t stream{}; - ret = hipGraphLaunch(nullptr, stream); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("Pass pGraphExec as nullptr and stream as hipStreamPerThread") { - ret = hipGraphLaunch(nullptr, hipStreamPerThread); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("Pass pGraphExec as empty object") { - hipGraphExec_t graphExec{}; - hipStream_t stream{}; - ret = hipGraphLaunch(graphExec, stream); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("Destroy executable graph and try to launch it") { - constexpr size_t Nbytes = 1024; - hipGraph_t graph; - hipGraphExec_t graphExec; - hipStream_t stream; - hipGraphNode_t memsetNode; - - char* devData; - HIP_CHECK(hipMalloc(&devData, Nbytes)); - - HIP_CHECK(hipGraphCreate(&graph, 0)); - HIP_CHECK(hipStreamCreate(&stream)); - - hipMemsetParams memsetParams{}; - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(devData); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memsetNode, graph, nullptr, 0, &memsetParams)); - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - - HIP_CHECK(hipGraphExecDestroy(graphExec)); - // Launch again after destroy graph exec object. - ret = hipGraphLaunch(graphExec, stream); - REQUIRE(hipErrorInvalidValue == ret); - - HIP_CHECK(hipFree(devData)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(stream)); - } - SECTION("Destroy graph and try to launch respective executable graph") { - constexpr size_t Nbytes = 1024; - hipGraph_t graph; - hipGraphExec_t graphExec; - hipStream_t stream; - hipGraphNode_t memsetNode; - - char* devData; - HIP_CHECK(hipMalloc(&devData, Nbytes)); - - HIP_CHECK(hipGraphCreate(&graph, 0)); - HIP_CHECK(hipStreamCreate(&stream)); - - hipMemsetParams memsetParams{}; - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(devData); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memsetNode, graph, nullptr, 0, &memsetParams)); - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - - HIP_CHECK(hipGraphDestroy(graph)); - // Launch again after destroy graph - ret = hipGraphLaunch(graphExec, stream); - REQUIRE(hipSuccess == ret); - - HIP_CHECK(hipFree(devData)); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipStreamDestroy(stream)); - } -} - -TEST_CASE("Unit_hipGraphLaunch_Functional_hipStreamPerThread") { - constexpr size_t N = 1024; - constexpr size_t Nbytes = N * sizeof(char); - constexpr size_t val = 0; - constexpr size_t updateVal = 2; - char *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; - char *A_h{nullptr}, *B_h{nullptr}; - - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, nullptr, N, false); - - hipGraph_t graph; - hipGraphExec_t graphExec; - hipGraphNode_t memsetNode; - - HIP_CHECK(hipGraphCreate(&graph, 0)); - - hipMemsetParams memsetParams{}; - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(C_d); - memsetParams.value = val; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memsetNode, graph, nullptr, 0, &memsetParams)); - - std::vector dependencies; - dependencies.push_back(memsetNode); - - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(A_d); - memsetParams.value = updateVal; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memsetNode, graph, dependencies.data(), dependencies.size(), - &memsetParams)); - HIP_CHECK(hipGraphMemsetNodeSetParams(memsetNode, &memsetParams)); - dependencies.push_back(memsetNode); - - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, hipStreamPerThread)); - HIP_CHECK(hipStreamSynchronize(hipStreamPerThread)); - - HIP_CHECK(hipMemcpy(A_h, A_d, Nbytes, hipMemcpyDeviceToHost)); - - // Validating the result - for (size_t i = 0; i < Nbytes; i++) { - if (A_h[i] != updateVal) { - WARN("Validation failed at- " << i << " A_h[i] " << A_h[i]); - REQUIRE(false); - } - } - - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, nullptr, false); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); -} - static void hipGraphLaunch_test() { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(char); @@ -254,7 +92,7 @@ static void hipGraphLaunch_test() { HIP_CHECK(hipStreamDestroy(streamForGraph)); } -TEST_CASE("Unit_hipGraphLaunch_Functional_multidevice_test", "[multigpu]") { +TEST_CASE(Unit_hipGraphLaunch_Functional_multidevice_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -290,7 +128,7 @@ static void validateOutData(int* A1_h, int* A2_h, size_t N) { * 2.Create a graph with multiple nodes. Create an executable graph. * Verify if an executable graph be launched on null stream. */ -TEST_CASE("Unit_hipGraphLaunch_Functional_MultipleLaunch") { +TEST_CASE(Unit_hipGraphLaunch_Functional_MultipleLaunch) { size_t memSize = SIZE; constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; diff --git a/catch/unit/graph/hipGraphMemAllocNodeGetParams.cc b/catch/unit/graph/hipGraphMemAllocNodeGetParams.cc index eb585f885..da8a43fde 100644 --- a/catch/unit/graph/hipGraphMemAllocNodeGetParams.cc +++ b/catch/unit/graph/hipGraphMemAllocNodeGetParams.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipGraphMemAllocNodeGetParams hipGraphMemAllocNodeGetParams @@ -131,12 +118,11 @@ static void hipGraphMemAllocNodeGetParams_Functional(unsigned deviceId = 0) { *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional") { +TEST_CASE(Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional) { hipGraphMemAllocNodeGetParams_Functional(); } -TEST_CASE("Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional_MultiDevice", - "[multigpu]") { +TEST_CASE(Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional_MultiDevice) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -164,7 +150,7 @@ TEST_CASE("Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional_MultiDevice", *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional_2") { +TEST_CASE(Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional_2) { constexpr size_t N = 1024 * 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -277,7 +263,7 @@ TEST_CASE("Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional_2") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional_3") { +TEST_CASE(Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional_3) { constexpr auto element_count{512 * 1024 * 1024}; constexpr size_t num_bytes = element_count * sizeof(int); @@ -370,7 +356,7 @@ TEST_CASE("Unit_hipGraphMem_Alloc_Free_NodeGetParams_Functional_3") { * ------------------------ *  - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphMem_Alloc_Free_NodeGetParams_Negative") { +TEST_CASE(Unit_hipGraphMem_Alloc_Free_NodeGetParams_Negative) { hipError_t ret; constexpr size_t N = 1024 * 1024; constexpr size_t Nbytes = N * sizeof(int); diff --git a/catch/unit/graph/hipGraphMemFreeNodeGetParams.cc b/catch/unit/graph/hipGraphMemFreeNodeGetParams.cc index 4a37bb8dd..a7cd92d8b 100644 --- a/catch/unit/graph/hipGraphMemFreeNodeGetParams.cc +++ b/catch/unit/graph/hipGraphMemFreeNodeGetParams.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -38,7 +25,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphMemFreeNodeGetParams_ValidArgs") { +TEST_CASE(Unit_hipGraphMemFreeNodeGetParams_ValidArgs) { hipGraphNode_t allocNode, freeNode; hipGraph_t graph; hipGraphExec_t graphExec; @@ -85,7 +72,7 @@ TEST_CASE("Unit_hipGraphMemFreeNodeGetParams_ValidArgs") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraphMemFreeNodeGetParams_InvalidArgs") { +TEST_CASE(Unit_hipGraphMemFreeNodeGetParams_InvalidArgs) { hipGraphNode_t allocNode, freeNode; hipMemAllocNodeParams allocParam; hipGraph_t graph; diff --git a/catch/unit/graph/hipGraphMemcpyNodeGetParams.cc b/catch/unit/graph/hipGraphMemcpyNodeGetParams.cc index c5c7e2bd4..7dcc63835 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeGetParams.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeGetParams.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -49,7 +33,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemcpyNodeGetParams_Negative_Parameters") { +TEST_CASE(Unit_hipGraphMemcpyNodeGetParams_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr hipExtent extent{128 * sizeof(int), 128, 8}; diff --git a/catch/unit/graph/hipGraphMemcpyNodeGetParams_old.cc b/catch/unit/graph/hipGraphMemcpyNodeGetParams_old.cc index e15156422..418209feb 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeGetParams_old.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeGetParams_old.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -38,7 +25,7 @@ Functional - /* Test verifies hipGraphMemcpyNodeGetParams API Negative scenarios. */ -TEST_CASE("Unit_hipGraphMemcpyNodeGetParams_Negative") { +TEST_CASE(Unit_hipGraphMemcpyNodeGetParams_Negative) { CHECK_IMAGE_SUPPORT constexpr int width{SIZE}, height{SIZE}, depth{SIZE}; @@ -134,7 +121,7 @@ static bool memcpyNodeCompare(hipMemcpy3DParms* mNode1, hipMemcpy3DParms* mNode2 return true; } -TEST_CASE("Unit_hipGraphMemcpyNodeGetParams_Functional") { +TEST_CASE(Unit_hipGraphMemcpyNodeGetParams_Functional) { CHECK_IMAGE_SUPPORT constexpr int width{SIZE}, height{SIZE}, depth{SIZE}; diff --git a/catch/unit/graph/hipGraphMemcpyNodeSetParams.cc b/catch/unit/graph/hipGraphMemcpyNodeSetParams.cc index 241f86edd..aa7f9c41a 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeSetParams.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeSetParams.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -51,7 +35,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParams_Positive_Basic") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParams_Positive_Basic) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -112,17 +96,21 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParams_Positive_Basic") { * ------------------------ * - Verify API behaviour with invalid arguments: * -# node is nullptr - * -# graph is nullptr - * -# pDependencies is nullptr when numDependencies is not zero - * -# A node in pDependencies originates from a different graph - * -# numDependencies is invalid - * -# A node is duplicated in pDependencies + * -# pNodeParams is nullptr + * -# node is uninitialized * -# dst is nullptr * -# src is nullptr + * -# dst pitch is less than width + * -# src pitch is less than width + * -# dst pitch exceeds max pitch + * -# src pitch exceeds max pitch + * -# extent width + dst position exceeds dst pitch + * -# extent width + src position exceeds src pitch + * -# dst position y is out of bounds + * -# src position y is out of bounds + * -# dst position z is out of bounds + * -# src position z is out of bounds * -# kind is an invalid enum value - * -# count is zero - * -# count is larger than dst allocation size - * -# count is larger than src allocation size * Test source * ------------------------ * - unit/graph/hipGraphAddMemcpyNode.cc @@ -130,7 +118,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParams_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParams_Negative_Parameters") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParams_Negative_Parameters) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -151,6 +139,16 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParams_Negative_Parameters") { HIP_CHECK_ERROR(hipGraphMemcpyNodeSetParams(nullptr, ¶ms), hipErrorInvalidValue); } + SECTION("pNodeParams == nullptr") { + HIP_CHECK_ERROR(hipGraphMemcpyNodeSetParams(node, nullptr), hipErrorInvalidValue); + } + + SECTION("Uninitialized node") { + hipGraphNode_t node_uninit{}; + params = GetMemcpy3DParms(dst_ptr, dst_pos, src_ptr, src_pos, extent, kind); + HIP_CHECK_ERROR(hipGraphMemcpyNodeSetParams(node_uninit, ¶ms), hipErrorInvalidValue); + } + SECTION("dst_ptr.ptr == nullptr") { hipPitchedPtr invalid_ptr = dst_ptr; invalid_ptr.ptr = nullptr; diff --git a/catch/unit/graph/hipGraphMemcpyNodeSetParams1D.cc b/catch/unit/graph/hipGraphMemcpyNodeSetParams1D.cc index 755ecbd03..e60326e91 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeSetParams1D.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeSetParams1D.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -61,7 +46,7 @@ static inline hipMemcpyKind ReverseMemcpyDirection(const hipMemcpyKind direction * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParams1D_Positive_Basic") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParams1D_Positive_Basic) { constexpr auto f = [](void* dst, void* src, size_t count, hipMemcpyKind direction) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -154,7 +139,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParams1D_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParams1D_Negative_Parameters") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParams1D_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphMemcpyNodeSetParams1D_old.cc b/catch/unit/graph/hipGraphMemcpyNodeSetParams1D_old.cc index 4b44e1f1d..cec2a9950 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeSetParams1D_old.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeSetParams1D_old.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -38,7 +25,7 @@ size for source and destination ptr, api should return error code. /* Test verifies hipGraphMemcpyNodeSetParams1D API Negative scenarios. */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParams1D_Negative") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParams1D_Negative) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); int *A_d, *A_h; @@ -107,7 +94,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParams1D_Negative") { /* Test verifies hipGraphMemcpyNodeSetParams1D API Functional scenarios. */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParams1D_Functional") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParams1D_Functional) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency diff --git a/catch/unit/graph/hipGraphMemcpyNodeSetParamsFromSymbol.cc b/catch/unit/graph/hipGraphMemcpyNodeSetParamsFromSymbol.cc index 0152fc4e0..e8c26e910 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeSetParamsFromSymbol.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeSetParamsFromSymbol.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -95,7 +80,7 @@ void GraphMemcpyFromSymbolSetParamsShell(const void* symbol, const void* alt_sym * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Positive_Basic") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Positive_Basic) { SECTION("char") { HIP_GRAPH_MEMCPY_NODE_SET_PARAMS_TO_FROM_SYMBOL_TEST(GraphMemcpyFromSymbolSetParamsShell, 1, char); @@ -136,7 +121,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Negative_Parameters") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphMemcpyNodeSetParamsFromSymbol_old.cc b/catch/unit/graph/hipGraphMemcpyNodeSetParamsFromSymbol_old.cc index 4087a2875..3cd2ef18b 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeSetParamsFromSymbol_old.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeSetParamsFromSymbol_old.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios of hipGraphMemcpyNodeSetParamsFromSymbol API: @@ -50,7 +37,7 @@ __device__ __constant__ int globalConst[SIZE]; /* Test verifies hipGraphMemcpyNodeSetParamsFromSymbol API Negative scenarios. */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Negative") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Negative) { constexpr size_t Nbytes = SIZE * sizeof(int); int *A_d{nullptr}, *B_d{nullptr}; int *A_h{nullptr}, *B_h{nullptr}; @@ -122,91 +109,3 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Negative") { HipTest::freeArrays(A_d, B_d, nullptr, A_h, B_h, nullptr, false); HIP_CHECK(hipGraphDestroy(graph)); } - -static void hipGraphMemcpyNodeSetParamsFromSymbol_GlobalMem(bool useConstDeviceVar) { - constexpr size_t Nbytes = SIZE * sizeof(int); - hipGraphNode_t memcpyD2H_B; - int *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; - int *A_h{nullptr}, *B_h{nullptr}; - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, nullptr, SIZE, false); - - hipGraph_t graph; - hipGraphExec_t graphExec; - hipGraphNode_t memcpyToSymbolNode, memcpyFromSymbolNode, memcpyH2D_A; - std::vector dependencies; - HIP_CHECK(hipGraphCreate(&graph, 0)); - - // Adding MemcpyNode - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - dependencies.push_back(memcpyH2D_A); - - if (useConstDeviceVar) { - HIP_CHECK(hipGraphAddMemcpyNodeToSymbol(&memcpyToSymbolNode, graph, dependencies.data(), - dependencies.size(), HIP_SYMBOL(globalConst), A_d, - Nbytes, 0, hipMemcpyDeviceToDevice)); - } else { - HIP_CHECK(hipGraphAddMemcpyNodeToSymbol(&memcpyToSymbolNode, graph, dependencies.data(), - dependencies.size(), HIP_SYMBOL(globalIn), A_d, Nbytes, - 0, hipMemcpyDeviceToDevice)); - } - dependencies.clear(); - dependencies.push_back(memcpyToSymbolNode); - - if (useConstDeviceVar) { - HIP_CHECK(hipGraphAddMemcpyNodeFromSymbol(&memcpyFromSymbolNode, graph, dependencies.data(), - dependencies.size(), C_d, HIP_SYMBOL(globalConst), - Nbytes, 0, hipMemcpyDeviceToDevice)); - } else { - HIP_CHECK(hipGraphAddMemcpyNodeFromSymbol(&memcpyFromSymbolNode, graph, dependencies.data(), - dependencies.size(), C_d, HIP_SYMBOL(globalIn), - Nbytes, 0, hipMemcpyDeviceToDevice)); - } - dependencies.clear(); - dependencies.push_back(memcpyFromSymbolNode); - - // Update the node with B_d destination pointer from C_d - if (useConstDeviceVar) { - HIP_CHECK(hipGraphMemcpyNodeSetParamsFromSymbol( - memcpyFromSymbolNode, B_d, HIP_SYMBOL(globalConst), Nbytes, 0, hipMemcpyDeviceToDevice)); - } else { - HIP_CHECK(hipGraphMemcpyNodeSetParamsFromSymbol(memcpyFromSymbolNode, B_d, HIP_SYMBOL(globalIn), - Nbytes, 0, hipMemcpyDeviceToDevice)); - } - - // Adding MemcpyNode - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyD2H_B, graph, dependencies.data(), dependencies.size(), - B_h, B_d, Nbytes, hipMemcpyDeviceToHost)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, 0)); - HIP_CHECK(hipStreamSynchronize(0)); - - // Validating the result - for (int i = 0; i < SIZE; i++) { - if (B_h[i] != A_h[i]) { - WARN("Validation failed B_h[i] " << B_h[i] << "A_h[i] " << A_h[i]); - REQUIRE(false); - } - } - - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, nullptr, false); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); -} - -/* Test verifies hipGraphMemcpyNodeSetParamsFromSymbol API Functional scenario. - 1) Allocate global symbol memory, add node to the graph. - Set/Update the new values to the node. Make sure they are taking effect. - 2) Allocate const symbol memory, add node to the graph. - Set/Update the new values to the node. Make sure they are taking effect. - */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsFromSymbol_Functional") { - SECTION("Check and update with Global Device Symbol Memory") { - hipGraphMemcpyNodeSetParamsFromSymbol_GlobalMem(false); - } - SECTION("Check and update with Constant Global Device Symbol Memory") { - hipGraphMemcpyNodeSetParamsFromSymbol_GlobalMem(true); - } -} diff --git a/catch/unit/graph/hipGraphMemcpyNodeSetParamsToSymbol.cc b/catch/unit/graph/hipGraphMemcpyNodeSetParamsToSymbol.cc index 96dd40235..be1d6193c 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeSetParamsToSymbol.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeSetParamsToSymbol.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -96,7 +81,7 @@ template void GraphMemcpyToSymbolSetParamsShell(const void* symbol, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsToSymbol_Positive_Basic") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParamsToSymbol_Positive_Basic) { SECTION("char") { HIP_GRAPH_MEMCPY_NODE_SET_PARAMS_TO_FROM_SYMBOL_TEST(GraphMemcpyToSymbolSetParamsShell, 10, char); @@ -137,7 +122,7 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsToSymbol_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsToSymbol_Negative_Parameters") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParamsToSymbol_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphMemcpyNodeSetParamsToSymbol_old.cc b/catch/unit/graph/hipGraphMemcpyNodeSetParamsToSymbol_old.cc index 00bed6e11..a5036b216 100644 --- a/catch/unit/graph/hipGraphMemcpyNodeSetParamsToSymbol_old.cc +++ b/catch/unit/graph/hipGraphMemcpyNodeSetParamsToSymbol_old.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios of hipGraphMemcpyNodeSetParamsToSymbol API: @@ -59,7 +46,7 @@ __global__ void CpyToConstSymbolKernel(int* B_d) { /* This testcase verifies negative scenarios of hipGraphMemcpyNodeSetParamsToSymbol API */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsToSymbol_Negative") { +TEST_CASE(Unit_hipGraphMemcpyNodeSetParamsToSymbol_Negative) { constexpr size_t Nbytes = SIZE * sizeof(int); int *A_d{nullptr}, *B_d{nullptr}; int *A_h{nullptr}, *B_h{nullptr}; @@ -130,98 +117,3 @@ TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsToSymbol_Negative") { HipTest::freeArrays(A_d, B_d, nullptr, A_h, B_h, nullptr, false); HIP_CHECK(hipGraphDestroy(graph)); } - -static void hipGraphMemcpyNodeSetParamsToSymbol_GlobalMem(bool useConstDeviceVar) { - constexpr size_t Nbytes = SIZE * sizeof(int); - constexpr auto blocksPerCU = 6; // to hide latency - constexpr auto threadsPerBlock = 256; - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, SIZE); - hipGraphNode_t memcpytosymbolkernel, memcpyD2H_B; - hipKernelNodeParams kernelNodeParams{}; - int *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; - int *A_h{nullptr}, *B_h{nullptr}; - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, nullptr, SIZE, false); - - hipGraph_t graph; - hipGraphExec_t graphExec; - hipGraphNode_t memcpyToSymbolNode, memcpyH2D_A; - std::vector dependencies; - HIP_CHECK(hipGraphCreate(&graph, 0)); - - // Adding MemcpyNode - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - dependencies.push_back(memcpyH2D_A); - - if (useConstDeviceVar) { - HIP_CHECK(hipGraphAddMemcpyNodeToSymbol(&memcpyToSymbolNode, graph, dependencies.data(), - dependencies.size(), HIP_SYMBOL(globalConst), C_d, - Nbytes, 0, hipMemcpyDeviceToDevice)); - } else { - HIP_CHECK(hipGraphAddMemcpyNodeToSymbol(&memcpyToSymbolNode, graph, dependencies.data(), - dependencies.size(), HIP_SYMBOL(globalIn), C_d, Nbytes, - 0, hipMemcpyDeviceToDevice)); - } - dependencies.clear(); - dependencies.push_back(memcpyToSymbolNode); - - // Update the node with source pointer from C_d to A_d - if (useConstDeviceVar) { - HIP_CHECK(hipGraphMemcpyNodeSetParamsToSymbol(memcpyToSymbolNode, HIP_SYMBOL(globalConst), A_d, - Nbytes, 0, hipMemcpyDeviceToDevice)); - } else { - HIP_CHECK(hipGraphMemcpyNodeSetParamsToSymbol(memcpyToSymbolNode, HIP_SYMBOL(globalIn), A_d, - Nbytes, 0, hipMemcpyDeviceToDevice)); - } - - // Adding Kernel node - void* kernelArgs1[] = {&B_d}; - if (useConstDeviceVar) - kernelNodeParams.func = reinterpret_cast(CpyToConstSymbolKernel); - else - kernelNodeParams.func = reinterpret_cast(CpyToSymbolKernel); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs1); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&memcpytosymbolkernel, graph, dependencies.data(), - dependencies.size(), &kernelNodeParams)); - dependencies.clear(); - dependencies.push_back(memcpytosymbolkernel); - - // Adding MemcpyNode - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyD2H_B, graph, dependencies.data(), dependencies.size(), - B_h, B_d, Nbytes, hipMemcpyDeviceToHost)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, 0)); - - // Validating the result - for (int i = 0; i < SIZE; i++) { - if (B_h[i] != A_h[i]) { - WARN("Validation failed B_h[i] " << B_h[i] << "A_h[i] " << A_h[i]); - REQUIRE(false); - } - } - - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, nullptr, false); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); -} - -/* Test verifies hipGraphMemcpyNodeSetParamsToSymbol API Functional scenario. - 1) Allocate global symbol memory, add node to the graph. - Set/Update the new values to the node. Make sure they are taking effect. - 2) Allocate const symbol memory, add node to the graph. - Set/Update the new values to the node. Make sure they are taking effect. - */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParamsToSymbol_Functional") { - SECTION("Check and update with Global Device Symbol Memory") { - hipGraphMemcpyNodeSetParamsToSymbol_GlobalMem(false); - } - SECTION("Check and update with Constant Global Device Symbol Memory") { - hipGraphMemcpyNodeSetParamsToSymbol_GlobalMem(true); - } -} diff --git a/catch/unit/graph/hipGraphMemcpyNodeSetParams_old.cc b/catch/unit/graph/hipGraphMemcpyNodeSetParams_old.cc deleted file mode 100644 index 98ec0512f..000000000 --- a/catch/unit/graph/hipGraphMemcpyNodeSetParams_old.cc +++ /dev/null @@ -1,212 +0,0 @@ -/* -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. -*/ - -/** -Testcase Scenarios : -Negative - -1) Pass node as nullptr and verify api returns error code. -2) Pass un-initialize node and verify api returns error code. -3) Pass pNodeParams as nullptr and verify api returns error code. -Functional - -1) Add Memcpy node to graph, update the Memcpy node params with set and - launch the graph and check updated params are taking effect. -2) Add Memcpy node to graph, launch graph, then update the Memcpy node params - with set and launch the graph and check updated params are taking effect. -*/ - -#include -#include - -#define SIZE 10 - -/* Test verifies hipGraphMemcpyNodeSetParams API Negative scenarios. - */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParams_Negative") { - CHECK_IMAGE_SUPPORT - - constexpr int width{SIZE}, height{SIZE}, depth{SIZE}; - hipArray_t devArray; - hipChannelFormatKind formatKind = hipChannelFormatKindSigned; - hipMemcpy3DParms myparms; - int* hData; - uint32_t size = width * height * depth * sizeof(int); - hData = reinterpret_cast(malloc(size)); - REQUIRE(hData != nullptr); - memset(hData, 0, size); - for (int i = 0; i < depth; i++) { - for (int j = 0; j < height; j++) { - for (int k = 0; k < width; k++) { - hData[i * width * height + j * width + k] = i * width * height + j * width + k; - } - } - } - hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(int) * 8, 0, 0, 0, formatKind); - HIP_CHECK(hipMalloc3DArray(&devArray, &channelDesc, make_hipExtent(width, height, depth), - hipArrayDefault)); - memset(&myparms, 0x0, sizeof(hipMemcpy3DParms)); - myparms.srcPos = make_hipPos(0, 0, 0); - myparms.dstPos = make_hipPos(0, 0, 0); - myparms.extent = make_hipExtent(width, height, depth); - myparms.srcPtr = make_hipPitchedPtr(hData, width * sizeof(int), width, height); - myparms.dstArray = devArray; - myparms.kind = hipMemcpyHostToDevice; - - hipGraph_t graph; - hipError_t ret; - hipGraphNode_t memcpyNode; - HIP_CHECK(hipGraphCreate(&graph, 0)); - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, NULL, 0, &myparms)); - - SECTION("Pass node as nullptr") { - ret = hipGraphMemcpyNodeSetParams(nullptr, &myparms); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("Pass un-initialize node") { - hipGraphNode_t memcpyNode_uninit{}; - ret = hipGraphMemcpyNodeSetParams(memcpyNode_uninit, &myparms); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION("Pass SetNodeParams as nullptr") { - ret = hipGraphMemcpyNodeSetParams(memcpyNode, nullptr); - REQUIRE(hipErrorInvalidValue == ret); - } - HIP_CHECK(hipFreeArray(devArray)); - free(hData); - HIP_CHECK(hipGraphDestroy(graph)); -} - -/* Test verifies hipGraphMemcpyNodeSetParams API Functional scenarios. - */ -TEST_CASE("Unit_hipGraphMemcpyNodeSetParams_Functional") { - CHECK_IMAGE_SUPPORT - - constexpr int width{SIZE}, height{SIZE}, depth{SIZE}; - hipArray_t devArray; - hipChannelFormatKind formatKind = hipChannelFormatKindSigned; - hipMemcpy3DParms myparms, myparms1; - uint32_t size = width * height * depth * sizeof(int); - - int* hData = reinterpret_cast(malloc(size)); - REQUIRE(hData != nullptr); - memset(hData, 0, size); - int* hDataTemp = reinterpret_cast(malloc(size)); - REQUIRE(hDataTemp != nullptr); - memset(hDataTemp, 0, size); - int* hOutputData = reinterpret_cast(malloc(size)); - REQUIRE(hOutputData != nullptr); - memset(hOutputData, 0, size); - int* hOutputData1 = reinterpret_cast(malloc(size)); - REQUIRE(hOutputData1 != nullptr); - memset(hOutputData1, 0, size); - - for (int i = 0; i < depth; i++) { - for (int j = 0; j < height; j++) { - for (int k = 0; k < width; k++) { - hData[i * width * height + j * width + k] = i * width * height + j * width + k; - } - } - } - hipChannelFormatDesc channelDesc = hipCreateChannelDesc(sizeof(int) * 8, 0, 0, 0, formatKind); - HIP_CHECK(hipMalloc3DArray(&devArray, &channelDesc, make_hipExtent(width, height, depth), - hipArrayDefault)); - memset(&myparms, 0x0, sizeof(hipMemcpy3DParms)); - - // Host to Device - myparms.srcPos = make_hipPos(0, 0, 0); - myparms.dstPos = make_hipPos(0, 0, 0); - myparms.extent = make_hipExtent(width, height, depth); - myparms.srcPtr = make_hipPitchedPtr(hData, width * sizeof(int), width, height); - myparms.dstArray = devArray; - myparms.kind = hipMemcpyHostToDevice; - - hipGraph_t graph; - hipGraphNode_t memcpyNode; - std::vector dependencies; - hipStream_t streamForGraph; - hipGraphExec_t graphExec; - - HIP_CHECK(hipStreamCreate(&streamForGraph)); - HIP_CHECK(hipGraphCreate(&graph, 0)); - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, NULL, 0, &myparms)); - dependencies.push_back(memcpyNode); - - // Device to host - memset(&myparms1, 0x0, sizeof(hipMemcpy3DParms)); - myparms1.srcPos = make_hipPos(0, 0, 0); - myparms1.dstPos = make_hipPos(0, 0, 0); - myparms1.dstPtr = make_hipPitchedPtr(hDataTemp, width * sizeof(int), width, height); - myparms1.srcArray = devArray; - myparms1.extent = make_hipExtent(width, height, depth); - myparms1.kind = hipMemcpyDeviceToHost; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), dependencies.size(), - &myparms1)); - - SECTION("Update the memcpyNode and check") { - // Device to host with updated host ptr hDataTemp -> hOutputData - memset(&myparms1, 0x0, sizeof(hipMemcpy3DParms)); - myparms1.srcPos = make_hipPos(0, 0, 0); - myparms1.dstPos = make_hipPos(0, 0, 0); - myparms1.dstPtr = make_hipPitchedPtr(hOutputData, width * sizeof(int), width, height); - myparms1.srcArray = devArray; - myparms1.extent = make_hipExtent(width, height, depth); - myparms1.kind = hipMemcpyDeviceToHost; - - HIP_CHECK(hipGraphMemcpyNodeSetParams(memcpyNode, &myparms1)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Check result - HipTest::checkArray(hData, hOutputData, width, height, depth); - } - - SECTION("Update the memcpyNode again and check") { - // Device to host with updated host ptr hOutputData -> hOutputData1 - memset(&myparms1, 0x0, sizeof(hipMemcpy3DParms)); - myparms1.srcPos = make_hipPos(0, 0, 0); - myparms1.dstPos = make_hipPos(0, 0, 0); - myparms1.dstPtr = make_hipPitchedPtr(hOutputData1, width * sizeof(int), width, height); - myparms1.srcArray = devArray; - myparms1.extent = make_hipExtent(width, height, depth); - myparms1.kind = hipMemcpyDeviceToHost; - - HIP_CHECK(hipGraphAddMemcpyNode(&memcpyNode, graph, dependencies.data(), dependencies.size(), - &myparms1)); - HIP_CHECK(hipGraphMemcpyNodeSetParams(memcpyNode, &myparms1)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Check result - HipTest::checkArray(hData, hOutputData1, width, height, depth); - } - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); - HIP_CHECK(hipFreeArray(devArray)); - free(hData); - free(hDataTemp); - free(hOutputData); - free(hOutputData1); -} diff --git a/catch/unit/graph/hipGraphMemsetNodeGetParams.cc b/catch/unit/graph/hipGraphMemsetNodeGetParams.cc index 06d8b2101..9e606837a 100644 --- a/catch/unit/graph/hipGraphMemsetNodeGetParams.cc +++ b/catch/unit/graph/hipGraphMemsetNodeGetParams.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -48,7 +33,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemsetNodeGetParams_Negative_Parameters") { +TEST_CASE(Unit_hipGraphMemsetNodeGetParams_Negative_Parameters) { CHECK_IMAGE_SUPPORT LinearAllocGuard2D alloc(1, 1); diff --git a/catch/unit/graph/hipGraphMemsetNodeSetParams.cc b/catch/unit/graph/hipGraphMemsetNodeSetParams.cc index 6b23447c3..675be476e 100644 --- a/catch/unit/graph/hipGraphMemsetNodeSetParams.cc +++ b/catch/unit/graph/hipGraphMemsetNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -51,7 +36,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_hipGraphMemsetNodeSetParams_Positive_Basic", "", uint8_t, uint16_t, +TEMPLATE_TEST_CASE(Unit_hipGraphMemsetNodeSetParams_Positive_Basic, uint8_t, uint16_t, uint32_t) { CHECK_IMAGE_SUPPORT @@ -122,7 +107,7 @@ TEMPLATE_TEST_CASE("Unit_hipGraphMemsetNodeSetParams_Positive_Basic", "", uint8_ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphMemsetNodeSetParams_Negative_Parameters") { +TEST_CASE(Unit_hipGraphMemsetNodeSetParams_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; diff --git a/catch/unit/graph/hipGraphMultiDevice.cc b/catch/unit/graph/hipGraphMultiDevice.cc index 2b7ea89fc..e486c9a3b 100644 --- a/catch/unit/graph/hipGraphMultiDevice.cc +++ b/catch/unit/graph/hipGraphMultiDevice.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2022-25 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -64,7 +48,7 @@ static void init_input(int* a, size_t size) { } -TEST_CASE("Unit_hipGraphMultiDevice") { +TEST_CASE(Unit_hipGraphMultiDevice) { int nGpus = 0; HIP_CHECK(hipGetDeviceCount(&nGpus)); if (nGpus < 2) { diff --git a/catch/unit/graph/hipGraphNodeFindInClone.cc b/catch/unit/graph/hipGraphNodeFindInClone.cc index d06a06a83..c199ff778 100644 --- a/catch/unit/graph/hipGraphNodeFindInClone.cc +++ b/catch/unit/graph/hipGraphNodeFindInClone.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022-2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Testcase Scenarios of hipGraphNodeFindInClone API: @@ -58,7 +45,7 @@ again, then try to find the newly added graph node from the cloned graph * - Finds a cloned version of a node. */ -TEST_CASE("Unit_hipGraphNodeFindInClone_Negative") { +TEST_CASE(Unit_hipGraphNodeFindInClone_Negative) { hipGraph_t graph; hipGraph_t clonedgraph; hipGraphNode_t graphnode, newnode; @@ -206,7 +193,7 @@ void hipGraphNodeFindInClone_Func(bool ModifyOrigGraph = false) { HIP_CHECK(hipGraphDestroy(clonedgraph)); } -TEST_CASE("Unit_hipGraphNodeFindInClone_Functional") { +TEST_CASE(Unit_hipGraphNodeFindInClone_Functional) { SECTION("hipGraphNodeFindInClone Basic Functionality") { hipGraphNodeFindInClone_Func(); } SECTION("hipGraphNodeFindInClone Modify Original graph") { hipGraphNodeFindInClone_Func(true); } } @@ -277,7 +264,7 @@ void hipGraphNodeFindInClone_DoubleClone(bool ModifyOrigGraph = false) { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphNodeFindInClone_MultipleClone") { +TEST_CASE(Unit_hipGraphNodeFindInClone_MultipleClone) { SECTION("hipGraphNodeFindInClone Back to Back clone") { hipGraphNodeFindInClone_DoubleClone(); } SECTION("hipGraphNodeFindInClone Modify Orig Graph After 2nd Clone") { hipGraphNodeFindInClone_DoubleClone(true); diff --git a/catch/unit/graph/hipGraphNodeGetDependencies.cc b/catch/unit/graph/hipGraphNodeGetDependencies.cc index 45b30396b..44deb6863 100644 --- a/catch/unit/graph/hipGraphNodeGetDependencies.cc +++ b/catch/unit/graph/hipGraphNodeGetDependencies.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -49,7 +36,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphNodeGetDependencies_Positive_Functional") { +TEST_CASE(Unit_hipGraphNodeGetDependencies_Positive_Functional) { using namespace std::placeholders; constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); @@ -212,7 +199,7 @@ TEST_CASE("Unit_hipGraphNodeGetDependencies_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphNodeGetDependencies_Negative_Parameters") { +TEST_CASE(Unit_hipGraphNodeGetDependencies_Negative_Parameters) { hipGraph_t graph{}; const int numBytes = 100; size_t numDeps{1}; diff --git a/catch/unit/graph/hipGraphNodeGetDependencies_old.cc b/catch/unit/graph/hipGraphNodeGetDependencies_old.cc deleted file mode 100644 index f17d686a8..000000000 --- a/catch/unit/graph/hipGraphNodeGetDependencies_old.cc +++ /dev/null @@ -1,347 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/** - -Testcase Scenarios ------------------- -Functional: -1) Create a graph and add nodes with dependencies. Try to fetch dependencies of a node added and -verify the api returns the node's dependencies that were defined. 2) When pDependencies is passed as -nullptr, verify pNumDependencies returns actual number of dependencies of node. 3) When -pNumDependencies is higher than the actual number of dependencies, the remaining entries in -pDependencies will be set to NULL, and the number of nodes actually obtained will be returned in -pNumDependencies. 4) When pNumDependencies is lesser than the actual number of dependencies, api -should return the requested number of dependencies. - -Argument Validation: -1) Verify the api returns pNumDependencies(0) when node passed is a root node. -2) Pass node as nullptr and verify api doesn’t crash, returns error code. -3) Pass pNumDependencies as nullptr and verify api doesn’t crash, returns error code. -4) Pass node as un-initialized/invalid parameter and verify api returns error code. - -*/ - -#include -#include -#include - -static __global__ void updateResult(int* C_d, int* Res_d, int val, int64_t NELEM) { - size_t offset = (blockIdx.x * blockDim.x + threadIdx.x); - size_t stride = blockDim.x * gridDim.x; - - for (int64_t i = NELEM - stride + offset; i >= 0; i -= stride) { - Res_d[i] = C_d[i] + val; - } -} - -static __global__ void vectorSum(const int* A_d, const int* B_d, const int* C_d, int* Res_d, - size_t NELEM) { - size_t offset = (blockIdx.x * blockDim.x + threadIdx.x); - size_t stride = blockDim.x * gridDim.x; - - for (size_t i = offset; i < NELEM; i += stride) { - Res_d[i] = A_d[i] + B_d[i] + C_d[i]; - } -} - -/** - * Verify api when GetDependencies is requested - * for actual number of nodes. - */ -static void queryActualNumOfDeps(const std::vector& Nlist, - hipGraphNode_t kernel_vecAdd, size_t numDeps) { - hipGraphNode_t* depnodes; - int numBytes = sizeof(hipGraphNode_t) * numDeps; - depnodes = reinterpret_cast(malloc(numBytes)); - REQUIRE(depnodes != nullptr); - HIP_CHECK(hipGraphNodeGetDependencies(kernel_vecAdd, depnodes, &numDeps)); - REQUIRE(numDeps == Nlist.size()); - - // Verify all dependencies are present in the node entries returned - for (auto Node : Nlist) { - bool found = false; - for (size_t i = 0; i < numDeps; i++) { - if (Node == depnodes[i]) { - found = true; - break; - } - } - - if (!found) { - INFO("Dependency node " << Node << " not present in returned list"); - REQUIRE(false); - } - } - free(depnodes); -} - -/** - * Verify api when GetDependencies queried - * for greater number than actual number of nodes. - */ -static void queryGreaterNumOfDeps(const std::vector& Nlist, - hipGraphNode_t kernel_vecAdd, size_t numDeps) { - constexpr auto addlEntries = 4; - hipGraphNode_t* depnodes; - size_t totDeps = numDeps + addlEntries; - int numBytes = sizeof(hipGraphNode_t) * totDeps; - depnodes = reinterpret_cast(malloc(numBytes)); - REQUIRE(depnodes != nullptr); - HIP_CHECK(hipGraphNodeGetDependencies(kernel_vecAdd, depnodes, &totDeps)); - REQUIRE(totDeps == Nlist.size()); - - for (auto i = numDeps; i < numDeps + addlEntries; i++) { - REQUIRE(depnodes[i] == nullptr); - } - - // Verify all dependencies are present in the node entries returned - for (auto Node : Nlist) { - bool found = false; - for (size_t i = 0; i < numDeps; i++) { - if (Node == depnodes[i]) { - found = true; - break; - } - } - - if (!found) { - INFO("Dependency node " << Node << " not present in returned list"); - REQUIRE(false); - } - } - free(depnodes); -} - -/** - * Verify api when GetDependencies queried - * for lesser number than actual number of nodes. - */ -static void queryLesserNumOfDeps(const std::vector& Nlist, - hipGraphNode_t kernel_vecAdd, size_t numDeps) { - size_t totDeps = numDeps - 1; - hipGraphNode_t* depnodes; - int numBytes = sizeof(hipGraphNode_t) * totDeps; - size_t count{}; - depnodes = reinterpret_cast(malloc(numBytes)); - REQUIRE(depnodes != nullptr); - HIP_CHECK(hipGraphNodeGetDependencies(kernel_vecAdd, depnodes, &totDeps)); - REQUIRE(totDeps == Nlist.size() - 1); - - // Verify all dependencies are present in the node entries returned - for (auto Node : Nlist) { - for (size_t i = 0; i < totDeps; i++) { - if (Node == depnodes[i]) { - count++; - break; - } - } - } - REQUIRE(count == totDeps); - free(depnodes); -} - -/** - * Functional Test for getting dependencies of node in graph and verifying execution - */ -TEST_CASE("Unit_hipGraphNodeGetDependencies_Functional") { - constexpr size_t N = 1024; - constexpr size_t Nbytes = N * sizeof(int); - constexpr auto blocksPerCU = 6; // to hide latency - constexpr auto threadsPerBlock = 256; - hipGraphNode_t kernel_vecSqr{}, kernel_vecAdd{}; - hipGraphNode_t kernelmod1{}, kernelmod2{}, kernelmod3{}; - hipGraphNode_t memcpyD2H{}, memcpyH2D_A{}; - hipKernelNodeParams kernelNodeParams{}; - hipGraph_t graph{}; - size_t numDeps{}; - hipStream_t streamForGraph; - int *A_d, *C_d; - int *A_h, *C_h; - int *Res1_d, *Res2_d, *Res3_d; - int *Sum_d, *Sum_h; - hipGraphExec_t graphExec; - size_t NElem{N}; - - HIP_CHECK(hipStreamCreate(&streamForGraph)); - HIP_CHECK(hipGraphCreate(&graph, 0)); - - HipTest::initArrays(&A_d, &C_d, &Sum_d, &A_h, &C_h, &Sum_h, N); - HipTest::initArrays(&Res1_d, &Res2_d, &Res3_d, nullptr, nullptr, nullptr, N); - - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); - - // Initialize input buffer and vecsqr result - for (size_t i = 0; i < N; ++i) { - A_h[i] = i + 1; - C_h[i] = A_h[i] * A_h[i]; - } - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - - void* kernelArgsVS[] = {&A_d, &C_d, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(HipTest::vector_square); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgsVS); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernel_vecSqr, graph, &memcpyH2D_A, 1, &kernelNodeParams)); - - // Create multiple nodes dependent on vecSqr node. - // Dependent nodes takes vecSqr input and computes output independently. - std::vector nodelist; - int incValue1{1}; - void* kernelArgs1[] = {&C_d, &Res1_d, &incValue1, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(updateResult); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs1); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernelmod1, graph, &kernel_vecSqr, 1, &kernelNodeParams)); - nodelist.push_back(kernelmod1); - - int incValue2{2}; - void* kernelArgs2[] = {&C_d, &Res2_d, &incValue2, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(updateResult); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs2); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernelmod2, graph, &kernel_vecSqr, 1, &kernelNodeParams)); - nodelist.push_back(kernelmod2); - - int incValue3{3}; - void* kernelArgs3[] = {&C_d, &Res3_d, &incValue3, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(updateResult); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs3); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernelmod3, graph, &kernel_vecSqr, 1, &kernelNodeParams)); - nodelist.push_back(kernelmod3); - - // Compute sum from all dependent nodes - void* kernelArgsAdd[] = {&Res1_d, &Res2_d, &Res3_d, &Sum_d, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(vectorSum); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgsAdd); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernel_vecAdd, graph, nodelist.data(), nodelist.size(), - &kernelNodeParams)); - - HIP_CHECK(hipGraphNodeGetDependencies(kernel_vecAdd, nullptr, &numDeps)); - REQUIRE(numDeps == nodelist.size()); - - // Verify api When Dependencies are requested for actual number of nodes. - queryActualNumOfDeps(nodelist, kernel_vecAdd, numDeps); - - // Verify api When Dependencies are requested for more than - // actual number of nodes. - queryGreaterNumOfDeps(nodelist, kernel_vecAdd, numDeps); - - // Verify api When Dependencies are requested for less than - // actual number of nodes. - queryLesserNumOfDeps(nodelist, kernel_vecAdd, numDeps); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyD2H, graph, &kernel_vecAdd, 1, Sum_h, Sum_d, Nbytes, - hipMemcpyDeviceToHost)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Validate the computation - for (size_t i = 0; i < N; i++) { - if (Sum_h[i] != ((C_h[i] + incValue1) + (C_h[i] + incValue2) + (C_h[i] + incValue3))) { - INFO("Sum not matching at " << i << " Sum_h[i] " << Sum_h[i] << " C_h[i] " << C_h[i]); - REQUIRE(false); - } - } - - HipTest::freeArrays(A_d, C_d, Sum_d, A_h, C_h, Sum_h, false); - HipTest::freeArrays(Res1_d, Res2_d, Res3_d, nullptr, nullptr, nullptr, false); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); -} - -/** - * Test performs api parameter validation by passing various values - * as input and output parameters and validates the behavior. - * Test will include both negative and positive scenarios. - */ -TEST_CASE("Unit_hipGraphNodeGetDependencies_ParamValidation") { - hipGraph_t graph{}; - const int numBytes = 100; - size_t numDeps{1}; - hipGraphNode_t memsetNode{}, depnodes{}; - hipError_t ret{}; - char* A_d; - - HIP_CHECK(hipGraphCreate(&graph, 0)); - HIP_CHECK(hipMalloc(&A_d, numBytes)); - hipMemsetParams memsetParams{}; - memsetParams.dst = reinterpret_cast(A_d); - memsetParams.value = 1; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = numBytes * sizeof(char); - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memsetNode, graph, nullptr, 0, &memsetParams)); - - SECTION("node passed is a root node") { - ret = hipGraphNodeGetDependencies(memsetNode, &depnodes, &numDeps); - - // Api expected to return success and no dependencies. - REQUIRE(ret == hipSuccess); - REQUIRE(numDeps == 0); - } - - SECTION("node as nullptr") { - ret = hipGraphNodeGetDependencies(nullptr, &depnodes, &numDeps); - REQUIRE(ret == hipErrorInvalidValue); - } - - SECTION("NumDependencies as nullptr") { - ret = hipGraphNodeGetDependencies(memsetNode, &depnodes, nullptr); - REQUIRE(ret == hipErrorInvalidValue); - } - - SECTION("node as un-initialized/invalid parameter") { - hipGraphNode_t uninit_node{}; - ret = hipGraphNodeGetDependencies(uninit_node, &depnodes, &numDeps); - REQUIRE(ret == hipErrorInvalidValue); - } - - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipFree(A_d)); -} \ No newline at end of file diff --git a/catch/unit/graph/hipGraphNodeGetDependentNodes.cc b/catch/unit/graph/hipGraphNodeGetDependentNodes.cc index 8c84e4356..54b31b652 100644 --- a/catch/unit/graph/hipGraphNodeGetDependentNodes.cc +++ b/catch/unit/graph/hipGraphNodeGetDependentNodes.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -49,7 +36,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphNodeGetDependentNodes_Positive_Functional") { +TEST_CASE(Unit_hipGraphNodeGetDependentNodes_Positive_Functional) { using namespace std::placeholders; constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); @@ -210,7 +197,7 @@ TEST_CASE("Unit_hipGraphNodeGetDependentNodes_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphNodeGetDependentNodes_Negative_Parameters") { +TEST_CASE(Unit_hipGraphNodeGetDependentNodes_Negative_Parameters) { hipGraph_t graph{}; const int numBytes = 100; size_t numDeps{1}; diff --git a/catch/unit/graph/hipGraphNodeGetDependentNodes_old.cc b/catch/unit/graph/hipGraphNodeGetDependentNodes_old.cc deleted file mode 100644 index a4be9eede..000000000 --- a/catch/unit/graph/hipGraphNodeGetDependentNodes_old.cc +++ /dev/null @@ -1,346 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/** - -Testcase Scenarios ------------------- -Functional: -1) Create a graph and add nodes with dependencies. Query for dependent nodes of the node passed and -verify the result with dependencies defined. 2) When pDependentNodes is passed as nullptr, verify -pNumDependentNodes returns the number of dependent nodes. 3) When pNumDependentNodes is higher than -the actual number of dependent nodes, the remaining entries in pDependentNodes will be set to NULL, - and the number of nodes actually obtained will be returned in pNumDependentNodes. -4) When pNumDependentNodes is lesser than the actual number of dependent nodes, api should return -the requested number of nodes in pDependentNodes. - -Argument Validation: -1) Add a single node in graph and pass the node to api. Verify the api returns dependent nodes as 0. -2) Pass node as nullptr and verify api doesn’t crash, returns error code. -3) Pass pNumDependentNodes as nullptr and verify api doesn’t crash, returns error code. -4) Pass node as un-initialized/invalid parameter and verify api returns error code. - -*/ - -#include -#include -#include - -static __global__ void updateResult(int* C_d, int* Res_d, int val, int64_t NELEM) { - size_t offset = (blockIdx.x * blockDim.x + threadIdx.x); - size_t stride = blockDim.x * gridDim.x; - - for (int64_t i = NELEM - stride + offset; i >= 0; i -= stride) { - Res_d[i] = C_d[i] + val; - } -} - -static __global__ void vectorSum(const int* A_d, const int* B_d, const int* C_d, int* Res_d, - size_t NELEM) { - size_t offset = (blockIdx.x * blockDim.x + threadIdx.x); - size_t stride = blockDim.x * gridDim.x; - - for (size_t i = offset; i < NELEM; i += stride) { - Res_d[i] = A_d[i] + B_d[i] + C_d[i]; - } -} - -/** - * Verify api when GetDependent nodes is requested - * for actual number of nodes. - */ -static void queryActualNumOfDepNodes(const std::vector& Nlist, - hipGraphNode_t kernel_vecSqr, size_t numDeps) { - hipGraphNode_t* depnodes; - int numBytes = sizeof(hipGraphNode_t) * numDeps; - depnodes = reinterpret_cast(malloc(numBytes)); - REQUIRE(depnodes != nullptr); - HIP_CHECK(hipGraphNodeGetDependentNodes(kernel_vecSqr, depnodes, &numDeps)); - REQUIRE(numDeps == Nlist.size()); - - // Verify all dependent nodes are present in the node entries returned - for (auto Node : Nlist) { - bool found = false; - for (size_t i = 0; i < numDeps; i++) { - if (Node == depnodes[i]) { - found = true; - break; - } - } - - if (!found) { - INFO("Dependent node " << Node << " not present in returned list"); - REQUIRE(false); - } - } - free(depnodes); -} - -/** - * Verify api when GetDependent nodes queried - * for greater number than actual number of nodes. - */ -static void queryGreaterNumOfDepNodes(const std::vector& Nlist, - hipGraphNode_t kernel_vecSqr, size_t numDeps) { - constexpr auto addlEntries = 4; - hipGraphNode_t* depnodes; - size_t totDeps = numDeps + addlEntries; - int numBytes = sizeof(hipGraphNode_t) * totDeps; - depnodes = reinterpret_cast(malloc(numBytes)); - REQUIRE(depnodes != nullptr); - HIP_CHECK(hipGraphNodeGetDependentNodes(kernel_vecSqr, depnodes, &totDeps)); - REQUIRE(totDeps == Nlist.size()); - - for (auto i = numDeps; i < numDeps + addlEntries; i++) { - REQUIRE(depnodes[i] == nullptr); - } - - // Verify all dependent nodes are present in the node entries returned - for (auto Node : Nlist) { - bool found = false; - for (size_t i = 0; i < numDeps; i++) { - if (Node == depnodes[i]) { - found = true; - break; - } - } - - if (!found) { - INFO("Dependent node " << Node << " not present in returned list"); - REQUIRE(false); - } - } - free(depnodes); -} - -/** - * Verify api when GetDependent nodes queried - * for lesser number than actual number of nodes. - */ -static void queryLesserNumOfDepNodes(const std::vector& Nlist, - hipGraphNode_t kernel_vecSqr, size_t numDeps) { - size_t totDeps = numDeps - 1; - hipGraphNode_t* depnodes; - int numBytes = sizeof(hipGraphNode_t) * totDeps; - size_t count{}; - depnodes = reinterpret_cast(malloc(numBytes)); - REQUIRE(depnodes != nullptr); - HIP_CHECK(hipGraphNodeGetDependentNodes(kernel_vecSqr, depnodes, &totDeps)); - REQUIRE(totDeps == Nlist.size() - 1); - - // Verify all dependent nodes are present in the node entries returned - for (auto Node : Nlist) { - for (size_t i = 0; i < totDeps; i++) { - if (Node == depnodes[i]) { - count++; - break; - } - } - } - REQUIRE(count == totDeps); - free(depnodes); -} - -/** - * Functional Test for getting dependent nodes in graph and verifying execution - */ -TEST_CASE("Unit_hipGraphNodeGetDependentNodes_Functional") { - constexpr size_t N = 1024; - constexpr size_t Nbytes = N * sizeof(int); - constexpr auto blocksPerCU = 6; // to hide latency - constexpr auto threadsPerBlock = 256; - hipGraphNode_t kernel_vecSqr{}, kernel_vecAdd{}; - hipGraphNode_t kernelmod1{}, kernelmod2{}, kernelmod3{}; - hipGraphNode_t memcpyD2H{}, memcpyH2D_A{}; - hipKernelNodeParams kernelNodeParams{}; - hipGraph_t graph{}; - size_t numDeps{}; - hipStream_t streamForGraph; - int *A_d, *C_d; - int *A_h, *C_h; - int *Res1_d, *Res2_d, *Res3_d; - int *Sum_d, *Sum_h; - hipGraphExec_t graphExec; - size_t NElem{N}; - - HIP_CHECK(hipStreamCreate(&streamForGraph)); - HIP_CHECK(hipGraphCreate(&graph, 0)); - - HipTest::initArrays(&A_d, &C_d, &Sum_d, &A_h, &C_h, &Sum_h, N); - HipTest::initArrays(&Res1_d, &Res2_d, &Res3_d, nullptr, nullptr, nullptr, N); - - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); - - // Initialize input buffer and vecsqr result - for (size_t i = 0; i < N; ++i) { - A_h[i] = i + 1; - C_h[i] = A_h[i] * A_h[i]; - } - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - - void* kernelArgsVS[] = {&A_d, &C_d, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(HipTest::vector_square); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgsVS); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernel_vecSqr, graph, &memcpyH2D_A, 1, &kernelNodeParams)); - - // Create multiple nodes dependent on vecSqr node. - // Dependent nodes takes vecSqr input and computes output independently. - std::vector nodelist; - int incValue1{1}; - void* kernelArgs1[] = {&C_d, &Res1_d, &incValue1, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(updateResult); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs1); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernelmod1, graph, &kernel_vecSqr, 1, &kernelNodeParams)); - nodelist.push_back(kernelmod1); - - int incValue2{2}; - void* kernelArgs2[] = {&C_d, &Res2_d, &incValue2, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(updateResult); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs2); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernelmod2, graph, &kernel_vecSqr, 1, &kernelNodeParams)); - nodelist.push_back(kernelmod2); - - int incValue3{3}; - void* kernelArgs3[] = {&C_d, &Res3_d, &incValue3, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(updateResult); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs3); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernelmod3, graph, &kernel_vecSqr, 1, &kernelNodeParams)); - nodelist.push_back(kernelmod3); - - HIP_CHECK(hipGraphNodeGetDependentNodes(kernel_vecSqr, nullptr, &numDeps)); - REQUIRE(numDeps == nodelist.size()); - - // Verify api When Dependent nodes are requested for actual number of nodes. - queryActualNumOfDepNodes(nodelist, kernel_vecSqr, numDeps); - - // Verify api When Dependent nodes are requested for more than - // actual number of nodes. - queryGreaterNumOfDepNodes(nodelist, kernel_vecSqr, numDeps); - - // Verify api When Dependent nodes are requested for less than - // actual number of nodes. - queryLesserNumOfDepNodes(nodelist, kernel_vecSqr, numDeps); - - // Compute sum from all dependent nodes - void* kernelArgsAdd[] = {&Res1_d, &Res2_d, &Res3_d, &Sum_d, reinterpret_cast(&NElem)}; - memset(&kernelNodeParams, 0, sizeof(kernelNodeParams)); - kernelNodeParams.func = reinterpret_cast(vectorSum); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgsAdd); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernel_vecAdd, graph, nodelist.data(), nodelist.size(), - &kernelNodeParams)); - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyD2H, graph, &kernel_vecAdd, 1, Sum_h, Sum_d, Nbytes, - hipMemcpyDeviceToHost)); - - // Instantiate and launch the graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - - // Validate the computation - for (size_t i = 0; i < N; i++) { - if (Sum_h[i] != ((C_h[i] + incValue1) + (C_h[i] + incValue2) + (C_h[i] + incValue3))) { - INFO("Sum not matching at " << i << " Sum_h[i] " << Sum_h[i] << " C_h[i] " << C_h[i]); - REQUIRE(false); - } - } - - HipTest::freeArrays(A_d, C_d, Sum_d, A_h, C_h, Sum_h, false); - HipTest::freeArrays(Res1_d, Res2_d, Res3_d, nullptr, nullptr, nullptr, false); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); -} - -/** - * Test performs api parameter validation by passing various values - * as input and output parameters and validates the behavior. - * Test will include both negative and positive scenarios. - */ -TEST_CASE("Unit_hipGraphNodeGetDependentNodes_ParamValidation") { - hipGraph_t graph{}; - const int numBytes = 100; - size_t numDeps{1}; - hipGraphNode_t memsetNode{}, depnodes{}; - hipError_t ret{}; - char* A_d; - - HIP_CHECK(hipGraphCreate(&graph, 0)); - HIP_CHECK(hipMalloc(&A_d, numBytes)); - hipMemsetParams memsetParams{}; - memsetParams.dst = reinterpret_cast(A_d); - memsetParams.value = 1; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = numBytes * sizeof(char); - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memsetNode, graph, nullptr, 0, &memsetParams)); - - SECTION("single node in graph") { - ret = hipGraphNodeGetDependentNodes(memsetNode, &depnodes, &numDeps); - - // Api expected to return success and no dependent nodes. - REQUIRE(ret == hipSuccess); - REQUIRE(numDeps == 0); - } - - SECTION("node as nullptr") { - ret = hipGraphNodeGetDependentNodes(nullptr, &depnodes, &numDeps); - REQUIRE(ret == hipErrorInvalidValue); - } - - SECTION("NumDependentNodes as nullptr") { - ret = hipGraphNodeGetDependentNodes(memsetNode, &depnodes, nullptr); - REQUIRE(ret == hipErrorInvalidValue); - } - - SECTION("node as un-initialized/invalid parameter") { - hipGraphNode_t uninit_node{}; - ret = hipGraphNodeGetDependentNodes(uninit_node, &depnodes, &numDeps); - REQUIRE(ret == hipErrorInvalidValue); - } - - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipFree(A_d)); -} \ No newline at end of file diff --git a/catch/unit/graph/hipGraphNodeGetEnabled.cc b/catch/unit/graph/hipGraphNodeGetEnabled.cc index e8c96684d..e2bf6c1eb 100644 --- a/catch/unit/graph/hipGraphNodeGetEnabled.cc +++ b/catch/unit/graph/hipGraphNodeGetEnabled.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -43,7 +30,7 @@ static void callbackfunc(void* A_h) { } } -TEST_CASE("Unit_hipGraphNodeGetEnabled_Functional_Basic") { +TEST_CASE(Unit_hipGraphNodeGetEnabled_Functional_Basic) { constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; @@ -161,7 +148,7 @@ TEST_CASE("Unit_hipGraphNodeGetEnabled_Functional_Basic") { 12) Create graphExec and then delete the graphExec and verify a node */ -TEST_CASE("Unit_hipGraphNodeGetEnabled_Negative_Functional") { +TEST_CASE(Unit_hipGraphNodeGetEnabled_Negative_Functional) { constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; diff --git a/catch/unit/graph/hipGraphNodeGetType.cc b/catch/unit/graph/hipGraphNodeGetType.cc index 5cebc8b1b..f1fe1f2b2 100644 --- a/catch/unit/graph/hipGraphNodeGetType.cc +++ b/catch/unit/graph/hipGraphNodeGetType.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /** Testcase Scenarios : Functional :: @@ -62,7 +50,7 @@ static void callbackfunc(void* A_h) { } } -TEST_CASE("Unit_hipGraphNodeGetType_Negative") { +TEST_CASE(Unit_hipGraphNodeGetType_Negative) { SECTION("Pass nullptr to graph node") { hipGraphNodeType nodeType; REQUIRE(hipGraphNodeGetType(nullptr, &nodeType) == hipErrorInvalidValue); @@ -84,7 +72,7 @@ TEST_CASE("Unit_hipGraphNodeGetType_Negative") { } } -TEST_CASE("Unit_hipGraphNodeGetType_Functional") { +TEST_CASE(Unit_hipGraphNodeGetType_Functional) { constexpr size_t N = 1024; hipGraphNodeType nodeType; hipGraph_t graph; @@ -131,7 +119,7 @@ constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; -TEST_CASE("Unit_hipGraphNodeGetType_NodeType") { +TEST_CASE(Unit_hipGraphNodeGetType_NodeType) { hipGraph_t graph; int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; @@ -304,7 +292,7 @@ static void thread_func(hipGraph_t graph, std::map* numNo * 2.Create a graph with different types of nodes. Pass the graph to a thread. In the * thread, verify node types of all the nodes in the graph */ -TEST_CASE("Unit_hipGraphNodeGetType_NodeTypeOfClonedGraph_NodeTypeInThread") { +TEST_CASE(Unit_hipGraphNodeGetType_NodeTypeOfClonedGraph_NodeTypeInThread) { hipGraph_t graph, childGraph, clonedGraph; int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; @@ -423,7 +411,7 @@ TEST_CASE("Unit_hipGraphNodeGetType_NodeTypeOfClonedGraph_NodeTypeInThread") { * few nodes and X as child graph. Now verify each of nodes of Y including * the nodes inside child graph using hipGraphNodeGetType() */ -TEST_CASE("Unit_hipGraphNodeGetType_NodeTypeOfChildGraph") { +TEST_CASE(Unit_hipGraphNodeGetType_NodeTypeOfChildGraph) { hipGraph_t graph, childGraph, getGraph; int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; @@ -570,7 +558,7 @@ static void thread_func1(hipGraph_t graph, enum graphType type) { * graph using hipGraphNodeGetType. * 2.Pass the graph to thread and verify each type of node in the graph * */ -TEST_CASE("Unit_hipGraphNodeGetType_ClonedGraph_InThread_WithDependencies") { +TEST_CASE(Unit_hipGraphNodeGetType_ClonedGraph_InThread_WithDependencies) { hipGraph_t graph, childGraph, clonedGraph; int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; @@ -666,7 +654,7 @@ TEST_CASE("Unit_hipGraphNodeGetType_ClonedGraph_InThread_WithDependencies") { * Now verify each of nodes of Y including the nodes inside child graph using * hipGraphNodeGetType() */ -TEST_CASE("Unit_hipGraphNodeGetType_NodeTypeOfChildGraph_WithDependency") { +TEST_CASE(Unit_hipGraphNodeGetType_NodeTypeOfChildGraph_WithDependency) { hipGraph_t graph, childGraph, getGraph; int *A_d, *B_d, *C_d; int *A_h, *B_h, *C_h; diff --git a/catch/unit/graph/hipGraphNodeSetEnabled.cc b/catch/unit/graph/hipGraphNodeSetEnabled.cc index c10028130..1b3fd41b2 100644 --- a/catch/unit/graph/hipGraphNodeSetEnabled.cc +++ b/catch/unit/graph/hipGraphNodeSetEnabled.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -63,7 +50,7 @@ static void callbackfunc(void* A_h) { } } -TEST_CASE("Unit_hipGraphNodeSetEnabled_Functional_Basic") { +TEST_CASE(Unit_hipGraphNodeSetEnabled_Functional_Basic) { constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; @@ -191,7 +178,7 @@ TEST_CASE("Unit_hipGraphNodeSetEnabled_Functional_Basic") { 11) Make ClonedGraph and disabled the kernel node in ClonedGraph and verify 12) Enable the Kernel node in ClonedGraph and verify the result */ -TEST_CASE("Unit_hipGraphNodeSetEnabled_Functional_KernelNode") { +TEST_CASE(Unit_hipGraphNodeSetEnabled_Functional_KernelNode) { constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; @@ -310,7 +297,7 @@ TEST_CASE("Unit_hipGraphNodeSetEnabled_Functional_KernelNode") { 15) Make ClonedGraph and disabled the MemSet node in ClonedGraph and verify 16) Enable the MemSet node in ClonedGraph and verify the result */ -TEST_CASE("Unit_hipGraphNodeSetEnabled_Functional_MemSet") { +TEST_CASE(Unit_hipGraphNodeSetEnabled_Functional_MemSet) { constexpr size_t Nbytes = N * sizeof(char); constexpr size_t val = 9; hipGraph_t graph, clonedGraph; @@ -427,7 +414,7 @@ TEST_CASE("Unit_hipGraphNodeSetEnabled_Functional_MemSet") { 19) Make ClonedGraph and disabled the MemCpy node in ClonedGraph and verify 20) Enable the MemCpy node in ClonedGraph and verify the result */ -TEST_CASE("Unit_hipGraphNodeSetEnabled_Functional_MemCpy") { +TEST_CASE(Unit_hipGraphNodeSetEnabled_Functional_MemCpy) { constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; @@ -556,7 +543,7 @@ TEST_CASE("Unit_hipGraphNodeSetEnabled_Functional_MemCpy") { 12) Create graphExec and then delete the graphExec and verify a node */ -TEST_CASE("Unit_hipGraphNodeSetEnabled_Negative_Functional") { +TEST_CASE(Unit_hipGraphNodeSetEnabled_Negative_Functional) { constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency constexpr auto threadsPerBlock = 256; diff --git a/catch/unit/graph/hipGraphNodeSetParams.cc b/catch/unit/graph/hipGraphNodeSetParams.cc index 5226b00d0..101ff9763 100644 --- a/catch/unit/graph/hipGraphNodeSetParams.cc +++ b/catch/unit/graph/hipGraphNodeSetParams.cc @@ -1,23 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -44,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphNodeSetParams_Negative_Parameters") { +TEST_CASE(Unit_hipGraphNodeSetParams_Negative_Parameters) { hipGraph_t graph; hipGraphExec_t graphExec; hipGraphNode_t node; @@ -104,7 +89,7 @@ TEST_CASE("Unit_hipGraphNodeSetParams_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipGraphNodeSetParams_Positive") { +TEST_CASE(Unit_hipGraphNodeSetParams_Positive) { hipGraph_t graph; hipGraphExec_t graphExec; hipGraphNode_t node; diff --git a/catch/unit/graph/hipGraphPerf.cc b/catch/unit/graph/hipGraphPerf.cc index 55c292d28..f29fa1ed4 100644 --- a/catch/unit/graph/hipGraphPerf.cc +++ b/catch/unit/graph/hipGraphPerf.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2023-2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipGraphPerfCheck hipGraphPerfCheck @@ -501,7 +488,7 @@ static void checkGraphEventcontinuousKernelCallIn2Blocks(const unsigned int kNum * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_MemcpyKernelMixCall") { +TEST_CASE(Unit_hipGraph_PerfCheck_MemcpyKernelMixCall) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -614,8 +601,7 @@ static void hipGraph_PerfCheck_hipGraphExecKernelNodeSetParams(const hipStream_t * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecKernelNodeSetParams", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecKernelNodeSetParams) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -733,8 +719,7 @@ static void hipGraph_PerfCheck_hipGraphExecKernelNodeSetParams_inLoop(const hipS * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecKernelNodeSetParams_inLoop", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecKernelNodeSetParams_inLoop) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -783,7 +768,7 @@ TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecKernelNodeSetParams_inLoop", * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParams") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParams) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -956,8 +941,7 @@ static void hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParams_inLoop(const hipS * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParams_inLoop", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParams_inLoop) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -1073,8 +1057,7 @@ static void hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParams1D_inLoop(const hi * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParams1D_inLoop", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParams1D_inLoop) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -1182,8 +1165,7 @@ static void hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParamsFrmSymbol(const hi * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParamsFrmSymbol", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParamsFrmSymbol) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -1290,8 +1272,7 @@ static void hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParamsToSymbol(const hip * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParamsToSymbol", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecMemcpyNodeSetParamsToSymbol) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -1444,8 +1425,7 @@ static void hipGraph_PerfCheck_hipGraphExecMemsetNodeSetParams(const hipStream_t * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecMemsetNodeSetParams", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecMemsetNodeSetParams) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -1878,8 +1858,7 @@ static void hipGraph_PerfCheck_hipGraphExecChildGraphNodeSetParams_mKernel( * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecChildGraphNodeSetParams", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecChildGraphNodeSetParams) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -2026,8 +2005,7 @@ static void hipGraph_PerfCheck_hipGraphExecEventRecordNodeSetEvent(const hipStre * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecEventRecordNodeSetEvent", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecEventRecordNodeSetEvent) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -2214,8 +2192,7 @@ static void hipGraph_PerfCheck_hipGraphExecEventWaitNodeSetEvent(const hipStream * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecEventWaitNodeSetEvent", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecEventWaitNodeSetEvent) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -2369,8 +2346,7 @@ static void hipGraph_PerfCheck_hipGraphExecHostNodeSetParams(const hipStream_t& * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecHostNodeSetParams", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecHostNodeSetParams) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -2493,7 +2469,7 @@ static void hipGraph_PerfCheck_hipGraphExecUpdate(const hipStream_t& stream) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecUpdate", "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecUpdate) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " @@ -2637,8 +2613,7 @@ static void hipGraph_PerfCheck_hipGraphExecUpdate_kernel_inLoop(const hipStream_ * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipGraph_PerfCheck_hipGraphExecUpdate_kernel_inLoop", - "[multigpu]") { +TEST_CASE(Unit_hipGraph_PerfCheck_hipGraphExecUpdate_kernel_inLoop) { if ((setenv("DEBUG_CLR_GRAPH_PACKET_CAPTURE", "true", 1)) != 0) { HipTest::HIP_SKIP_TEST( "Unable to turn on " diff --git a/catch/unit/graph/hipGraphReleaseUserObject.cc b/catch/unit/graph/hipGraphReleaseUserObject.cc index 613d8478b..80de4516d 100644 --- a/catch/unit/graph/hipGraphReleaseUserObject.cc +++ b/catch/unit/graph/hipGraphReleaseUserObject.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -31,7 +15,7 @@ THE SOFTWARE. 3) Pass initialRefcount as 0 4) Pass initialRefcount as INT_MAX */ -TEST_CASE("Unit_hipGraphReleaseUserObject_Negative") { +TEST_CASE(Unit_hipGraphReleaseUserObject_Negative) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphRemoveDependencies.cc b/catch/unit/graph/hipGraphRemoveDependencies.cc index 0af019d46..0e2b4d08b 100644 --- a/catch/unit/graph/hipGraphRemoveDependencies.cc +++ b/catch/unit/graph/hipGraphRemoveDependencies.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -67,7 +54,7 @@ static __global__ void vector_square(int* A_d, size_t N_ELMTS) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphRemoveDependencies_Positive_Functional") { +TEST_CASE(Unit_hipGraphRemoveDependencies_Positive_Functional) { constexpr size_t N = 1024; hipGraph_t graph; int *A_d, *B_d, *C_d; @@ -161,7 +148,7 @@ TEST_CASE("Unit_hipGraphRemoveDependencies_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphRemoveDependenciesPositive_CapturedStream") { +TEST_CASE(Unit_hipGraphRemoveDependenciesPositive_CapturedStream) { hipGraph_t graph; constexpr size_t N = 1024; int *A_d, *B_d, *C_d; @@ -217,7 +204,7 @@ TEST_CASE("Unit_hipGraphRemoveDependenciesPositive_CapturedStream") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphRemoveDependencies_Positive_ChangeComputeFunc") { +TEST_CASE(Unit_hipGraphRemoveDependencies_Positive_ChangeComputeFunc) { hipStream_t streamForGraph; HIP_CHECK(hipStreamCreate(&streamForGraph)); constexpr size_t N = 1024; @@ -329,7 +316,7 @@ TEST_CASE("Unit_hipGraphRemoveDependencies_Positive_ChangeComputeFunc") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphRemoveDependencies_Positive_Parameters") { +TEST_CASE(Unit_hipGraphRemoveDependencies_Positive_Parameters) { constexpr size_t Nbytes = 1024; hipGraphNode_t memcpyH2D_A; hipGraphNode_t memcpyD2H_A; @@ -417,7 +404,7 @@ TEST_CASE("Unit_hipGraphRemoveDependencies_Positive_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGraphRemoveDependencies_Negative_Parameters") { +TEST_CASE(Unit_hipGraphRemoveDependencies_Negative_Parameters) { hipGraph_t graph{}; HIP_CHECK(hipGraphCreate(&graph, 0)); hipEvent_t event_start, event_end; diff --git a/catch/unit/graph/hipGraphRemoveDependencies_old.cc b/catch/unit/graph/hipGraphRemoveDependencies_old.cc deleted file mode 100644 index 0728e0009..000000000 --- a/catch/unit/graph/hipGraphRemoveDependencies_old.cc +++ /dev/null @@ -1,439 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/** -Testcase Scenarios : - 1) Create a graph and add nodes with dependencies manually. Perform - selective removal of dependencies and make sure they are taking - effect using hipGraphGetEdges() API. - 2) Generate graph by capturing stream. Perform selective removal of - dependencies and make sure they are taking effect using - hipGraphGetEdges() API. - 3) Pass numDependencies as 0 and verify api returns success but doesn't - remove the depedencies. - 4) Create a graph and add nodes with dependencies manually. Perform - selective removal of dependency and add new dependency. Verify the - change by executing the updated graph. - 5) Negative Test Cases - - Pass graph parameter as nullptr. - - Pass from node parameter as nullptr. - - Pass to node parameter as nullptr. - - Pass uninitialized graph. - - Node passed in "to" parameter does not exist in graph. - - Remove non existing dependency. - - Remove the same dependency twice. -*/ - -#include -#include -#include - -#define TOTAL_NUM_OF_EDGES 6 - -/** - * Kernel Functions to perform square and return in the same - * input memory location. - */ -static __global__ void vector_square(int* A_d, size_t N_ELMTS) { - size_t gputhread = (blockIdx.x * blockDim.x + threadIdx.x); - size_t stride = blockDim.x * gridDim.x; - int temp = 0; - for (size_t i = gputhread; i < N_ELMTS; i += stride) { - temp = A_d[i] * A_d[i]; - A_d[i] = temp; - } -} - -/** - * Scenario 1 and Scenario 3: Validate hipGraphRemoveDependencies - * for manually created graph. - */ -TEST_CASE("Unit_hipGraphRemoveDependencies_Func_Manual") { - constexpr size_t N = 1024; - constexpr size_t Nbytes = N * sizeof(int); - constexpr auto blocksPerCU = 6; // to hide latency - constexpr auto threadsPerBlock = 256; - hipGraph_t graph; - hipGraphNode_t memset_A, memset_B, memsetKer_C; - hipGraphNode_t memcpyH2D_A, memcpyH2D_B, memcpyD2H_C; - hipGraphNode_t kernel_vecAdd; - hipKernelNodeParams kernelNodeParams{}; - int *A_d, *B_d, *C_d; - int *A_h, *B_h, *C_h; - hipMemsetParams memsetParams{}; - int memsetVal{}; - size_t NElem{N}; - - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); - - HIP_CHECK(hipGraphCreate(&graph, 0)); - - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(A_d); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(B_d); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memset_B, graph, nullptr, 0, &memsetParams)); - - void* kernelArgs1[] = {&C_d, &memsetVal, reinterpret_cast(&NElem)}; - kernelNodeParams.func = reinterpret_cast(HipTest::memsetReverse); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs1); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&memsetKer_C, graph, nullptr, 0, &kernelNodeParams)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_B, graph, nullptr, 0, B_d, B_h, Nbytes, - hipMemcpyHostToDevice)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyD2H_C, graph, nullptr, 0, C_h, C_d, Nbytes, - hipMemcpyDeviceToHost)); - - void* kernelArgs2[] = {&A_d, &B_d, &C_d, reinterpret_cast(&NElem)}; - kernelNodeParams.func = reinterpret_cast(HipTest::vectorADD); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs2); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernel_vecAdd, graph, nullptr, 0, &kernelNodeParams)); - - // Create dependencies - HIP_CHECK(hipGraphAddDependencies(graph, &memset_A, &memcpyH2D_A, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memset_B, &memcpyH2D_B, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_A, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_B, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memsetKer_C, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &kernel_vecAdd, &memcpyD2H_C, 1)); - - SECTION("scenario 1") { - // Remove some dependencies - constexpr size_t numEdgesRemoved = 3; - HIP_CHECK(hipGraphRemoveDependencies(graph, &memcpyH2D_A, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphRemoveDependencies(graph, &memcpyH2D_B, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphRemoveDependencies(graph, &memsetKer_C, &kernel_vecAdd, 1)); - // Validate manually with hipGraphGetEdges() API - hipGraphNode_t fromnode[TOTAL_NUM_OF_EDGES]{}; - hipGraphNode_t tonode[TOTAL_NUM_OF_EDGES]{}; - size_t numEdges = TOTAL_NUM_OF_EDGES; - HIP_CHECK(hipGraphGetEdges(graph, fromnode, tonode, &numEdges)); - - hipGraphNode_t expected_from_nodes[numEdgesRemoved] = {memcpyH2D_A, memcpyH2D_B, memsetKer_C}; - hipGraphNode_t expected_to_nodes[numEdgesRemoved] = {kernel_vecAdd, kernel_vecAdd, - kernel_vecAdd}; - bool nodeFound; - int found_count = 0; - for (size_t idx_from = 0; idx_from < numEdgesRemoved; idx_from++) { - nodeFound = false; - int idx = 0; - for (; idx < TOTAL_NUM_OF_EDGES; idx++) { - if (expected_from_nodes[idx_from] == fromnode[idx]) { - nodeFound = true; - break; - } - } - if (nodeFound && (tonode[idx] == expected_to_nodes[idx_from])) { - found_count++; - } - } - // Ensure none of the nodes are discovered - REQUIRE(0 == found_count); - // Validate with returned number of edges from hipGraphGetEdges() API - numEdges = 0; - HIP_CHECK(hipGraphGetEdges(graph, nullptr, nullptr, &numEdges)); - size_t numEdgesExpected = TOTAL_NUM_OF_EDGES - numEdgesRemoved; - REQUIRE(numEdgesExpected == numEdges); - } - - SECTION("scenario 3") { - HIP_CHECK(hipGraphRemoveDependencies(graph, &memcpyH2D_A, &kernel_vecAdd, 0)); - size_t numEdges = 0; - HIP_CHECK(hipGraphGetEdges(graph, nullptr, nullptr, &numEdges)); - size_t numEdgesExpected = TOTAL_NUM_OF_EDGES; - REQUIRE(numEdgesExpected == numEdges); - } - // Destroy - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); - HIP_CHECK(hipGraphDestroy(graph)); -} - -/** - * Scenario 2: Validate hipGraphRemoveDependencies for stream captured graph. - */ -TEST_CASE("Unit_hipGraphRemoveDependencies_Func_StrmCapture") { - hipStream_t stream1, stream2, stream3; - hipEvent_t forkStreamEvent, memsetEvent1, memsetEvent2; - hipGraph_t graph; - constexpr size_t N = 1024; - constexpr size_t Nbytes = N * sizeof(int); - constexpr auto blocksPerCU = 6; // to hide latency - constexpr auto threadsPerBlock = 256; - int *A_d, *B_d, *C_d; - int *A_h, *B_h, *C_h; - size_t NElem{N}; - int memsetVal{}; - - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); - // Create streams and events - HIP_CHECK(hipStreamCreate(&stream1)); - HIP_CHECK(hipStreamCreate(&stream2)); - HIP_CHECK(hipStreamCreate(&stream3)); - HIP_CHECK(hipEventCreate(&forkStreamEvent)); - HIP_CHECK(hipEventCreate(&memsetEvent1)); - HIP_CHECK(hipEventCreate(&memsetEvent2)); - // Begin stream capture - HIP_CHECK(hipStreamBeginCapture(stream1, hipStreamCaptureModeGlobal)); - HIP_CHECK(hipEventRecord(forkStreamEvent, stream1)); - HIP_CHECK(hipStreamWaitEvent(stream2, forkStreamEvent, 0)); - HIP_CHECK(hipStreamWaitEvent(stream3, forkStreamEvent, 0)); - // Add operations to stream3 - hipLaunchKernelGGL(HipTest::memsetReverse, dim3(blocks), dim3(threadsPerBlock), 0, stream3, - C_d, memsetVal, NElem); - HIP_CHECK(hipEventRecord(memsetEvent1, stream3)); - // Add operations to stream2 - HIP_CHECK(hipMemsetAsync(B_d, 0, Nbytes, stream2)); - HIP_CHECK(hipMemcpyAsync(B_d, B_h, Nbytes, hipMemcpyHostToDevice, stream2)); - HIP_CHECK(hipEventRecord(memsetEvent2, stream2)); - // Add operations to stream1 - HIP_CHECK(hipMemsetAsync(A_d, 0, Nbytes, stream1)); - HIP_CHECK(hipMemcpyAsync(A_d, A_h, Nbytes, hipMemcpyHostToDevice, stream1)); - HIP_CHECK(hipStreamWaitEvent(stream1, memsetEvent2, 0)); - HIP_CHECK(hipStreamWaitEvent(stream1, memsetEvent1, 0)); - hipLaunchKernelGGL(HipTest::vectorADD, dim3(blocks), dim3(threadsPerBlock), 0, stream1, A_d, - B_d, C_d, NElem); - HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, stream1)); - HIP_CHECK(hipStreamEndCapture(stream1, &graph)); - hipGraphNode_t* nodes{nullptr}; - size_t numNodes = 0, numEdges = 0; - HIP_CHECK(hipGraphGetNodes(graph, nodes, &numNodes)); - HIP_CHECK(hipGraphGetEdges(graph, nullptr, nullptr, &numEdges)); - REQUIRE(7 == numNodes); - REQUIRE(TOTAL_NUM_OF_EDGES == numEdges); - // Get the edges and remove one edge. Verify edge is removed. - hipGraphNode_t fromnode[TOTAL_NUM_OF_EDGES]{}; - hipGraphNode_t tonode[TOTAL_NUM_OF_EDGES]{}; - HIP_CHECK(hipGraphGetEdges(graph, fromnode, tonode, &numEdges)); - HIP_CHECK(hipGraphRemoveDependencies(graph, &fromnode[0], &tonode[0], 1)); - // Verify - HIP_CHECK(hipGraphGetEdges(graph, nullptr, nullptr, &numEdges)); - size_t expected_num_edges = TOTAL_NUM_OF_EDGES - 1; - REQUIRE(expected_num_edges == numEdges); - // Destroy - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(stream1)); - HIP_CHECK(hipStreamDestroy(stream2)); - HIP_CHECK(hipStreamDestroy(stream3)); - HIP_CHECK(hipEventDestroy(forkStreamEvent)); - HIP_CHECK(hipEventDestroy(memsetEvent1)); - HIP_CHECK(hipEventDestroy(memsetEvent2)); - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); -} - -/** - * Scenario 4: Dynamically modify dependencies in a graph using - * hipGraphRemoveDependencies and verify the computation. - */ -TEST_CASE("Unit_hipGraphRemoveDependencies_ChangeComputeFunc") { - hipStream_t streamForGraph; - HIP_CHECK(hipStreamCreate(&streamForGraph)); - constexpr size_t N = 1024; - constexpr size_t Nbytes = N * sizeof(int); - constexpr auto blocksPerCU = 6; // to hide latency - constexpr auto threadsPerBlock = 256; - hipGraph_t graph; - hipGraphNode_t memcpyH2D_A, memcpyH2D_B, memcpyD2H_C; - hipGraphNode_t kernel_vecAdd, kernel_square; - hipKernelNodeParams kernelNodeParams{}; - int *A_d, *B_d, *C_d; - int *A_h, *B_h, *C_h; - size_t NElem{N}; - - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); - - HIP_CHECK(hipGraphCreate(&graph, 0)); - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_A, graph, nullptr, 0, A_d, A_h, Nbytes, - hipMemcpyHostToDevice)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyH2D_B, graph, nullptr, 0, B_d, B_h, Nbytes, - hipMemcpyHostToDevice)); - - HIP_CHECK(hipGraphAddMemcpyNode1D(&memcpyD2H_C, graph, nullptr, 0, C_h, C_d, Nbytes, - hipMemcpyDeviceToHost)); - - void* kernelArgs2[] = {&A_d, &B_d, &C_d, reinterpret_cast(&NElem)}; - kernelNodeParams.func = reinterpret_cast(HipTest::vectorADD); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs2); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernel_vecAdd, graph, nullptr, 0, &kernelNodeParams)); - - // Create dependencies - HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_A, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_B, &kernel_vecAdd, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &kernel_vecAdd, &memcpyD2H_C, 1)); - // Instantiate and execute Graph - hipGraphExec_t graphExec; - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - // Validate - bool bMismatch = false; - for (size_t idx = 0; idx < NElem; idx++) { - if (C_h[idx] != (A_h[idx] + B_h[idx])) { - bMismatch = true; - break; - } - } - REQUIRE(false == bMismatch); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - // Remove dependency memcpyH2D_B -> kernel_vecAdd and - // add new dependencies memcpyH2D_B -> kernel_square -> kernel_vecAdd - // Square kernel - void* kernelArgs1[] = {&B_d, reinterpret_cast(&NElem)}; - kernelNodeParams.func = reinterpret_cast(vector_square); - kernelNodeParams.gridDim = dim3(blocks); - kernelNodeParams.blockDim = dim3(threadsPerBlock); - kernelNodeParams.sharedMemBytes = 0; - kernelNodeParams.kernelParams = reinterpret_cast(kernelArgs1); - kernelNodeParams.extra = nullptr; - HIP_CHECK(hipGraphAddKernelNode(&kernel_square, graph, nullptr, 0, &kernelNodeParams)); - HIP_CHECK(hipGraphRemoveDependencies(graph, &memcpyH2D_B, &kernel_vecAdd, 1)); - // Add new dependencies - HIP_CHECK(hipGraphAddDependencies(graph, &memcpyH2D_B, &kernel_square, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &kernel_square, &kernel_vecAdd, 1)); - size_t numEdges = 0, numNodes = 0; - HIP_CHECK(hipGraphGetEdges(graph, nullptr, nullptr, &numEdges)); - REQUIRE(4 == numEdges); - HIP_CHECK(hipGraphGetNodes(graph, nullptr, &numNodes)); - REQUIRE(5 == numNodes); - // Instantiate and execute graph - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - HIP_CHECK(hipGraphLaunch(graphExec, streamForGraph)); - HIP_CHECK(hipStreamSynchronize(streamForGraph)); - // Validate - bMismatch = false; - for (size_t idx = 0; idx < NElem; idx++) { - if (C_h[idx] != (A_h[idx] + B_h[idx] * B_h[idx])) { - bMismatch = true; - break; - } - } - REQUIRE(false == bMismatch); - // Destroy - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForGraph)); -} - -/** - * Scenario 5: Negative Tests - */ -TEST_CASE("Unit_hipGraphRemoveDependencies_Negative") { - hipGraph_t graph{}; - HIP_CHECK(hipGraphCreate(&graph, 0)); - hipEvent_t event_start, event_end; - HIP_CHECK(hipEventCreateWithFlags(&event_start, hipEventDisableTiming)); - HIP_CHECK(hipEventCreateWithFlags(&event_end, hipEventDisableTiming)); - // memset node - constexpr size_t Nbytes = 1024; - char* A_d; - hipGraphNode_t memset_A; - hipMemsetParams memsetParams{}; - HIP_CHECK(hipMalloc(&A_d, Nbytes)); - memset(&memsetParams, 0, sizeof(memsetParams)); - memsetParams.dst = reinterpret_cast(A_d); - memsetParams.value = 0; - memsetParams.pitch = 0; - memsetParams.elementSize = sizeof(char); - memsetParams.width = Nbytes; - memsetParams.height = 1; - HIP_CHECK(hipGraphAddMemsetNode(&memset_A, graph, nullptr, 0, &memsetParams)); - // create event record node - hipGraphNode_t event_node_start, event_node_end; - HIP_CHECK(hipGraphAddEventRecordNode(&event_node_start, graph, nullptr, 0, event_start)); - HIP_CHECK(hipGraphAddEventRecordNode(&event_node_end, graph, nullptr, 0, event_end)); - // create empty node - hipGraphNode_t emptyNode{}; - HIP_CHECK(hipGraphAddEmptyNode(&emptyNode, graph, nullptr, 0)); - // Add dependencies between nodes - HIP_CHECK(hipGraphAddDependencies(graph, &event_node_start, &memset_A, 1)); - HIP_CHECK(hipGraphAddDependencies(graph, &memset_A, &event_node_end, 1)); - - SECTION("graph is nullptr") { - REQUIRE(hipErrorInvalidValue == - hipGraphRemoveDependencies(nullptr, &event_node_start, &memset_A, 1)); - } - - SECTION("from is nullptr") { - REQUIRE(hipErrorInvalidValue == hipGraphRemoveDependencies(graph, nullptr, &memset_A, 1)); - } - - SECTION("to is nullptr") { - REQUIRE(hipErrorInvalidValue == - hipGraphRemoveDependencies(graph, &event_node_start, nullptr, 1)); - } - - SECTION("graph is uninitialized") { - hipGraph_t graph_uninit{}; - REQUIRE(hipErrorInvalidValue == - hipGraphRemoveDependencies(graph_uninit, &event_node_start, nullptr, 1)); - } - - SECTION("non existing node") { - REQUIRE(hipErrorInvalidValue == - hipGraphRemoveDependencies(graph, &event_node_start, &emptyNode, 1)); - } - - SECTION("remove non existing dependency") { - REQUIRE(hipErrorInvalidValue == - hipGraphRemoveDependencies(graph, &event_node_start, &event_node_end, 1)); - } - - SECTION("remove same dependency twice") { - HIP_CHECK(hipGraphRemoveDependencies(graph, &event_node_start, &memset_A, 1)); - REQUIRE(hipErrorInvalidValue == - hipGraphRemoveDependencies(graph, &event_node_start, &memset_A, 1)); - } - - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipEventDestroy(event_end)); - HIP_CHECK(hipEventDestroy(event_start)); -} diff --git a/catch/unit/graph/hipGraphRetainUserObject.cc b/catch/unit/graph/hipGraphRetainUserObject.cc index f04b026b0..fc8c5f83c 100644 --- a/catch/unit/graph/hipGraphRetainUserObject.cc +++ b/catch/unit/graph/hipGraphRetainUserObject.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -47,7 +31,7 @@ static void hipGraphRetainUserObject_Functional_1(void* object, void destroyObj( HIP_CHECK(hipGraphDestroy(graph)); } -TEST_CASE("Unit_hipGraphRetainUserObject_Functional_1") { +TEST_CASE(Unit_hipGraphRetainUserObject_Functional_1) { SECTION("Called with int Object") { int* object = new int(); REQUIRE(object != nullptr); @@ -72,7 +56,7 @@ TEST_CASE("Unit_hipGraphRetainUserObject_Functional_1") { /* 2) Create UserObject and GraphUserObject and retain using custom reference count and release it by calling hipGraphReleaseUserObject with count. */ -TEST_CASE("Unit_hipGraphRetainUserObject_Functional_2") { +TEST_CASE(Unit_hipGraphRetainUserObject_Functional_2) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); constexpr auto blocksPerCU = 6; // to hide latency @@ -151,7 +135,7 @@ TEST_CASE("Unit_hipGraphRetainUserObject_Functional_2") { 5) Pass flag as 0 6) Pass flag as INT_MAX */ -TEST_CASE("Unit_hipGraphRetainUserObject_Negative") { +TEST_CASE(Unit_hipGraphRetainUserObject_Negative) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -187,7 +171,7 @@ TEST_CASE("Unit_hipGraphRetainUserObject_Negative") { HIP_CHECK(hipGraphDestroy(graph)); } -TEST_CASE("Unit_hipGraphRetainUserObject_Negative_Basic") { +TEST_CASE(Unit_hipGraphRetainUserObject_Negative_Basic) { hipGraph_t graph; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/graph/hipGraphUpload.cc b/catch/unit/graph/hipGraphUpload.cc index fc868242b..31f408720 100644 --- a/catch/unit/graph/hipGraphUpload.cc +++ b/catch/unit/graph/hipGraphUpload.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -135,7 +122,7 @@ static void hipGraphUploadFunctional_with_stream(hipStream_t stream) { HIP_CHECK(hipGraphDestroy(graph)); } -TEST_CASE("Unit_hipGraphUpload_Functional") { +TEST_CASE(Unit_hipGraphUpload_Functional) { SECTION("Pass a stream") { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); @@ -153,7 +140,7 @@ TEST_CASE("Unit_hipGraphUpload_Functional") { } } -TEST_CASE("Unit_hipGraphUpload_Functional_multidevice_test", "[multigpu]") { +TEST_CASE(Unit_hipGraphUpload_Functional_multidevice_test) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -215,7 +202,7 @@ TEST_CASE("Unit_hipGraphUpload_Functional_multidevice_test", "[multigpu]") { Upload the graph into high priority stream and execute the graph and verify. */ -TEST_CASE("Unit_hipGraphUpload_Functional_With_Priority_Stream") { +TEST_CASE(Unit_hipGraphUpload_Functional_With_Priority_Stream) { constexpr size_t N = 1024; constexpr size_t Nbytes = N * sizeof(int); hipGraph_t graph; @@ -262,7 +249,7 @@ TEST_CASE("Unit_hipGraphUpload_Functional_With_Priority_Stream") { 4) Graphexec is destroyed before upload */ -TEST_CASE("Unit_hipGraphUpload_Negative_Parameters") { +TEST_CASE(Unit_hipGraphUpload_Negative_Parameters) { hipGraphExec_t graphExec{}; hipError_t ret; diff --git a/catch/unit/graph/hipLaunchHostFuncWithGraph.cc b/catch/unit/graph/hipLaunchHostFuncWithGraph.cc index 2f5a7432c..aec59d6b2 100644 --- a/catch/unit/graph/hipLaunchHostFuncWithGraph.cc +++ b/catch/unit/graph/hipLaunchHostFuncWithGraph.cc @@ -1,21 +1,9 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -55,7 +43,7 @@ static void hostNodeCallback(void* data) { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipLaunchHostFunc_Negative_Parameters") { +TEST_CASE(Unit_hipLaunchHostFunc_Negative_Parameters) { StreamGuard stream_guard(Streams::created); hipStream_t stream = stream_guard.stream(); hipGraph_t graph{nullptr}; @@ -85,7 +73,7 @@ TEST_CASE("Unit_hipLaunchHostFunc_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipLaunchHostFunc_Positive_Functional") { +TEST_CASE(Unit_hipLaunchHostFunc_Positive_Functional) { LinearAllocGuard A_h(LinearAllocs::malloc, sizeof(float)); LinearAllocGuard B_h(LinearAllocs::malloc, sizeof(float)); LinearAllocGuard A_d(LinearAllocs::hipMalloc, sizeof(float)); @@ -138,7 +126,7 @@ static void thread_func_pos(hipStream_t* stream, hipHostFn_t fn, float** data){ * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipLaunchHostFunc_Positive_Thread") { +TEST_CASE(Unit_hipLaunchHostFunc_Positive_Thread) { LinearAllocGuard A_h(LinearAllocs::malloc, sizeof(float)); LinearAllocGuard B_h(LinearAllocs::malloc, sizeof(float)); LinearAllocGuard A_d(LinearAllocs::hipMalloc, sizeof(float)); @@ -195,7 +183,7 @@ static void set_vector(void* args) { } } // namespace -TEST_CASE("Unit_hipLaunchHostFunc_H2D_Kernel_D2H_Capture") { +TEST_CASE(Unit_hipLaunchHostFunc_H2D_Kernel_D2H_Capture) { constexpr int numOfBlocks = 1024; constexpr int threadsPerBlock = 1024; constexpr size_t arraySize = 1U << 20; // 1,048,576 diff --git a/catch/unit/graph/hipMatMul.cc b/catch/unit/graph/hipMatMul.cc index c8b3b4103..6e434f9b7 100644 --- a/catch/unit/graph/hipMatMul.cc +++ b/catch/unit/graph/hipMatMul.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This code object should be automatically built via "make build_tests". diff --git a/catch/unit/graph/hipSimpleGraphWithKernel.cc b/catch/unit/graph/hipSimpleGraphWithKernel.cc index 2d1f02797..a6fea2140 100644 --- a/catch/unit/graph/hipSimpleGraphWithKernel.cc +++ b/catch/unit/graph/hipSimpleGraphWithKernel.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Simple test to demonstrate usage of graph. @@ -149,7 +136,7 @@ static void hipTestWithoutGraph() { /** * Simple test to demonstrate usage of graph. */ -TEST_CASE("Unit_hipGraph_SimpleGraphWithKernel") { +TEST_CASE(Unit_hipGraph_SimpleGraphWithKernel) { // Sections run test with and without graph. SECTION("Run Test Without Graph") { hipTestWithoutGraph(); } diff --git a/catch/unit/graph/hipStreamBeginCapture.cc b/catch/unit/graph/hipStreamBeginCapture.cc index f09f7c363..e541a402c 100644 --- a/catch/unit/graph/hipStreamBeginCapture.cc +++ b/catch/unit/graph/hipStreamBeginCapture.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022 - 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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -137,7 +124,7 @@ void captureStreamAndLaunchGraph(F graphFunc, hipStreamCaptureMode mode, hipStre * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_Functional") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_Functional) { const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); hipStream_t stream = stream_guard.stream(); @@ -182,7 +169,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Negative_Parameters") { +TEST_CASE(Unit_hipStreamBeginCapture_Negative_Parameters) { const auto stream_type = GENERATE(Streams::created); StreamGuard stream_guard(stream_type); hipStream_t stream = stream_guard.stream(); @@ -216,7 +203,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_Basic") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_Basic) { hipGraph_t graph{nullptr}; const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); @@ -460,7 +447,7 @@ static void multithreadedTest(hipStreamCaptureMode mode) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_InterStrmEventSync_Flags") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_InterStrmEventSync_Flags) { const auto stream_flags1 = GENERATE(hipStreamDefault, hipStreamNonBlocking); const auto stream_flags2 = GENERATE(hipStreamDefault, hipStreamNonBlocking); StreamGuard stream_guard1(Streams::withFlags, stream_flags1); @@ -486,7 +473,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_InterStrmEventSync_Flags") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_InterStrmEventSync_Priority") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_InterStrmEventSync_Priority) { int minPriority = 0, maxPriority = 0; HIP_CHECK(hipDeviceGetStreamPriorityRange(&minPriority, &maxPriority)); StreamGuard stream_guard1(Streams::withPriority, hipStreamDefault, minPriority); @@ -511,7 +498,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_InterStrmEventSync_Priority") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_ColligatedStrmCapture_Flags") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_ColligatedStrmCapture_Flags) { const auto stream_flags1 = GENERATE(hipStreamDefault, hipStreamNonBlocking); const auto stream_flags2 = GENERATE(hipStreamDefault, hipStreamNonBlocking); StreamGuard stream_guard1(Streams::withFlags, stream_flags1); @@ -537,7 +524,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_ColligatedStrmCapture_Flags") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_ColligatedStrmCapture_Prio") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_ColligatedStrmCapture_Prio) { int minPriority = 0, maxPriority = 0; HIP_CHECK(hipDeviceGetStreamPriorityRange(&minPriority, &maxPriority)); StreamGuard stream_guard1(Streams::withPriority, hipStreamDefault, minPriority); @@ -561,7 +548,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_ColligatedStrmCapture_Prio") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_ColligatedStrmCaptureFunc") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_ColligatedStrmCaptureFunc) { StreamGuard stream_guard1(Streams::created); hipStream_t stream1 = stream_guard1.stream(); StreamGuard stream_guard2(Streams::created); @@ -582,7 +569,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_ColligatedStrmCaptureFunc") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_Multithreaded") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_Multithreaded) { const hipStreamCaptureMode captureMode = GENERATE( hipStreamCaptureModeGlobal, hipStreamCaptureModeThreadLocal, hipStreamCaptureModeRelaxed); multithreadedTest(captureMode); @@ -606,7 +593,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_Multithreaded") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_Multiplestrms") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_Multiplestrms) { StreamsGuard streams(3); hipGraph_t graphs[3]; @@ -679,7 +666,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_Multiplestrms") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_CapturingFromWithinStrms") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_CapturingFromWithinStrms) { constexpr int INCREMENT_KERNEL_FINALEXP_VAL = 7; hipGraph_t graph{nullptr}; @@ -745,7 +732,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_CapturingFromWithinStrms") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Negative_DetectingInvalidCapture") { +TEST_CASE(Unit_hipStreamBeginCapture_Negative_DetectingInvalidCapture) { StreamsGuard streams(2); EventsGuard events(1); hipEvent_t event = events[0]; @@ -774,7 +761,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Negative_DetectingInvalidCapture") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_CapturingMultGraphsFrom1Strm") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_CapturingMultGraphsFrom1Strm) { hipGraph_t graphs[3]; StreamGuard stream_guard(Streams::created); @@ -823,7 +810,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_CapturingMultGraphsFrom1Strm") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Negative_CheckingSyncDuringCapture") { +TEST_CASE(Unit_hipStreamBeginCapture_Negative_CheckingSyncDuringCapture) { const hipStreamCaptureMode captureMode = GENERATE( hipStreamCaptureModeGlobal, hipStreamCaptureModeThreadLocal, hipStreamCaptureModeRelaxed); const unsigned int stream_flag = GENERATE(hipStreamDefault, hipStreamNonBlocking); @@ -873,7 +860,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Negative_CheckingSyncDuringCapture") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Negative_Concurrent_CheckingSyncDuringCapture") { +TEST_CASE(Unit_hipStreamBeginCapture_Negative_Concurrent_CheckingSyncDuringCapture) { const hipStreamCaptureMode captureMode = GENERATE( hipStreamCaptureModeGlobal, hipStreamCaptureModeThreadLocal, hipStreamCaptureModeRelaxed); const unsigned int stream_flag = GENERATE(hipStreamDefault, hipStreamNonBlocking); @@ -974,7 +961,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Negative_Concurrent_CheckingSyncDuringCapt * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Negative_UnsafeCallsDuringCapture") { +TEST_CASE(Unit_hipStreamBeginCapture_Negative_UnsafeCallsDuringCapture) { StreamGuard stream_guard(Streams::created); hipStream_t stream = stream_guard.stream(); @@ -1018,7 +1005,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Negative_UnsafeCallsDuringCapture") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Negative_EndingCapwhenCapInProg") { +TEST_CASE(Unit_hipStreamBeginCapture_Negative_EndingCapwhenCapInProg) { hipGraph_t graph{nullptr}; StreamsGuard streams_guard(2); @@ -1064,7 +1051,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Negative_EndingCapwhenCapInProg") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_MultiGPU", "[multigpu]") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_MultiGPU) { int devcount = 0; HIP_CHECK(hipGetDeviceCount(&devcount)); // If only single GPU is detected then return @@ -1142,7 +1129,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_MultiGPU", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_nestedStreamCapture") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_nestedStreamCapture) { constexpr int INCREMENT_KERNEL_FINALEXP_VAL = 7; hipGraph_t graph{nullptr}; @@ -1204,7 +1191,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_nestedStreamCapture") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_streamReuse") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_streamReuse) { constexpr int increment_kernel_vals[3] = {7, 3, 5}; hipGraph_t graphs[3]; @@ -1290,7 +1277,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_streamReuse") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_captureComplexGraph") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_captureComplexGraph) { constexpr int GRIDSIZE = 256; constexpr int BLOCKSIZE = 256; constexpr int CONST_KER1_VAL = 3; @@ -1377,7 +1364,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_captureComplexGraph") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Positive_captureEmptyStreams") { +TEST_CASE(Unit_hipStreamBeginCapture_Positive_captureEmptyStreams) { hipGraph_t graph{nullptr}; // Stream and event create @@ -1414,7 +1401,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Positive_captureEmptyStreams") { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamBeginCapture_StreamSync_OngoingCapture") { +TEST_CASE(Unit_hipStreamBeginCapture_StreamSync_OngoingCapture) { hipStreamCaptureMode flag = hipStreamCaptureModeRelaxed; constexpr int GRIDSIZE = 1; constexpr int BLOCKSIZE = 512; @@ -1540,7 +1527,7 @@ static void captureStrmThread(hipGraph_t* graph, int* Ah, int* Ad, int* Bh, int* } } -TEST_CASE("Unit_hipStreamBeginCapture_StreamSync_OngoingCapture_MThread") { +TEST_CASE(Unit_hipStreamBeginCapture_StreamSync_OngoingCapture_MThread) { constexpr int GRIDSIZE = 1; constexpr int BLOCKSIZE = 512; constexpr int VALUE1 = 7, VALUE2 = 11; @@ -1626,7 +1613,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_StreamSync_OngoingCapture_MThread") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamBeginCapture_MultipleStreams_ReuseEvent") { +TEST_CASE(Unit_hipStreamBeginCapture_MultipleStreams_ReuseEvent) { // Allocate streams hipStream_t str0, str1, str2; hipEvent_t ev0, ev1, ev2; diff --git a/catch/unit/graph/hipStreamBeginCaptureToGraph.cc b/catch/unit/graph/hipStreamBeginCaptureToGraph.cc index 41b9ae5f0..be379fd96 100644 --- a/catch/unit/graph/hipStreamBeginCaptureToGraph.cc +++ b/catch/unit/graph/hipStreamBeginCaptureToGraph.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipStreamBeginCaptureToGraph hipStreamBeginCaptureToGraph @@ -112,7 +96,7 @@ static bool CaptureStreamAndLaunchGraph(int* A_d, int* B_d, int* C_d, int* A_h, * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_BasicFunctional") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_BasicFunctional) { int *A_d, *B_d, *C_d; std::vector A_h(N), B_h(N), C_h(N); size_t Nbytes = N * sizeof(int); @@ -179,7 +163,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_CaptureIndepGraph") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_CaptureIndepGraph) { int *A1_d, *B1_d, *C1_d; std::vector A1_h(N), B1_h(N), C1_h(N); int *A2_d, *B2_d, *C2_d; @@ -276,7 +260,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_CaptureIndepGraph") { * - HIP_VERSION >= 6.2 */ #ifdef __linux__ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_CaptureDepGraph") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_CaptureDepGraph) { hipGraphExec_t graphExec{nullptr}; int *A1_d, *B1_d, *C1_d, *C2_d; std::vector A1_h(N), B1_h(N), C1_h(N), C2_h(N); @@ -374,7 +358,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_CaptureDepGraph") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_ComplexGraph") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_ComplexGraph) { int *A_d, *B_d, *C_d, *D_d; std::vector A_h(N), B_h(N), C_h(N), D_h(N); size_t Nbytes = N * sizeof(int); @@ -475,7 +459,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_ComplexGraph") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_CaptureTwice") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_CaptureTwice) { bool useSameAPI = GENERATE(true, false); int *A_d, *B_d, *C_d, *D_d; std::vector A_h(N), B_h(N), C_h(N), D_h(N); @@ -573,7 +557,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_CaptureTwice") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_ModifyCloneGraph") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_ModifyCloneGraph) { int *A_d, *B_d, *C_d, *D_d; std::vector A_h(N), B_h(N), C_h(N), D_h(N); size_t Nbytes = N * sizeof(int); @@ -668,7 +652,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_ModifyCloneGraph") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_CaptureChildpGraph") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_CaptureChildpGraph) { int *A_d, *B_d, *C_d, *D_d; std::vector A_h(N), B_h(N), C_h(N), D_h(N); size_t Nbytes = N * sizeof(int); @@ -762,7 +746,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_CaptureChildpGraph") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_ModifyChildpGraph") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_ModifyChildpGraph) { int *A_d, *B_d, *C_d, *D_d; std::vector A_h(N), B_h(N), C_h(N), D_h(N); size_t Nbytes = N * sizeof(int); @@ -856,7 +840,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_ModifyChildpGraph") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_Negative") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_Negative) { // Create streams and graph hipStream_t stream; hipGraph_t graph{nullptr}; @@ -899,7 +883,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_Negative") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_StateTesting") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_StateTesting) { // Create streams and graph hipStream_t stream1, stream2; hipEvent_t e; @@ -941,7 +925,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_StateTesting") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_GetCaptureInfo") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_GetCaptureInfo) { // Create streams and graph hipStream_t stream1, stream2; hipEvent_t e; @@ -987,7 +971,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_GetCaptureInfo") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_EndingWhileCaptureInProgress") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_EndingWhileCaptureInProgress) { hipStream_t stream1, stream2; hipGraph_t graph{nullptr}; HIP_CHECK(hipGraphCreate(&graph, 0)); @@ -1050,7 +1034,7 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_EndingWhileCaptureInProgress") { */ enum class strmFlag { defFlag, sameFlag, diffFlag, diffPrio }; -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_MultipleFlags") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_MultipleFlags) { strmFlag flag = GENERATE(strmFlag::defFlag, strmFlag::sameFlag, strmFlag::diffFlag, strmFlag::diffPrio); int *A_d, *B_d, *C_d; @@ -1136,7 +1120,7 @@ static void threadCaptureStart(hipStream_t* streamCapt, hipStream_t* streamFork, HIP_CHECK(hipEventDestroy(e)); } -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_CapturePartialInThreads") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_CapturePartialInThreads) { int *A_d, *B_d, *C_d; std::vector A_h(N), B_h(N), C_h(N); size_t Nbytes = N * sizeof(int); @@ -1206,7 +1190,7 @@ void threadCaptureExec(int* A_d, int* B_d, int* C_d, int* A_h, int* B_h, int* C_ retValG.fetch_and(val); } -TEST_CASE("Unit_hipStreamBeginCaptureToGraph_IndepGraphsThreads") { +TEST_CASE(Unit_hipStreamBeginCaptureToGraph_IndepGraphsThreads) { int *A1_d, *B1_d, *C1_d; std::vector A1_h(N), B1_h(N), C1_h(N); int *A2_d, *B2_d, *C2_d; @@ -1265,6 +1249,6 @@ TEST_CASE("Unit_hipStreamBeginCaptureToGraph_IndepGraphsThreads") { HIP_CHECK(hipFree(A2_d)); HIP_CHECK(hipFree(B2_d)); HIP_CHECK(hipFree(C2_d)); - fprintf(stderr, "Unit_hipStreamBeginCaptureToGraph_IndepGraphsThreads\n"); + fprintf(stderr, "hipStreamBeginCaptureToGraph_IndepGraphsThreads\n"); } #endif diff --git a/catch/unit/graph/hipStreamBeginCapture_old.cc b/catch/unit/graph/hipStreamBeginCapture_old.cc index 6b88edfdb..1d5950ac1 100644 --- a/catch/unit/graph/hipStreamBeginCapture_old.cc +++ b/catch/unit/graph/hipStreamBeginCapture_old.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : Functional @@ -182,7 +169,7 @@ bool CaptureStreamAndLaunchGraph(float* A_d, float* C_d, float* A_h, float* C_h, * Stream capture with different modes behave the same when supported/ * safe apis are used in sequence. */ -TEST_CASE("Unit_hipStreamBeginCapture_BasicFunctional") { +TEST_CASE(Unit_hipStreamBeginCapture_BasicFunctional) { float *A_d, *C_d; float *A_h, *C_h; size_t Nbytes = N * sizeof(float); @@ -230,7 +217,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_BasicFunctional") { /** * Perform capture on hipStreamPerThread, launch the graph and verify results. */ -TEST_CASE("Unit_hipStreamBeginCapture_hipStreamPerThread") { +TEST_CASE(Unit_hipStreamBeginCapture_hipStreamPerThread) { float *A_d, *C_d; float *A_h, *C_h; size_t Nbytes = N * sizeof(float); @@ -277,7 +264,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_hipStreamPerThread") { /* Test verifies hipStreamBeginCapture API Negative scenarios. */ -TEST_CASE("Unit_hipStreamBeginCapture_Negative") { +TEST_CASE(Unit_hipStreamBeginCapture_Negative) { hipError_t ret; hipStream_t stream{}; HIP_CHECK(hipStreamCreate(&stream)); @@ -301,7 +288,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_Negative") { HIP_CHECK(hipStreamDestroy(stream)); } -TEST_CASE("Unit_hipStreamBeginCapture_Basic") { +TEST_CASE(Unit_hipStreamBeginCapture_Basic) { hipStream_t s1, s2, s3; HIP_CHECK(hipStreamCreate(&s1)); @@ -543,7 +530,7 @@ static void multithreadedTest(hipStreamCaptureMode mode) { } /* Test scenario 5.1 */ -TEST_CASE("Unit_hipStreamBeginCapture_InterStrmEventSync_defaultflag") { +TEST_CASE(Unit_hipStreamBeginCapture_InterStrmEventSync_defaultflag) { hipStream_t stream1, stream2; HIP_CHECK(hipStreamCreate(&stream1)); HIP_CHECK(hipStreamCreate(&stream2)); @@ -553,7 +540,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_InterStrmEventSync_defaultflag") { } /* Test scenario 5.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_InterStrmEventSync_blockingflag") { +TEST_CASE(Unit_hipStreamBeginCapture_InterStrmEventSync_blockingflag) { hipStream_t stream1, stream2; HIP_CHECK(hipStreamCreateWithFlags(&stream1, hipStreamNonBlocking)); HIP_CHECK(hipStreamCreateWithFlags(&stream2, hipStreamNonBlocking)); @@ -563,7 +550,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_InterStrmEventSync_blockingflag") { } /* Test scenario 5.3 */ -TEST_CASE("Unit_hipStreamBeginCapture_InterStrmEventSync_diffflags") { +TEST_CASE(Unit_hipStreamBeginCapture_InterStrmEventSync_diffflags) { hipStream_t stream1, stream2; HIP_CHECK(hipStreamCreateWithFlags(&stream1, hipStreamNonBlocking)); HIP_CHECK(hipStreamCreateWithFlags(&stream2, hipStreamDefault)); @@ -573,7 +560,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_InterStrmEventSync_diffflags") { } /* Test scenario 5.4 */ -TEST_CASE("Unit_hipStreamBeginCapture_InterStrmEventSync_diffprio") { +TEST_CASE(Unit_hipStreamBeginCapture_InterStrmEventSync_diffprio) { hipStream_t stream1, stream2; int minPriority = 0, maxPriority = 0; HIP_CHECK(hipDeviceGetStreamPriorityRange(&minPriority, &maxPriority)); @@ -585,7 +572,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_InterStrmEventSync_diffprio") { } /* Test scenario 6.1 */ -TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_defaultflag") { +TEST_CASE(Unit_hipStreamBeginCapture_ColligatedStrmCapture_defaultflag) { hipStream_t stream1, stream2; HIP_CHECK(hipStreamCreate(&stream1)); HIP_CHECK(hipStreamCreate(&stream2)); @@ -595,7 +582,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_defaultflag") { } /* Test scenario 6.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_blockingflag") { +TEST_CASE(Unit_hipStreamBeginCapture_ColligatedStrmCapture_blockingflag) { hipStream_t stream1, stream2; HIP_CHECK(hipStreamCreateWithFlags(&stream1, hipStreamNonBlocking)); HIP_CHECK(hipStreamCreateWithFlags(&stream2, hipStreamNonBlocking)); @@ -605,7 +592,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_blockingflag") { } /* Test scenario 6.3 */ -TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_diffflags") { +TEST_CASE(Unit_hipStreamBeginCapture_ColligatedStrmCapture_diffflags) { hipStream_t stream1, stream2; HIP_CHECK(hipStreamCreateWithFlags(&stream1, hipStreamNonBlocking)); HIP_CHECK(hipStreamCreateWithFlags(&stream2, hipStreamDefault)); @@ -615,7 +602,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_diffflags") { } /* Test scenario 6.4 */ -TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_diffprio") { +TEST_CASE(Unit_hipStreamBeginCapture_ColligatedStrmCapture_diffprio) { hipStream_t stream1, stream2; int minPriority = 0, maxPriority = 0; HIP_CHECK(hipDeviceGetStreamPriorityRange(&minPriority, &maxPriority)); @@ -627,7 +614,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_diffprio") { } /* Test scenario 7 */ -TEST_CASE("Unit_hipStreamBeginCapture_multiplestrms") { +TEST_CASE(Unit_hipStreamBeginCapture_multiplestrms) { hipStream_t stream1, stream2, stream3; HIP_CHECK(hipStreamCreate(&stream1)); HIP_CHECK(hipStreamCreate(&stream2)); @@ -695,7 +682,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_multiplestrms") { } /* Test scenario 8 */ -TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_func") { +TEST_CASE(Unit_hipStreamBeginCapture_ColligatedStrmCapture_func) { hipStream_t stream1, stream2; HIP_CHECK(hipStreamCreate(&stream1)); HIP_CHECK(hipStreamCreate(&stream2)); @@ -705,22 +692,22 @@ TEST_CASE("Unit_hipStreamBeginCapture_ColligatedStrmCapture_func") { } /* Test scenario 9.1 */ -TEST_CASE("Unit_hipStreamBeginCapture_Multithreaded_Global") { +TEST_CASE(Unit_hipStreamBeginCapture_Multithreaded_Global) { multithreadedTest(hipStreamCaptureModeGlobal); } /* Test scenario 9.2 */ -TEST_CASE("Unit_hipStreamBeginCapture_Multithreaded_ThreadLocal") { +TEST_CASE(Unit_hipStreamBeginCapture_Multithreaded_ThreadLocal) { multithreadedTest(hipStreamCaptureModeThreadLocal); } /* Test scenario 9.3 */ -TEST_CASE("Unit_hipStreamBeginCapture_Multithreaded_Relaxed") { +TEST_CASE(Unit_hipStreamBeginCapture_Multithreaded_Relaxed) { multithreadedTest(hipStreamCaptureModeRelaxed); } /* Test scenario 10 */ -TEST_CASE("Unit_hipStreamBeginCapture_CapturingFromWithinStrms") { +TEST_CASE(Unit_hipStreamBeginCapture_CapturingFromWithinStrms) { hipGraph_t graph; hipStream_t stream1, stream2, stream3; HIP_CHECK(hipStreamCreate(&stream1)); @@ -780,7 +767,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_CapturingFromWithinStrms") { } /* Test scenario 11 */ -TEST_CASE("Unit_hipStreamBeginCapture_DetectingInvalidCapture") { +TEST_CASE(Unit_hipStreamBeginCapture_DetectingInvalidCapture) { hipStream_t stream1, stream2; HIP_CHECK(hipStreamCreate(&stream1)); HIP_CHECK(hipStreamCreate(&stream2)); @@ -802,7 +789,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_DetectingInvalidCapture") { } /* Test scenario 12 */ -TEST_CASE("Unit_hipStreamBeginCapture_CapturingMultGraphsFrom1Strm") { +TEST_CASE(Unit_hipStreamBeginCapture_CapturingMultGraphsFrom1Strm) { hipStream_t stream1; HIP_CHECK(hipStreamCreate(&stream1)); hipGraph_t graph[3]; @@ -850,7 +837,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_CapturingMultGraphsFrom1Strm") { #if HT_NVIDIA /* Test scenario 13 */ -TEST_CASE("Unit_hipStreamBeginCapture_CheckingSyncDuringCapture") { +TEST_CASE(Unit_hipStreamBeginCapture_CheckingSyncDuringCapture) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); SECTION("Synchronize stream during capture") { @@ -894,7 +881,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_CheckingSyncDuringCapture") { #endif /* Test scenario 14 */ -TEST_CASE("Unit_hipStreamBeginCapture_EndingCapturewhenCaptureInProgress") { +TEST_CASE(Unit_hipStreamBeginCapture_EndingCapturewhenCaptureInProgress) { hipStream_t stream1, stream2; hipGraph_t graph; HIP_CHECK(hipStreamCreate(&stream1)); @@ -932,7 +919,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_EndingCapturewhenCaptureInProgress") { /* Test scenario 15 */ -TEST_CASE("Unit_hipStreamBeginCapture_MultiGPU", "[multigpu]") { +TEST_CASE(Unit_hipStreamBeginCapture_MultiGPU) { int devcount = 0; HIP_CHECK(hipGetDeviceCount(&devcount)); // If only single GPU is detected then return @@ -995,7 +982,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_MultiGPU", "[multigpu]") { } /* Test scenario 16 */ -TEST_CASE("Unit_hipStreamBeginCapture_nestedStreamCapture") { +TEST_CASE(Unit_hipStreamBeginCapture_nestedStreamCapture) { hipGraph_t graph; hipStream_t stream1, stream2, stream3; HIP_CHECK(hipStreamCreate(&stream1)); @@ -1055,7 +1042,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_nestedStreamCapture") { } /* Test scenario 17 */ -TEST_CASE("Unit_hipStreamBeginCapture_streamReuse") { +TEST_CASE(Unit_hipStreamBeginCapture_streamReuse) { hipGraph_t graph1, graph2, graph3; hipStream_t stream1, stream2, stream3; HIP_CHECK(hipStreamCreate(&stream1)); @@ -1149,7 +1136,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_streamReuse") { /* Test scenario 18 */ -TEST_CASE("Unit_hipStreamBeginCapture_captureComplexGraph") { +TEST_CASE(Unit_hipStreamBeginCapture_captureComplexGraph) { hipGraph_t graph; hipStream_t stream1, stream2, stream3, stream4, stream5; // Stream and event create @@ -1239,7 +1226,7 @@ TEST_CASE("Unit_hipStreamBeginCapture_captureComplexGraph") { } /* Test scenario 19 */ -TEST_CASE("Unit_hipStreamBeginCapture_captureEmptyStreams") { +TEST_CASE(Unit_hipStreamBeginCapture_captureEmptyStreams) { hipGraph_t graph; hipStream_t stream1, stream2, stream3; // Stream and event create diff --git a/catch/unit/graph/hipStreamCaptureAPIRestrictions.cc b/catch/unit/graph/hipStreamCaptureAPIRestrictions.cc index e76702ec4..945337221 100644 --- a/catch/unit/graph/hipStreamCaptureAPIRestrictions.cc +++ b/catch/unit/graph/hipStreamCaptureAPIRestrictions.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2026 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipEventQueryCaptureRestrictions diff --git a/catch/unit/graph/hipStreamCaptureExtModuleLaunchKernel.cc b/catch/unit/graph/hipStreamCaptureExtModuleLaunchKernel.cc index 3ee872e64..d9e1baa2f 100644 --- a/catch/unit/graph/hipStreamCaptureExtModuleLaunchKernel.cc +++ b/catch/unit/graph/hipStreamCaptureExtModuleLaunchKernel.cc @@ -1,21 +1,9 @@ /* - 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include "hip/hip_ext.h" #include @@ -177,7 +165,7 @@ bool GraphModuleLaunchKernel::extModuleKernelExecutionMatmulwithStreamCapture( return testStatus; } -TEST_CASE("Unit_hipStreamCapture_ExtModuleLaunchKernel") { +TEST_CASE(Unit_hipStreamCapture_ExtModuleLaunchKernel) { struct stat fileStat; if (stat(GraphModuleLaunchKernel::fileName, &fileStat) || !(fileStat.st_mode & S_IFREG)) { FAIL("module file " << GraphModuleLaunchKernel::fileName << " doesn't exist! aborted! \n" diff --git a/catch/unit/graph/hipStreamEndCapture.cc b/catch/unit/graph/hipStreamEndCapture.cc index 49c8bd116..70fa1e192 100644 --- a/catch/unit/graph/hipStreamEndCapture.cc +++ b/catch/unit/graph/hipStreamEndCapture.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -45,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamEndCapture_Negative_Parameters") { +TEST_CASE(Unit_hipStreamEndCapture_Negative_Parameters) { hipGraph_t graph{nullptr}; const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); @@ -76,7 +63,7 @@ TEST_CASE("Unit_hipStreamEndCapture_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamEndCapture_Positive_GraphDestroy") { +TEST_CASE(Unit_hipStreamEndCapture_Positive_GraphDestroy) { hipGraph_t graph{nullptr}; constexpr size_t N = 1000000; size_t Nbytes = N * sizeof(float); @@ -116,7 +103,7 @@ static void thread_func_neg(hipStream_t stream, hipGraph_t graph) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamEndCapture_Negative_Thread") { +TEST_CASE(Unit_hipStreamEndCapture_Negative_Thread) { constexpr size_t N = 1000000; size_t Nbytes = N * sizeof(float); @@ -160,7 +147,7 @@ static void thread_func_pos(hipStream_t stream, hipGraph_t* graph) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamEndCapture_Positive_Thread") { +TEST_CASE(Unit_hipStreamEndCapture_Positive_Thread) { constexpr size_t N = 1000000; size_t Nbytes = N * sizeof(float); diff --git a/catch/unit/graph/hipStreamEndCapture_old.cc b/catch/unit/graph/hipStreamEndCapture_old.cc index c62cb869c..27bf7cae5 100644 --- a/catch/unit/graph/hipStreamEndCapture_old.cc +++ b/catch/unit/graph/hipStreamEndCapture_old.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Negative Testcase Scenarios : @@ -52,7 +39,7 @@ Negative Testcase Scenarios : #include #include -TEST_CASE("Unit_hipStreamEndCapture_Negative") { +TEST_CASE(Unit_hipStreamEndCapture_Negative) { hipError_t ret; SECTION("Pass stream as nullptr") { hipGraph_t graph; @@ -160,7 +147,7 @@ static void StreamEndCaptureThreadNegative(float* A_d, float* A_h, float* C_d, f HIP_CHECK(hipStreamDestroy(stream)); HIP_CHECK(hipGraphDestroy(graph)); } -TEST_CASE("Unit_hipStreamEndCapture_Thread_Negative") { +TEST_CASE(Unit_hipStreamEndCapture_Thread_Negative) { constexpr size_t N = 100000; size_t Nbytes = N * sizeof(float); float *A_d, *C_d; @@ -205,7 +192,7 @@ static void thread_func1(hipStream_t stream, hipGraph_t* graph, size_t Nbytes, f * stream1 and return the captured graph. Wait for the thread in main function. * Create an executable graph and launch the graph on input data and validate the output. * */ -TEST_CASE("Unit_hipStreamEndCapture_mode_hipStreamCaptureModeRelaxed") { +TEST_CASE(Unit_hipStreamEndCapture_mode_hipStreamCaptureModeRelaxed) { hipStream_t stream{nullptr}, streamForGraph{nullptr}; hipGraph_t graph{nullptr}; constexpr unsigned threadsPerBlock = 256; @@ -276,7 +263,7 @@ static __global__ void increment(int* A_d) { atomicAdd(A_d, 1); } * (like increment kernel) on both s1 and s2. End the stream capture * on s2 and verify the error returned by the End capture. */ -TEST_CASE("Unit_hipStreamEndCapture_chkError_on_wrongStream") { +TEST_CASE(Unit_hipStreamEndCapture_chkError_on_wrongStream) { int *A_d{nullptr}, *A_h{nullptr}; hipStream_t stream1{nullptr}, stream2{nullptr}; hipEvent_t forkStreamEvent{nullptr}; @@ -336,7 +323,7 @@ static void thread_func4(hipStream_t stream1, hipStream_t stream2, hipEvent_t ev * stream capture in s1. Create an executable graph and launch the graph on input * data and validate the output. * */ -TEST_CASE("Unit_hipStreamEndCapture_streamMerge_in_thread") { +TEST_CASE(Unit_hipStreamEndCapture_streamMerge_in_thread) { // Device Pointers int *A_d, *B_d, *C_d; // Host Pointers diff --git a/catch/unit/graph/hipStreamGetCaptureInfo.cc b/catch/unit/graph/hipStreamGetCaptureInfo.cc index 91138bb3e..033d226e7 100644 --- a/catch/unit/graph/hipStreamGetCaptureInfo.cc +++ b/catch/unit/graph/hipStreamGetCaptureInfo.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -95,7 +82,7 @@ void checkStreamCaptureInfo(hipStreamCaptureMode mode, hipStream_t stream) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_Positive_Functional") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_Positive_Functional) { const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); hipStream_t stream = stream_guard.stream(); @@ -118,7 +105,7 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_Positive_UniqueID") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_Positive_UniqueID) { constexpr int numStreams = 100; hipStreamCaptureStatus captureStatus{hipStreamCaptureStatusNone}; std::vector idlist; @@ -164,7 +151,7 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_Positive_UniqueID") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_Negative_Parameters") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_Negative_Parameters) { #if HT_NVIDIA hipStreamCaptureStatus cStatus; #endif diff --git a/catch/unit/graph/hipStreamGetCaptureInfo_old.cc b/catch/unit/graph/hipStreamGetCaptureInfo_old.cc index c524a56ed..aec7ef81d 100644 --- a/catch/unit/graph/hipStreamGetCaptureInfo_old.cc +++ b/catch/unit/graph/hipStreamGetCaptureInfo_old.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** @@ -75,185 +62,6 @@ constexpr unsigned threadsPerBlock = 256; size_t Nbytes = N * sizeof(float); constexpr int LAUNCH_ITERS = 1; -/** - * Validates stream capture info, launches graph and verify results - */ -void validateStreamCaptureInfo(hipStream_t mstream) { - hipStream_t stream1{nullptr}, stream2{nullptr}, streamForLaunch{nullptr}; - hipEvent_t memsetEvent1, memsetEvent2, forkStreamEvent; - hipGraph_t graph{nullptr}; - hipGraphExec_t graphExec{nullptr}; - float *A_d, *C_d; - float *A_h, *C_h; - A_h = reinterpret_cast(malloc(Nbytes)); - C_h = reinterpret_cast(malloc(Nbytes)); - REQUIRE(A_h != nullptr); - REQUIRE(C_h != nullptr); - HIP_CHECK(hipMalloc(&A_d, Nbytes)); - HIP_CHECK(hipMalloc(&C_d, Nbytes)); - REQUIRE(A_d != nullptr); - REQUIRE(C_d != nullptr); - HIP_CHECK(hipStreamCreate(&streamForLaunch)); - - // Initialize input buffer - for (size_t i = 0; i < N; ++i) { - A_h[i] = 3.146f + i; // Pi - } - - // Create cross stream dependencies. - // memset operations are done on stream1 and stream2 - // and they are joined back to mainstream - HIP_CHECK(hipStreamCreate(&stream1)); - HIP_CHECK(hipStreamCreate(&stream2)); - HIP_CHECK(hipEventCreate(&memsetEvent1)); - HIP_CHECK(hipEventCreate(&memsetEvent2)); - HIP_CHECK(hipEventCreate(&forkStreamEvent)); - - HIP_CHECK(hipStreamBeginCapture(mstream, hipStreamCaptureModeGlobal)); - HIP_CHECK(hipEventRecord(forkStreamEvent, mstream)); - HIP_CHECK(hipStreamWaitEvent(stream1, forkStreamEvent, 0)); - HIP_CHECK(hipStreamWaitEvent(stream2, forkStreamEvent, 0)); - HIP_CHECK(hipMemsetAsync(A_d, 0, Nbytes, stream1)); - HIP_CHECK(hipEventRecord(memsetEvent1, stream1)); - HIP_CHECK(hipMemsetAsync(C_d, 0, Nbytes, stream2)); - HIP_CHECK(hipEventRecord(memsetEvent2, stream2)); - HIP_CHECK(hipStreamWaitEvent(mstream, memsetEvent1, 0)); - HIP_CHECK(hipStreamWaitEvent(mstream, memsetEvent2, 0)); - HIP_CHECK(hipMemcpyAsync(A_d, A_h, Nbytes, hipMemcpyHostToDevice, mstream)); - hipLaunchKernelGGL(HipTest::vector_square, dim3(blocks), dim3(threadsPerBlock), 0, mstream, A_d, - C_d, N); - - hipStreamCaptureStatus captureStatus{hipStreamCaptureStatusNone}; - unsigned long long capSequenceID = 0; // NOLINT - HIP_CHECK(hipStreamGetCaptureInfo(mstream, &captureStatus, &capSequenceID)); - - // verify capture status is active and sequence id is valid - REQUIRE(captureStatus == hipStreamCaptureStatusActive); - REQUIRE(capSequenceID > 0); - - // End capture and verify graph is returned - HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, mstream)); - HIP_CHECK(hipStreamEndCapture(mstream, &graph)); - REQUIRE(graph != nullptr); - - // verify capture status is inactive and sequence id is not updated - capSequenceID = 0; - HIP_CHECK(hipStreamGetCaptureInfo(mstream, &captureStatus, &capSequenceID)); - REQUIRE(captureStatus == hipStreamCaptureStatusNone); - REQUIRE(capSequenceID == 0); - - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - REQUIRE(graphExec != nullptr); - - // Replay the recorded sequence multiple times - for (int i = 0; i < LAUNCH_ITERS; i++) { - HIP_CHECK(hipGraphLaunch(graphExec, streamForLaunch)); - } - - HIP_CHECK(hipStreamSynchronize(streamForLaunch)); - - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForLaunch)); - HIP_CHECK(hipStreamDestroy(stream1)); - HIP_CHECK(hipStreamDestroy(stream2)); - HIP_CHECK(hipEventDestroy(forkStreamEvent)); - HIP_CHECK(hipEventDestroy(memsetEvent1)); - HIP_CHECK(hipEventDestroy(memsetEvent2)); - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipFree(C_d)); - - // Validate the computation - for (size_t i = 0; i < N; i++) { - if (C_h[i] != A_h[i] * A_h[i]) { - INFO("A and C not matching at " << i << " C_h[i] " << C_h[i] << " A_h[i] " << A_h[i]); - REQUIRE(false); - } - } - free(A_h); - free(C_h); -} - -/** - * Basic Functional Test for stream capture and getting capture info. - * Regular/custom stream is used for stream capture. - */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_BasicFunctional") { - hipStream_t streamForCapture; - - HIP_CHECK(hipStreamCreate(&streamForCapture)); - validateStreamCaptureInfo(streamForCapture); - HIP_CHECK(hipStreamDestroy(streamForCapture)); -} - -/** - * Test performs stream capture on hipStreamPerThread and validates - * capture info. - */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_hipStreamPerThread") { - validateStreamCaptureInfo(hipStreamPerThread); -} - -/** - * Test starts stream capture on multiple streams and verifies uniqueness of - * identifiers returned. - */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_UniqueID") { - constexpr int numStreams = 100; - hipStream_t streams[numStreams]{}; - hipStreamCaptureStatus captureStatus{hipStreamCaptureStatusNone}; - std::vector idlist; - unsigned long long capSequenceID{}; // NOLINT - hipGraph_t graph{nullptr}; - - for (int i = 0; i < numStreams; i++) { - HIP_CHECK(hipStreamCreate(&streams[i])); - HIP_CHECK(hipStreamBeginCapture(streams[i], hipStreamCaptureModeGlobal)); - HIP_CHECK(hipStreamGetCaptureInfo(streams[i], &captureStatus, &capSequenceID)); - REQUIRE(captureStatus == hipStreamCaptureStatusActive); - REQUIRE(capSequenceID > 0); - idlist.push_back(capSequenceID); - } - - for (int i = 0; i < numStreams; i++) { - for (int j = i + 1; j < numStreams; j++) { - if (idlist[i] == idlist[j]) { - INFO("Same identifier returned for stream " << i << " and stream " << j); - REQUIRE(false); - } - } - } - - for (int i = 0; i < numStreams; i++) { - HIP_CHECK(hipStreamEndCapture(streams[i], &graph)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streams[i])); - } -} - -/** - * Argument validation/Negative tests for api - */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_ArgValidation") { - hipError_t ret; - hipStream_t stream; - hipStreamCaptureStatus captureStatus; - unsigned long long capSequenceID; // NOLINT - HIP_CHECK(hipStreamCreate(&stream)); - - SECTION("Capture ID location as nullptr") { - ret = hipStreamGetCaptureInfo(stream, &captureStatus, nullptr); - // Capture ID is optional - REQUIRE(ret == hipSuccess); - } - - SECTION("Capture Status location as nullptr") { - ret = hipStreamGetCaptureInfo(stream, nullptr, &capSequenceID); - REQUIRE(ret == hipErrorInvalidValue); - } - - HIP_CHECK(hipStreamDestroy(stream)); -} /* * Create 2 streams s1 and s2. Start capturing s1. Record event e1 on s1 and * wait for event e1 on s2. Queue some operations in s1 and s2. Invoke @@ -263,7 +71,7 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_ArgValidation") { * capture info (status and id) of both s1 and s2 are identical. * The above scenario using hipStreamGetCaptureInfo_v2 API */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_ParentAndForkedStrm_CaptureStatus") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_ParentAndForkedStrm_CaptureStatus) { hipStream_t stream1{nullptr}, stream2{nullptr}; hipEvent_t event2{nullptr}, forkStreamEvent{nullptr}; hipGraph_t graph{nullptr}; @@ -395,7 +203,7 @@ static void thread_func(hipStream_t stream, unsigned long long capSequenceID1, * thread is same as capture id in main function. Exit the thread and end the capture * The above scenario using hipStreamGetCaptureInfo_v2 API */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_CaptureStatus_InThread") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_CaptureStatus_InThread) { hipStream_t stream{nullptr}; hipGraph_t graph{nullptr}; @@ -425,7 +233,7 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_CaptureStatus_InThread") { * capture info. Verify that all the capture info are identical. * The above scenario using hipStreamGetCaptureInfo_v2 API */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_CaptureStatus_Througout_Capture") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_CaptureStatus_Througout_Capture) { hipStream_t stream{nullptr}; hipGraph_t graph{nullptr}; float *A_d, *B_d, *C_d, *D_d; @@ -519,7 +327,7 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_CaptureStatus_Througout_Capture") { * graph and verify the output from the operations. * The above scenario using hipStreamGetCaptureInfo_v2 API */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_Nullstream_CaptureInfo") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_Nullstream_CaptureInfo) { hipStream_t stream{nullptr}, streamForGraph{nullptr}; hipGraph_t graph{nullptr}; hipError_t ret; diff --git a/catch/unit/graph/hipStreamGetCaptureInfo_v2.cc b/catch/unit/graph/hipStreamGetCaptureInfo_v2.cc index 6257bdea1..b93fa86c6 100644 --- a/catch/unit/graph/hipStreamGetCaptureInfo_v2.cc +++ b/catch/unit/graph/hipStreamGetCaptureInfo_v2.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -148,7 +135,7 @@ void checkStreamCaptureInfo_v2(hipStreamCaptureMode mode, hipStream_t stream) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_Positive_Functional") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_v2_Positive_Functional) { const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); hipStream_t stream = stream_guard.stream(); @@ -171,7 +158,7 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_Positive_UniqueID") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_v2_Positive_UniqueID) { constexpr int numStreams = 100; hipStreamCaptureStatus captureStatus{hipStreamCaptureStatusNone}; std::vector idlist; @@ -218,7 +205,7 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_Positive_UniqueID") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_Negative_Parameters") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_v2_Negative_Parameters) { hipGraph_t capInfoGraph{}; #if HT_NVIDIA hipStreamCaptureStatus captureStatus; diff --git a/catch/unit/graph/hipStreamGetCaptureInfo_v2_old.cc b/catch/unit/graph/hipStreamGetCaptureInfo_v2_old.cc deleted file mode 100644 index 3a766ffd2..000000000 --- a/catch/unit/graph/hipStreamGetCaptureInfo_v2_old.cc +++ /dev/null @@ -1,279 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/** - -Testcase Scenarios ------------------- -Functional: -1) Start stream capture and get capture info v2. Verify api is success, capture status is -hipStreamCaptureStatusActive, identifier returned is valid/non-zero, graph object is returned. 2) -When stream capture is in progress, create dependent nodes by creating multistream dependencies and -verify the api returns valid dependent nodes. 3) End stream capture and get capture info. Verify api -is success, capture status is hipStreamCaptureStatusNone and identifier/graph/nodes are not returned -by api. 4) When optional parameters are not passed, make sure api still returns capture status of -stream. 5) Begin capture on hipStreamPerThread, get capture info v2 and validate results. 6) Perform -multiple captures and verify the identifier returned is unique. - -Parameter Validation/Negative: -1) Capture Status location as nullptr and verify api returns error code. -2) Stream as nullptr and verify api returns error code. - -*/ - -#include -#include -#include - -constexpr size_t N = 1000000; -constexpr int LAUNCH_ITERS = 1; - -/** - * Validates stream capture infov2, launches graph and verifies results - */ -void validateStreamCaptureInfoV2(hipStream_t mstream) { - hipStream_t stream1{nullptr}, stream2{nullptr}, streamForLaunch{nullptr}; - hipEvent_t memcpyEvent1, memsetEvent2, forkStreamEvent; - hipGraph_t graph{nullptr}, capInfoGraph{nullptr}; - hipGraphExec_t graphExec{nullptr}; - constexpr unsigned threadsPerBlock = 256; - constexpr int blocks = - (N % threadsPerBlock == 0) ? (N / threadsPerBlock) : ((N / threadsPerBlock) + 1); - const hipGraphNode_t* nodelist{}; - size_t Nbytes = N * sizeof(float), numDependencies; - float *A_d, *C_d; - float *A_h, *C_h; - A_h = reinterpret_cast(malloc(Nbytes)); - C_h = reinterpret_cast(malloc(Nbytes)); - REQUIRE(A_h != nullptr); - REQUIRE(C_h != nullptr); - HIP_CHECK(hipMalloc(&A_d, Nbytes)); - HIP_CHECK(hipMalloc(&C_d, Nbytes)); - REQUIRE(A_d != nullptr); - REQUIRE(C_d != nullptr); - HIP_CHECK(hipStreamCreate(&streamForLaunch)); - - // Initialize input buffer - for (size_t i = 0; i < N; ++i) { - A_h[i] = 3.146f + i; // Pi - } - - // Create cross stream dependencies. - // memset/memcpy operations are done on stream1 and stream2 - // and they are joined back to mainstream - HIP_CHECK(hipStreamCreate(&stream1)); - HIP_CHECK(hipStreamCreate(&stream2)); - HIP_CHECK(hipEventCreate(&memcpyEvent1)); - HIP_CHECK(hipEventCreate(&memsetEvent2)); - HIP_CHECK(hipEventCreate(&forkStreamEvent)); - - HIP_CHECK(hipStreamBeginCapture(mstream, hipStreamCaptureModeGlobal)); - HIP_CHECK(hipEventRecord(forkStreamEvent, mstream)); - HIP_CHECK(hipStreamWaitEvent(stream1, forkStreamEvent, 0)); - HIP_CHECK(hipStreamWaitEvent(stream2, forkStreamEvent, 0)); - HIP_CHECK(hipMemsetAsync(A_d, 0, Nbytes, stream1)); - HIP_CHECK(hipMemcpyAsync(A_d, A_h, Nbytes, hipMemcpyHostToDevice, stream1)); - HIP_CHECK(hipEventRecord(memcpyEvent1, stream1)); - HIP_CHECK(hipMemsetAsync(C_d, 0, Nbytes, stream2)); - HIP_CHECK(hipEventRecord(memsetEvent2, stream2)); - HIP_CHECK(hipStreamWaitEvent(mstream, memcpyEvent1, 0)); - HIP_CHECK(hipStreamWaitEvent(mstream, memsetEvent2, 0)); - - hipStreamCaptureStatus captureStatus{hipStreamCaptureStatusNone}; - unsigned long long capSequenceID = 0; // NOLINT - constexpr int numDepsCreated = 2; // Num of dependencies created - - HIP_CHECK(hipStreamGetCaptureInfo_v2(mstream, &captureStatus, &capSequenceID, &capInfoGraph, - &nodelist, &numDependencies)); - - // verify capture status is active, sequence id is valid, graph is returned, - REQUIRE(captureStatus == hipStreamCaptureStatusActive); - REQUIRE(capSequenceID > 0); - REQUIRE(capInfoGraph != nullptr); - REQUIRE(numDependencies == numDepsCreated); - - // verify dependency nodes list returned is the one we created. - hipGraphNodeType type(hipGraphNodeTypeEmpty); - - HIP_CHECK(hipGraphNodeGetType(nodelist[0], &type)); - if ((type != hipGraphNodeTypeMemset) && (type != hipGraphNodeTypeMemcpy)) { - INFO("Type0 returned as " << type); - REQUIRE(false); - } - - HIP_CHECK(hipGraphNodeGetType(nodelist[1], &type)); - if ((type != hipGraphNodeTypeMemset) && (type != hipGraphNodeTypeMemcpy)) { - INFO("Type1 returned as " << type); - REQUIRE(false); - } - - hipLaunchKernelGGL(HipTest::vector_square, dim3(blocks), dim3(threadsPerBlock), 0, mstream, A_d, - C_d, N); - - // End capture and verify graph is returned - HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, mstream)); - HIP_CHECK(hipStreamEndCapture(mstream, &graph)); - REQUIRE(graph != nullptr); - - // verify capture status is inactive and other params are not updated - capSequenceID = 0; - capInfoGraph = nullptr; - numDependencies = 0; - nodelist = nullptr; - HIP_CHECK(hipStreamGetCaptureInfo_v2(mstream, &captureStatus, &capSequenceID, &capInfoGraph, - &nodelist, &numDependencies)); - REQUIRE(captureStatus == hipStreamCaptureStatusNone); - REQUIRE(capSequenceID == 0); - REQUIRE(capInfoGraph == nullptr); - REQUIRE(nodelist == nullptr); - REQUIRE(numDependencies == 0); - - // Verify api still returns capture status when optional args are not passed - HIP_CHECK(hipStreamGetCaptureInfo_v2(mstream, &captureStatus)); - REQUIRE(captureStatus == hipStreamCaptureStatusNone); - - HIP_CHECK(hipGraphInstantiate(&graphExec, graph, nullptr, nullptr, 0)); - REQUIRE(graphExec != nullptr); - - // Replay the recorded sequence multiple times - for (int i = 0; i < LAUNCH_ITERS; i++) { - HIP_CHECK(hipGraphLaunch(graphExec, streamForLaunch)); - } - - HIP_CHECK(hipStreamSynchronize(streamForLaunch)); - - HIP_CHECK(hipGraphExecDestroy(graphExec)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streamForLaunch)); - HIP_CHECK(hipStreamDestroy(stream1)); - HIP_CHECK(hipStreamDestroy(stream2)); - HIP_CHECK(hipEventDestroy(forkStreamEvent)); - HIP_CHECK(hipEventDestroy(memcpyEvent1)); - HIP_CHECK(hipEventDestroy(memsetEvent2)); - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipFree(C_d)); - - // Validate the computation - for (size_t i = 0; i < N; i++) { - if (C_h[i] != A_h[i] * A_h[i]) { - INFO("A and C not matching at " << i << " C_h[i] " << C_h[i] << " A_h[i] " << A_h[i]); - REQUIRE(false); - } - } - free(A_h); - free(C_h); -} - -/** - * Basic Functional Test for stream capture and getting capture info V2. - * Regular/custom stream is used for stream capture. - */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_BasicFunctional") { - hipStream_t streamForCapture; - - HIP_CHECK(hipStreamCreate(&streamForCapture)); - validateStreamCaptureInfoV2(streamForCapture); - HIP_CHECK(hipStreamDestroy(streamForCapture)); -} - -/** - * Test performs stream capture on hipStreamPerThread and validates - * capture info V2. - */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_hipStreamPerThread") { - validateStreamCaptureInfoV2(hipStreamPerThread); -} - -/** - * Test starts stream capture on multiple streams and verifies uniqueness of - * identifiers returned from capture Info V2. - */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_UniqueID") { - constexpr int numStreams = 100; - hipStream_t streams[numStreams]{}; - hipStreamCaptureStatus captureStatus{hipStreamCaptureStatusNone}; - std::vector idlist; - unsigned long long capSequenceID{}; // NOLINT - hipGraph_t graph{nullptr}; - - for (int i = 0; i < numStreams; i++) { - HIP_CHECK(hipStreamCreate(&streams[i])); - HIP_CHECK(hipStreamBeginCapture(streams[i], hipStreamCaptureModeGlobal)); - HIP_CHECK(hipStreamGetCaptureInfo_v2(streams[i], &captureStatus, &capSequenceID, nullptr, - nullptr, nullptr)); - REQUIRE(captureStatus == hipStreamCaptureStatusActive); - REQUIRE(capSequenceID > 0); - idlist.push_back(capSequenceID); - } - - for (int i = 0; i < numStreams; i++) { - for (int j = i + 1; j < numStreams; j++) { - if (idlist[i] == idlist[j]) { - INFO("Same identifier returned for stream " << i << " and stream " << j); - REQUIRE(false); - } - } - } - - for (int i = 0; i < numStreams; i++) { - HIP_CHECK(hipStreamEndCapture(streams[i], &graph)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(streams[i])); - } -} - -/** - * Parameter validation/Negative tests for api - */ -TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_ParamValidation") { - hipError_t ret; - hipStream_t stream; - float* A_d; - hipGraph_t graph{}, capInfoGraph{}; - hipStreamCaptureStatus captureStatus; - unsigned long long capSequenceID; // NOLINT - size_t numDependencies; - const hipGraphNode_t* nodelist{}; - constexpr int numBytes{100}; - - HIP_CHECK(hipMalloc(&A_d, numBytes)); - HIP_CHECK(hipStreamCreate(&stream)); - HIP_CHECK(hipStreamBeginCapture(stream, hipStreamCaptureModeGlobal)); - HIP_CHECK(hipMemsetAsync(A_d, 0, numBytes, stream)); - - SECTION("Capture Status location as nullptr") { - ret = hipStreamGetCaptureInfo_v2(stream, nullptr, &capSequenceID, &capInfoGraph, &nodelist, - &numDependencies); - REQUIRE(ret == hipErrorInvalidValue); - } - - SECTION("Stream as nullptr") { - ret = hipStreamGetCaptureInfo_v2(nullptr, &captureStatus, &capSequenceID, &capInfoGraph, - &nodelist, &numDependencies); - if ((ret != hipErrorUnknown) && (ret != hipErrorStreamCaptureImplicit)) { - INFO("Ret : " << ret); - REQUIRE(false); - } - } - - HIP_CHECK(hipStreamEndCapture(stream, &graph)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(stream)); - HIP_CHECK(hipFree(A_d)); -} diff --git a/catch/unit/graph/hipStreamIsCapturing.cc b/catch/unit/graph/hipStreamIsCapturing.cc index f7328d88b..840415995 100644 --- a/catch/unit/graph/hipStreamIsCapturing.cc +++ b/catch/unit/graph/hipStreamIsCapturing.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamIsCapturing_Negative_Parameters") { +TEST_CASE(Unit_hipStreamIsCapturing_Negative_Parameters) { const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); hipStream_t stream = stream_guard.stream(); @@ -76,7 +63,7 @@ TEST_CASE("Unit_hipStreamIsCapturing_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamIsCapturing_Positive_Basic") { +TEST_CASE(Unit_hipStreamIsCapturing_Positive_Basic) { hipStreamCaptureStatus cStatus; const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); @@ -144,7 +131,7 @@ void checkStreamCaptureStatus(hipStreamCaptureMode mode, hipStream_t stream) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamIsCapturing_Positive_Functional") { +TEST_CASE(Unit_hipStreamIsCapturing_Positive_Functional) { const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); hipStream_t stream = stream_guard.stream(); @@ -174,7 +161,7 @@ static void thread_func(hipStream_t stream) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamIsCapturing_Positive_Thread") { +TEST_CASE(Unit_hipStreamIsCapturing_Positive_Thread) { constexpr size_t N = 1000000; size_t Nbytes = N * sizeof(float); diff --git a/catch/unit/graph/hipStreamIsCapturing_old.cc b/catch/unit/graph/hipStreamIsCapturing_old.cc index b858a6fff..7ccc7a096 100644 --- a/catch/unit/graph/hipStreamIsCapturing_old.cc +++ b/catch/unit/graph/hipStreamIsCapturing_old.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -63,169 +50,6 @@ created stream. Do some operatoins. End the capture on the created stream. Execu verify the output from the operations. */ -TEST_CASE("Unit_hipStreamIsCapturing_Negative") { - hipError_t ret; - hipStream_t stream{}; - - SECTION("Check capture status with null pCaptureStatus.") { - ret = hipStreamIsCapturing(stream, nullptr); - REQUIRE(hipErrorInvalidValue == ret); - } - SECTION( - "Check capture status with hipStreamPerThread and" - " nullptr as pCaptureStatus.") { - ret = hipStreamIsCapturing(hipStreamPerThread, nullptr); - REQUIRE(hipErrorInvalidValue == ret); - } -} - -TEST_CASE("Unit_hipStreamIsCapturing_Functional_Basic") { - hipStreamCaptureStatus cStatus; - - SECTION("Check capture status with null stream.") { - HIP_CHECK(hipStreamIsCapturing(nullptr, &cStatus)); - REQUIRE(hipStreamCaptureStatusNone == cStatus); - } - SECTION("Check capture status with hipStreamPerThread.") { - HIP_CHECK(hipStreamIsCapturing(hipStreamPerThread, &cStatus)); - REQUIRE(hipStreamCaptureStatusNone == cStatus); - } -} - -/** -Testcase Scenarios : - 1) Functional : Create a stream, call api and check - capture status is hipStreamCaptureStatusNone. - 2) Functional : Start capturing a stream and check - capture status returned as hipStreamCaptureStatusActive. - 3) Functional : Stop capturing a stream and check - status is returned as hipStreamCaptureStatusNone. -*/ - -TEST_CASE("Unit_hipStreamIsCapturing_Functional") { - float *A_d, *C_d; - float *A_h, *C_h; - hipStream_t stream{nullptr}; - hipGraph_t graph{nullptr}; - hipStreamCaptureStatus cStatus; - - A_h = reinterpret_cast(malloc(Nbytes)); - C_h = reinterpret_cast(malloc(Nbytes)); - REQUIRE(A_h != nullptr); - REQUIRE(C_h != nullptr); - - // Fill with Phi + i - for (size_t i = 0; i < N; i++) { - A_h[i] = 1.618f + i; - } - - HIP_CHECK(hipMalloc(&A_d, Nbytes)); - HIP_CHECK(hipMalloc(&C_d, Nbytes)); - REQUIRE(A_d != nullptr); - REQUIRE(C_d != nullptr); - HIP_CHECK(hipStreamCreate(&stream)); - - SECTION("Check the stream capture status before start capturing.") { - HIP_CHECK(hipStreamIsCapturing(stream, &cStatus)); - REQUIRE(hipStreamCaptureStatusNone == cStatus); - } - - HIP_CHECK(hipStreamBeginCapture(stream, hipStreamCaptureModeGlobal)); - - SECTION("Start capturing a stream and check the status.") { - HIP_CHECK(hipStreamIsCapturing(stream, &cStatus)); - REQUIRE(hipStreamCaptureStatusActive == cStatus); - } - - HIP_CHECK(hipMemcpyAsync(A_d, A_h, Nbytes, hipMemcpyHostToDevice, stream)); - - HIP_CHECK(hipMemsetAsync(C_d, 0, Nbytes, stream)); - hipLaunchKernelGGL(HipTest::vector_square, dim3(blocks), dim3(threadsPerBlock), 0, stream, A_d, - C_d, N); - HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, stream)); - - HIP_CHECK(hipStreamEndCapture(stream, &graph)); - - SECTION("Stop capturing a stream and check the status.") { - HIP_CHECK(hipStreamIsCapturing(stream, &cStatus)); - REQUIRE(hipStreamCaptureStatusNone == cStatus); - } - - HIP_CHECK(hipStreamSynchronize(stream)); - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(stream)); - - free(A_h); - free(C_h); - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipFree(C_d)); -} - -/** -Testcase Scenarios : - 1) Functional : Use hipStreamPerThread, call api and check - capture status is hipStreamCaptureStatusNone. - 2) Functional : Start capturing using hipStreamPerThread and check - capture status returned as hipStreamCaptureStatusActive. - 3) Functional : Stop capturing using hipStreamPerThread and check - status is returned as hipStreamCaptureStatusNone. -*/ - -TEST_CASE("Unit_hipStreamIsCapturing_hipStreamPerThread") { - float *A_d, *C_d; - float *A_h, *C_h; - hipGraph_t graph{nullptr}; - hipStreamCaptureStatus cStatus; - - A_h = reinterpret_cast(malloc(Nbytes)); - C_h = reinterpret_cast(malloc(Nbytes)); - REQUIRE(A_h != nullptr); - REQUIRE(C_h != nullptr); - - // Fill with Phi + i - for (size_t i = 0; i < N; i++) { - A_h[i] = 1.618f + i; - } - - HIP_CHECK(hipMalloc(&A_d, Nbytes)); - HIP_CHECK(hipMalloc(&C_d, Nbytes)); - REQUIRE(A_d != nullptr); - REQUIRE(C_d != nullptr); - - SECTION("Check the stream capture status before start capturing.") { - HIP_CHECK(hipStreamIsCapturing(hipStreamPerThread, &cStatus)); - REQUIRE(hipStreamCaptureStatusNone == cStatus); - } - - HIP_CHECK(hipStreamBeginCapture(hipStreamPerThread, hipStreamCaptureModeGlobal)); - - SECTION("Start capturing a stream and check the status.") { - HIP_CHECK(hipStreamIsCapturing(hipStreamPerThread, &cStatus)); - REQUIRE(hipStreamCaptureStatusActive == cStatus); - } - - HIP_CHECK(hipMemcpyAsync(A_d, A_h, Nbytes, hipMemcpyHostToDevice, hipStreamPerThread)); - - HIP_CHECK(hipMemsetAsync(C_d, 0, Nbytes, hipStreamPerThread)); - hipLaunchKernelGGL(HipTest::vector_square, dim3(blocks), dim3(threadsPerBlock), 0, - hipStreamPerThread, A_d, C_d, N); - HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, hipStreamPerThread)); - - HIP_CHECK(hipStreamEndCapture(hipStreamPerThread, &graph)); - - SECTION("Stop capturing a stream and check the status.") { - HIP_CHECK(hipStreamIsCapturing(hipStreamPerThread, &cStatus)); - REQUIRE(hipStreamCaptureStatusNone == cStatus); - } - - HIP_CHECK(hipStreamSynchronize(hipStreamPerThread)); - HIP_CHECK(hipGraphDestroy(graph)); - - free(A_h); - free(C_h); - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipFree(C_d)); -} /* * Create 2 streams s1 and s2. Start capturing s1. Record event e1 on s1 and wait * for event e1 on s2. Queue some operations in s1 and s2. Invoke hipStreamIsCapturing @@ -234,7 +58,7 @@ TEST_CASE("Unit_hipStreamIsCapturing_hipStreamPerThread") { * Invoke hipStreamIsCapturing on both streams. Verify that the capture info(status) * of both s1 and s2 are identical. */ -TEST_CASE("Unit_hipStreamIsCapturing_ParentAndForkedStream") { +TEST_CASE(Unit_hipStreamIsCapturing_ParentAndForkedStream) { hipStream_t stream1{nullptr}, stream2{nullptr}; hipEvent_t event2{nullptr}, forkStreamEvent{nullptr}; hipGraph_t graph{nullptr}; @@ -322,39 +146,6 @@ TEST_CASE("Unit_hipStreamIsCapturing_ParentAndForkedStream") { free(C_h); free(D_h); } -/* - * Create a stream s1. Start capturing s1. Get the capture info using hipStreamIsCapturing - * of s1. Launch a thread. In the thread get the capture info of s1 using hipStreamIsCapturing. - * Verify that it is in state hipStreamCaptureStatusActive in thread. Exit the thread and end - * the capture. - */ -// Thread Function -static void thread_func(hipStream_t stream) { - hipStreamCaptureStatus captureStatus{hipStreamCaptureStatusNone}; - HIP_CHECK(hipStreamIsCapturing(stream, &captureStatus)); - REQUIRE(captureStatus == hipStreamCaptureStatusActive); -} - -TEST_CASE("Unit_hipStreamIsCapturing_CheckCaptureStatus_FromThread") { - hipStream_t stream{nullptr}; - hipGraph_t graph{nullptr}; - - HIP_CHECK(hipStreamCreate(&stream)); - HIP_CHECK(hipStreamBeginCapture(stream, hipStreamCaptureModeGlobal)); - // Capture info - hipStreamCaptureStatus captureStatus{hipStreamCaptureStatusNone}; - HIP_CHECK(hipStreamIsCapturing(stream, &captureStatus)); - REQUIRE(captureStatus == hipStreamCaptureStatusActive); - // Thread launch - std::thread t(thread_func, stream); - t.join(); - - HIP_CHECK(hipStreamEndCapture(stream, &graph)); - REQUIRE(graph != nullptr); - - HIP_CHECK(hipGraphDestroy(graph)); - HIP_CHECK(hipStreamDestroy(stream)); -} /* * Create a stream with default flag (hipStreamDefault). Start capturing the stream. @@ -363,7 +154,7 @@ TEST_CASE("Unit_hipStreamIsCapturing_CheckCaptureStatus_FromThread") { * operatoins. End the capture on the created stream. Execute the graph and verify the output from * the operations. */ -TEST_CASE("Unit_hipStreamIsCapturing_ChkNullStrmStatus") { +TEST_CASE(Unit_hipStreamIsCapturing_ChkNullStrmStatus) { hipStream_t stream{nullptr}, streamForGraph{nullptr}; hipGraph_t graph{nullptr}; hipError_t ret; diff --git a/catch/unit/graph/hipStreamUpdateCaptureDependencies.cc b/catch/unit/graph/hipStreamUpdateCaptureDependencies.cc index 036c22069..820e635b4 100644 --- a/catch/unit/graph/hipStreamUpdateCaptureDependencies.cc +++ b/catch/unit/graph/hipStreamUpdateCaptureDependencies.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -306,7 +293,7 @@ static void UpdateStreamCaptureDependenciesAdd(hipStream_t stream, * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipStreamSetCaptureDependencies_Positive_Functional") { +TEST_CASE(Unit_hipStreamSetCaptureDependencies_Positive_Functional) { const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); hipStream_t stream = stream_guard.stream(); @@ -333,7 +320,7 @@ TEST_CASE("Unit_hipStreamSetCaptureDependencies_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipStreamAddCaptureDependencies_Positive_Functional") { +TEST_CASE(Unit_hipStreamAddCaptureDependencies_Positive_Functional) { const auto stream_type = GENERATE(Streams::perThread, Streams::created); StreamGuard stream_guard(stream_type); hipStream_t stream = stream_guard.stream(); @@ -356,7 +343,7 @@ TEST_CASE("Unit_hipStreamAddCaptureDependencies_Positive_Functional") { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipStreamUpdateCaptureDependencies_Positive_Parameters") { +TEST_CASE(Unit_hipStreamUpdateCaptureDependencies_Positive_Parameters) { hipGraph_t graph{nullptr}; const auto stream_type = GENERATE(Streams::perThread, Streams::created); @@ -393,7 +380,7 @@ TEST_CASE("Unit_hipStreamUpdateCaptureDependencies_Positive_Parameters") { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipStreamUpdateCaptureDependencies_Negative_Parameters") { +TEST_CASE(Unit_hipStreamUpdateCaptureDependencies_Negative_Parameters) { const int Nbytes = 100; hipGraph_t capInfoGraph{nullptr}; hipGraph_t graph{nullptr}; diff --git a/catch/unit/graph/hipThreadExchangeStreamCaptureMode.cc b/catch/unit/graph/hipThreadExchangeStreamCaptureMode.cc index 6e78aee01..e90be97e3 100644 --- a/catch/unit/graph/hipThreadExchangeStreamCaptureMode.cc +++ b/catch/unit/graph/hipThreadExchangeStreamCaptureMode.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -98,7 +85,7 @@ void threadFuncCaptureMode(hipStream_t stream, hipStreamCaptureMode mode) { * ------------------------ * - HIP_VERSION >= 5.3 */ -TEST_CASE("Unit_hipThreadExchangeStreamCaptureMode_Positive_Functional") { +TEST_CASE(Unit_hipThreadExchangeStreamCaptureMode_Positive_Functional) { StreamGuard stream_guard(Streams::created); hipStream_t stream = stream_guard.stream(); @@ -128,7 +115,7 @@ TEST_CASE("Unit_hipThreadExchangeStreamCaptureMode_Positive_Functional") { * - HIP_VERSION >= 5.3 */ #if HT_AMD // getting error in Cuda Setup -TEST_CASE("Unit_hipThreadExchangeStreamCaptureMode_Negative_Parameters") { +TEST_CASE(Unit_hipThreadExchangeStreamCaptureMode_Negative_Parameters) { hipStreamCaptureMode mode; SECTION("Pass Mode as nullptr") { diff --git a/catch/unit/graph/hipUserObjectCreate.cc b/catch/unit/graph/hipUserObjectCreate.cc index f8e781a1e..9e646ed31 100644 --- a/catch/unit/graph/hipUserObjectCreate.cc +++ b/catch/unit/graph/hipUserObjectCreate.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -44,7 +29,7 @@ static void hipUserObjectCreate_Functional_1(void* object, void destroyObj(void* HIP_CHECK(hipUserObjectRelease(hObject)); } -TEST_CASE("Unit_hipUserObjectCreate_Functional_1") { +TEST_CASE(Unit_hipUserObjectCreate_Functional_1) { SECTION("Called with int Object") { int* object = new int(); REQUIRE(object != nullptr); @@ -78,7 +63,7 @@ static void hipUserObjectCreate_Functional_2(void* object, void destroyObj(void* HIP_CHECK(hipUserObjectRelease(hObject, refCount)); } -TEST_CASE("Unit_hipUserObjectCreate_Functional_2") { +TEST_CASE(Unit_hipUserObjectCreate_Functional_2) { SECTION("Called with int Object") { int* object = new int(); REQUIRE(object != nullptr); @@ -112,7 +97,7 @@ static void hipUserObjectCreate_Functional_3(void* object, void destroyObj(void* HIP_CHECK(hipUserObjectRelease(hObject)); } -TEST_CASE("Unit_hipUserObjectCreate_Functional_3") { +TEST_CASE(Unit_hipUserObjectCreate_Functional_3) { SECTION("Called with int Object") { int* object = new int(); REQUIRE(object != nullptr); @@ -149,7 +134,7 @@ static void hipUserObjectCreate_Functional_4(void* object, void destroyObj(void* HIP_CHECK(hipUserObjectRelease(hObject, refCount + refCountRetain)); } -TEST_CASE("Unit_hipUserObjectCreate_Functional_4") { +TEST_CASE(Unit_hipUserObjectCreate_Functional_4) { SECTION("Called with int Object") { int* object = new int(); REQUIRE(object != nullptr); @@ -181,7 +166,7 @@ TEST_CASE("Unit_hipUserObjectCreate_Functional_4") { 5) Pass initialRefcount as INT_MAX 6) Pass flag other than hipUserObjectNoDestructorSync */ -TEST_CASE("Unit_hipUserObjectCreate_Negative") { +TEST_CASE(Unit_hipUserObjectCreate_Negative) { int* object = new int(); REQUIRE(object != nullptr); @@ -222,7 +207,7 @@ TEST_CASE("Unit_hipUserObjectCreate_Negative") { } } -TEST_CASE("Unit_hipUserObj_Negative_Test") { +TEST_CASE(Unit_hipUserObj_Negative_Test) { int* object = new int(); REQUIRE(object != nullptr); diff --git a/catch/unit/graph/hipUserObjectRelease.cc b/catch/unit/graph/hipUserObjectRelease.cc index 0b5606296..bc5fefd73 100644 --- a/catch/unit/graph/hipUserObjectRelease.cc +++ b/catch/unit/graph/hipUserObjectRelease.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -30,7 +14,7 @@ THE SOFTWARE. 2) Pass initialRefcount as 0 3) Pass initialRefcount as INT_MAX */ -TEST_CASE("Unit_hipUserObjectRelease_Negative") { +TEST_CASE(Unit_hipUserObjectRelease_Negative) { int* object = new int(); REQUIRE(object != nullptr); diff --git a/catch/unit/graph/hipUserObjectRetain.cc b/catch/unit/graph/hipUserObjectRetain.cc index 5fb48f10c..ddde39f57 100644 --- a/catch/unit/graph/hipUserObjectRetain.cc +++ b/catch/unit/graph/hipUserObjectRetain.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -30,7 +14,7 @@ THE SOFTWARE. 2) Pass initialRefcount as 0 3) Pass initialRefcount as INT_MAX */ -TEST_CASE("Unit_hipUserObjectRetain_Negative") { +TEST_CASE(Unit_hipUserObjectRetain_Negative) { int* object = new int(); REQUIRE(object != nullptr); diff --git a/catch/unit/graph/stream_capture_common.hh b/catch/unit/graph/stream_capture_common.hh index c53ae45be..e4d984e81 100644 --- a/catch/unit/graph/stream_capture_common.hh +++ b/catch/unit/graph/stream_capture_common.hh @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #pragma once #include diff --git a/catch/unit/graph/user_object_common.hh b/catch/unit/graph/user_object_common.hh index 4c6c3bacc..79f9f2466 100644 --- a/catch/unit/graph/user_object_common.hh +++ b/catch/unit/graph/user_object_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/hip_specific/CMakeLists.txt b/catch/unit/hip_specific/CMakeLists.txt index e65c50095..7235efeac 100644 --- a/catch/unit/hip_specific/CMakeLists.txt +++ b/catch/unit/hip_specific/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms diff --git a/catch/unit/hip_specific/hip_check_VGPRs.cpp b/catch/unit/hip_specific/hip_check_VGPRs.cpp index add00b7ab..9a1d0e656 100644 --- a/catch/unit/hip_specific/hip_check_VGPRs.cpp +++ b/catch/unit/hip_specific/hip_check_VGPRs.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -71,7 +55,7 @@ void test_vgprs_value() { REQUIRE(true); } -TEST_CASE("Unit_Device__hip_check_VGPRs") { +TEST_CASE(Unit_Device__hip_check_VGPRs) { hipDeviceProp_t props; hipFuncAttributes attr; int maxAvailableVgprsPerThread = 0; diff --git a/catch/unit/hip_specific/hip_hc_8pk.cc b/catch/unit/hip_specific/hip_hc_8pk.cc index d7a5919c1..8298d9371 100644 --- a/catch/unit/hip_specific/hip_hc_8pk.cc +++ b/catch/unit/hip_specific/hip_hc_8pk.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip_hc_8pk_negative_kernels_rtc.hh" @@ -45,7 +32,7 @@ __global__ void __hip_hc_add8pk_kernel(char4* out, char4 in1, char4 in2) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device__hip_hc_add8pk_Sanity_Positive") { +TEST_CASE(Unit_Device__hip_hc_add8pk_Sanity_Positive) { const char input1[] = {-0x70, -0x50, -0x30, -0x0f, 0x0, 0x01, 0x10, 0x20, 0x70, 0x7f}; const char input2[] = {-0x05, -0x11, -0x20, -0x03, 0x0, 0x30, 0x05, 0x33, 0x0f, 0x7a}; const char reference[] = {-0x75, -0x61, -0x50, -0x12, 0x0, 0x31, 0x15, 0x53, 0x7f, -0x07}; @@ -78,7 +65,7 @@ __global__ void __hip_hc_sub8pk_kernel(char4* out, char4 in1, char4 in2) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device__hip_hc_sub8pk_Sanity_Positive") { +TEST_CASE(Unit_Device__hip_hc_sub8pk_Sanity_Positive) { const char input1[] = {-0x70, -0x50, -0x30, -0x0f, 0x0, 0x30, 0x10, 0x33, 0x70, 0x7a}; const char input2[] = {-0x05, -0x11, -0x20, -0x03, 0x0, 0x01, 0x05, 0x20, 0x0f, 0x7f}; const char reference[] = {-0x6b, -0x3f, -0x10, -0x0c, 0x0, 0x2f, 0x0b, 0x13, 0x61, -0x05}; @@ -111,7 +98,7 @@ __global__ void __hip_hc_mul8pk_kernel(char4* out, char4 in1, char4 in2) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device__hip_hc_mul8pk_Sanity_Positive") { +TEST_CASE(Unit_Device__hip_hc_mul8pk_Sanity_Positive) { const char input1[] = {-0x70, -0x50, -0x30, -0x0f, 0x0, 0x01, 0x10, 0x20, 0x70, 0x7f}; const char input2[] = {0x05, -0x11, 0x22, -0x03, 0x0, 0x30, 0x05, 0x33, 0x0f, 0x7a}; const char reference[] = {-0x30, 0x50, -0x60, 0x2d, 0x0, 0x30, 0x50, 0x60, -0x70, -0x7a}; @@ -140,7 +127,7 @@ TEST_CASE("Unit_Device__hip_hc_mul8pk_Sanity_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device__hip_hc_8pk_Negative_Parameters_RTC") { +TEST_CASE(Unit_Device__hip_hc_8pk_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kHipHcAdd8pkBasic, kHipHcAdd8pkVector, kHipHcSub8pkBasic, diff --git a/catch/unit/hip_specific/hip_hc_8pk_negative_kernels.cc b/catch/unit/hip_specific/hip_hc_8pk_negative_kernels.cc index 9531250bf..c0e093fcb 100644 --- a/catch/unit/hip_specific/hip_hc_8pk_negative_kernels.cc +++ b/catch/unit/hip_specific/hip_hc_8pk_negative_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/hip_specific/hip_hc_8pk_negative_kernels_rtc.hh b/catch/unit/hip_specific/hip_hc_8pk_negative_kernels_rtc.hh index a2e89d880..d49ea1d28 100644 --- a/catch/unit/hip_specific/hip_hc_8pk_negative_kernels_rtc.hh +++ b/catch/unit/hip_specific/hip_hc_8pk_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/kernel/CMakeLists.txt b/catch/unit/kernel/CMakeLists.txt index 5e3fc2f55..e6caa4f05 100644 --- a/catch/unit/kernel/CMakeLists.txt +++ b/catch/unit/kernel/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(TEST_SRC diff --git a/catch/unit/kernel/hipAutoThreadIdx.cc b/catch/unit/kernel/hipAutoThreadIdx.cc index f8f0d209c..4c41a4cc7 100644 --- a/catch/unit/kernel/hipAutoThreadIdx.cc +++ b/catch/unit/kernel/hipAutoThreadIdx.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -50,7 +34,7 @@ static __global__ void vecSqrSingBlk(int* A_d, size_t NELEM) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_kernel_Assign_threadIdx_to_auto") { +TEST_CASE(Unit_kernel_Assign_threadIdx_to_auto) { int* A_d; const unsigned blocks = 256; const unsigned threadsPerBlock = 128; diff --git a/catch/unit/kernel/hipConfigureCall.cc b/catch/unit/kernel/hipConfigureCall.cc index 7bbccb7b3..7f9135311 100644 --- a/catch/unit/kernel/hipConfigureCall.cc +++ b/catch/unit/kernel/hipConfigureCall.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -30,7 +17,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_ConfigureCall") { +TEST_CASE(Unit_ConfigureCall) { struct dim3 grid_dim{}; struct dim3 block_dim{}; size_t shared_memory_size = 1024; @@ -49,7 +36,7 @@ TEST_CASE("Unit_ConfigureCall") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_ConfigureCall_CheckParams") { +TEST_CASE(Unit_ConfigureCall_CheckParams) { struct dim3 grid_dim{16, 8, 1}; struct dim3 test_grid_dim{}; struct dim3 block_dim{16, 8, 1}; diff --git a/catch/unit/kernel/hipDynamicShared.cc b/catch/unit/kernel/hipDynamicShared.cc index abb5ae400..7f382049e 100644 --- a/catch/unit/kernel/hipDynamicShared.cc +++ b/catch/unit/kernel/hipDynamicShared.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -124,7 +111,7 @@ template void testExternShared(size_t N, unsigned groupElements) { * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipDynamicShared") { +TEST_CASE(Unit_hipDynamicShared) { SECTION("test case with float for least size") { testExternShared(1024, 4); testExternShared(1024, 8); diff --git a/catch/unit/kernel/hipDynamicShared2.cc b/catch/unit/kernel/hipDynamicShared2.cc index 6b0f38bfb..4468707bd 100644 --- a/catch/unit/kernel/hipDynamicShared2.cc +++ b/catch/unit/kernel/hipDynamicShared2.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -57,7 +44,7 @@ __global__ void vectorAdd(float* Ad, float* Bd) { * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipDynamicShared2") { +TEST_CASE(Unit_hipDynamicShared2) { float *A, *B, *Ad, *Bd; A = new float[LEN]; B = new float[LEN]; diff --git a/catch/unit/kernel/hipEmptyKernel.cc b/catch/unit/kernel/hipEmptyKernel.cc index 1af9d80db..0e52947ac 100644 --- a/catch/unit/kernel/hipEmptyKernel.cc +++ b/catch/unit/kernel/hipEmptyKernel.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -48,7 +35,7 @@ __global__ void Empty(int param) {} * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipEmptyKernel") { +TEST_CASE(Unit_hipEmptyKernel) { hipLaunchKernelGGL(HIP_KERNEL_NAME(Empty), dim3(1), dim3(1), 0, 0, 0); HIP_CHECK(hipDeviceSynchronize()); } diff --git a/catch/unit/kernel/hipExtLaunchKernelGGLBasic.cc b/catch/unit/kernel/hipExtLaunchKernelGGLBasic.cc index ce53799c4..f4632b77b 100644 --- a/catch/unit/kernel/hipExtLaunchKernelGGLBasic.cc +++ b/catch/unit/kernel/hipExtLaunchKernelGGLBasic.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Test the Grid_Launch syntax. #include @@ -118,7 +106,7 @@ arguments * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipExtLaunchKernelGGL") { +TEST_CASE(Unit_hipExtLaunchKernelGGL) { SECTION("test run") { size_t N = 4 * 1024 * 1024; test(N); diff --git a/catch/unit/kernel/hipGridLaunch.cc b/catch/unit/kernel/hipGridLaunch.cc index 79d811f44..9814656d2 100644 --- a/catch/unit/kernel/hipGridLaunch.cc +++ b/catch/unit/kernel/hipGridLaunch.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Test the Grid_Launch syntax. #include @@ -103,7 +91,7 @@ int test_triple_chevron(size_t N) { * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipGridLaunch") { +TEST_CASE(Unit_hipGridLaunch) { size_t N = 4 * 1024 * 1024; SECTION("Test test_gl2") { test_gl2(N); } diff --git a/catch/unit/kernel/hipLanguageExtensions.cc b/catch/unit/kernel/hipLanguageExtensions.cc index 46e32ac39..2998a05b1 100644 --- a/catch/unit/kernel/hipLanguageExtensions.cc +++ b/catch/unit/kernel/hipLanguageExtensions.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -98,7 +85,7 @@ template __global__ void vectorADD(T __restrict__* A_d, T* B_d, T* * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipLanguageExtensions") { REQUIRE(true); } +TEST_CASE(Unit_hipLanguageExtensions) { REQUIRE(true); } /** * End doxygen group KernelTest. diff --git a/catch/unit/kernel/hipLaunchBounds.cc b/catch/unit/kernel/hipLaunchBounds.cc index 04c7ba83a..ed0b23718 100644 --- a/catch/unit/kernel/hipLaunchBounds.cc +++ b/catch/unit/kernel/hipLaunchBounds.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : hipLaunchBounds_With_maxThreadsPerBlock @@ -58,7 +45,7 @@ static bool verify(int N, int* x, int val) { return true; } -TEST_CASE("Unit_hipLaunchBounds_With_maxThreadsPerBlock_Check") { +TEST_CASE(Unit_hipLaunchBounds_With_maxThreadsPerBlock_Check) { constexpr size_t N = 10000; hipError_t ret; int* x; @@ -98,7 +85,7 @@ TEST_CASE("Unit_hipLaunchBounds_With_maxThreadsPerBlock_Check") { HIP_CHECK(hipFree(x)); } -TEST_CASE("Unit_hipLaunchBounds_With_maxThreadsPerBlock_blocksPerCU_Check") { +TEST_CASE(Unit_hipLaunchBounds_With_maxThreadsPerBlock_blocksPerCU_Check) { constexpr size_t N = 10000; hipError_t ret; int* x; diff --git a/catch/unit/kernel/hipLaunchBoundsBasic.cc b/catch/unit/kernel/hipLaunchBoundsBasic.cc index a74a617c1..781d224dd 100644 --- a/catch/unit/kernel/hipLaunchBoundsBasic.cc +++ b/catch/unit/kernel/hipLaunchBoundsBasic.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include @@ -51,7 +39,7 @@ __global__ void __launch_bounds__(256, 2) myKern(int* C, const int* A, int N) { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_kernel_LaunchBounds_Functional") { +TEST_CASE(Unit_kernel_LaunchBounds_Functional) { size_t Nbytes = N * sizeof(int); int *A_d, *C_d, *A_h, *C_h; HIPCHECK(hipMalloc(&A_d, Nbytes)); diff --git a/catch/unit/kernel/hipLaunchKernelEx.cc b/catch/unit/kernel/hipLaunchKernelEx.cc index 7d17a8212..25729eca9 100644 --- a/catch/unit/kernel/hipLaunchKernelEx.cc +++ b/catch/unit/kernel/hipLaunchKernelEx.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -137,7 +125,7 @@ __global__ void normalKernel(int* output, int totalThreads) { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipLaunchKernelExC_NegetiveTsts") { +TEST_CASE(Unit_hipLaunchKernelExC_NegetiveTsts) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -207,7 +195,7 @@ TEST_CASE("Unit_hipLaunchKernelExC_NegetiveTsts") { * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipLaunchKernelEx_NegetiveTsts") { +TEST_CASE(Unit_hipLaunchKernelEx_NegetiveTsts) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -330,7 +318,7 @@ bool runTest(const char* testName, const void* kernelFunc, int totalThreads, int * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipLaunchKernelEx_Functional") { +TEST_CASE(Unit_hipLaunchKernelEx_Functional) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -362,7 +350,7 @@ TEST_CASE("Unit_hipLaunchKernelEx_Functional") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipLaunchKernelEx_With_Different_Kernels") { +TEST_CASE(Unit_hipLaunchKernelEx_With_Different_Kernels) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -434,7 +422,7 @@ TEST_CASE("Unit_hipLaunchKernelEx_With_Different_Kernels") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipLaunchKernelEx_With_CooperativeKernelWithArgs") { +TEST_CASE(Unit_hipLaunchKernelEx_With_CooperativeKernelWithArgs) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -497,7 +485,7 @@ TEST_CASE("Unit_hipLaunchKernelEx_With_CooperativeKernelWithArgs") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipLaunchKernelEx_With_MaxBlockDims") { +TEST_CASE(Unit_hipLaunchKernelEx_With_MaxBlockDims) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; diff --git a/catch/unit/kernel/hipLaunchParm.cc b/catch/unit/kernel/hipLaunchParm.cc index 00eb4d9d3..722fc8291 100644 --- a/catch/unit/kernel/hipLaunchParm.cc +++ b/catch/unit/kernel/hipLaunchParm.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -542,7 +529,7 @@ template __global__ void myKernel(T1 a, T2 b) {} * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipLaunchParm") { +TEST_CASE(Unit_hipLaunchParm) { hipMallocError = hipMalloc(reinterpret_cast(&result_d), BLOCK_DIM_SIZE * sizeof(bool)); hipHostMallocError = hipHostMalloc(reinterpret_cast(&result_h), BLOCK_DIM_SIZE * sizeof(bool)); diff --git a/catch/unit/kernel/hipLaunchParmFunctor.cc b/catch/unit/kernel/hipLaunchParmFunctor.cc index 7cb9756ea..240086322 100644 --- a/catch/unit/kernel/hipLaunchParmFunctor.cc +++ b/catch/unit/kernel/hipLaunchParmFunctor.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -402,7 +389,7 @@ void HipFunctorTests::TestForFunctorContainInStructObj(void) { * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipLaunchParmFunctor") { +TEST_CASE(Unit_hipLaunchParmFunctor) { HipFunctorTests FunctorTests; SECTION("test for simple class functor") { FunctorTests.TestForSimpleClassFunctor(); } diff --git a/catch/unit/kernel/hipMemFaultStackAllocation.cc b/catch/unit/kernel/hipMemFaultStackAllocation.cc index 303d71802..bfd20eaf0 100644 --- a/catch/unit/kernel/hipMemFaultStackAllocation.cc +++ b/catch/unit/kernel/hipMemFaultStackAllocation.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -63,7 +50,7 @@ static bool verify(const int* C_d, const int* A_d) { return true; } -TEST_CASE("Unit_hipMemFaultStackAllocation_Check") { +TEST_CASE(Unit_hipMemFaultStackAllocation_Check) { hipError_t ret; int *A_d, *C_d; const size_t Nbytes = N * sizeof(int); diff --git a/catch/unit/kernel/hipPrintfKernel.cc b/catch/unit/kernel/hipPrintfKernel.cc index a448ed119..dc144ff24 100644 --- a/catch/unit/kernel/hipPrintfKernel.cc +++ b/catch/unit/kernel/hipPrintfKernel.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -45,7 +33,7 @@ __global__ void run_printf() { printf("Hello World"); } * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_kernel_ChkPrintf", "[multigpu]") { +TEST_CASE(Unit_kernel_ChkPrintf) { int device_count = 0; HIP_CHECK(hipGetDeviceCount(&device_count)); CaptureStream capture; diff --git a/catch/unit/kernel/hipSetupArgument.cc b/catch/unit/kernel/hipSetupArgument.cc index 11ee513e6..990c352ca 100644 --- a/catch/unit/kernel/hipSetupArgument.cc +++ b/catch/unit/kernel/hipSetupArgument.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -27,7 +14,7 @@ __global__ void add_vectors(int* a, int* b, int* result, int size) { } } -TEST_CASE("Unit_hipSetupArgument_Simple") { +TEST_CASE(Unit_hipSetupArgument_Simple) { dim3 grid_dim(1, 1, 1); dim3 block_dim(1, 1, 1); @@ -48,7 +35,7 @@ TEST_CASE("Unit_hipSetupArgument_Simple") { * ------------------------ * - unit/kernel/hipSetupArgument.cc */ -TEST_CASE("Unit_hipSetupArgument_Execute_Kernel_And_Check_Result") { +TEST_CASE(Unit_hipSetupArgument_Execute_Kernel_And_Check_Result) { constexpr auto block_size = 32; auto vec_size = 256; size_t block_num = static_cast(std::ceil(static_cast(vec_size) / block_size)); diff --git a/catch/unit/kernel/hipTestConstant.cc b/catch/unit/kernel/hipTestConstant.cc index 08699ed92..684cea94c 100644 --- a/catch/unit/kernel/hipTestConstant.cc +++ b/catch/unit/kernel/hipTestConstant.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include @@ -50,7 +38,7 @@ static __global__ void Get(int* Ad) { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_kernel_chkConstantViaKernel") { +TEST_CASE(Unit_kernel_chkConstantViaKernel) { int *A, *B, *Ad; A = new int[LEN]; B = new int[LEN]; diff --git a/catch/unit/kernel/hipTestGlobalVariable.cc b/catch/unit/kernel/hipTestGlobalVariable.cc index 03b60720c..a450f9ea9 100644 --- a/catch/unit/kernel/hipTestGlobalVariable.cc +++ b/catch/unit/kernel/hipTestGlobalVariable.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include @@ -95,7 +83,7 @@ void runTestGlobalArray() { HIP_CHECK(hipFree(Ad)); } -TEST_CASE("Unit_kernel_chkGlobalArrAndGlobalVaribleViaKernelFn") { +TEST_CASE(Unit_kernel_chkGlobalArrAndGlobalVaribleViaKernelFn) { runTestConstantGlobalVar(); runTestGlobalArray(); } diff --git a/catch/unit/kernel/hipTestMemKernel.cc b/catch/unit/kernel/hipTestMemKernel.cc index 73fa9117a..c344affa3 100644 --- a/catch/unit/kernel/hipTestMemKernel.cc +++ b/catch/unit/kernel/hipTestMemKernel.cc @@ -1,21 +1,9 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include @@ -96,7 +84,7 @@ __global__ void MemSet12(uint8_t* In) { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_kernel_MemoryOperationsViaKernels") { +TEST_CASE(Unit_kernel_MemoryOperationsViaKernels) { uint8_t *A, *Ad, *B, *Bd, *C, *Cd; A = new uint8_t[LEN8]; B = new uint8_t[LEN8]; diff --git a/catch/unit/kernel/printf_common.h b/catch/unit/kernel/printf_common.h index 231318718..0fb5def2f 100644 --- a/catch/unit/kernel/printf_common.h +++ b/catch/unit/kernel/printf_common.h @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #ifndef _STRESSTEST_PRINTF_COMMON_H_ #define _STRESSTEST_PRINTF_COMMON_H_ diff --git a/catch/unit/launchBounds/CMakeLists.txt b/catch/unit/launchBounds/CMakeLists.txt index 0ac2ac8e2..51a9cea0b 100644 --- a/catch/unit/launchBounds/CMakeLists.txt +++ b/catch/unit/launchBounds/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC launch_bounds.cc diff --git a/catch/unit/launchBounds/launch_bounds.cc b/catch/unit/launchBounds/launch_bounds.cc index 20f582e35..edce34ac8 100644 --- a/catch/unit/launchBounds/launch_bounds.cc +++ b/catch/unit/launchBounds/launch_bounds.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "launch_bounds_negative_kernels_rtc.hh" @@ -96,7 +83,7 @@ template void LaunchBoundsWrapper(const int threads_per_blo * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Kernel_Launch_bounds_Positive_Basic") { +TEST_CASE(Unit_Kernel_Launch_bounds_Positive_Basic) { auto threads_per_block = GENERATE(1, kMaxThreadsPerBlock / 2, kMaxThreadsPerBlock); LaunchBoundsWrapper(threads_per_block); } @@ -116,7 +103,7 @@ TEST_CASE("Unit_Kernel_Launch_bounds_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Kernel_Launch_bounds_Negative_OutOfBounds") { +TEST_CASE(Unit_Kernel_Launch_bounds_Negative_OutOfBounds) { auto threads_per_block = GENERATE(-1 * kMaxThreadsPerBlock, -1, kMaxThreadsPerBlock + 1, 2 * kMaxThreadsPerBlock); LaunchBoundsWrapper(threads_per_block); @@ -138,7 +125,7 @@ TEST_CASE("Unit_Kernel_Launch_bounds_Negative_OutOfBounds") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Kernel_Launch_bounds_Negative_Parameters_RTC") { +TEST_CASE(Unit_Kernel_Launch_bounds_Negative_Parameters_RTC) { hiprtcProgram program{}; const auto program_source = GENERATE(kMaxThreadsNotInt, kMinWarpsNotInt); diff --git a/catch/unit/launchBounds/launch_bounds_compiler_error_kernels.cc b/catch/unit/launchBounds/launch_bounds_compiler_error_kernels.cc index 4a8ec9885..0314b2081 100644 --- a/catch/unit/launchBounds/launch_bounds_compiler_error_kernels.cc +++ b/catch/unit/launchBounds/launch_bounds_compiler_error_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/launchBounds/launch_bounds_negative_kernels_rtc.hh b/catch/unit/launchBounds/launch_bounds_negative_kernels_rtc.hh index a341ce67f..6aac70c19 100644 --- a/catch/unit/launchBounds/launch_bounds_negative_kernels_rtc.hh +++ b/catch/unit/launchBounds/launch_bounds_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/launchBounds/launch_bounds_parse_error_kernels.cc b/catch/unit/launchBounds/launch_bounds_parse_error_kernels.cc index e0ed6093f..22c97f4d6 100644 --- a/catch/unit/launchBounds/launch_bounds_parse_error_kernels.cc +++ b/catch/unit/launchBounds/launch_bounds_parse_error_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/library/CMakeLists.txt b/catch/unit/library/CMakeLists.txt index d6742d912..d567cfb82 100644 --- a/catch/unit/library/CMakeLists.txt +++ b/catch/unit/library/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + set(TEST_SRC loadlib_rtc.cc #loadlib_co.cc TODO @@ -6,29 +10,42 @@ set(TEST_SRC lib_attribute.cc ) -add_custom_target(library_code_load.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/library_code_load.cc - -o ${CMAKE_CURRENT_BINARY_DIR}/../library/library_code_load.code ${OFFLOAD_ARCH_LIST} +if (HIP_PLATFORM MATCHES "amd") + add_custom_target(library_code_load.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/library_code_load.cc + -o ${CMAKE_CURRENT_BINARY_DIR}/../library/library_code_load.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}) -set_property(GLOBAL APPEND PROPERTY - G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/library_code_load.code) - add_custom_target(reverse_kernel.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/reverse_kernel.cc - -o ${CMAKE_CURRENT_BINARY_DIR}/../library/reverse_kernel.code ${OFFLOAD_ARCH_LIST} + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/reverse_kernel.cc + -o ${CMAKE_CURRENT_BINARY_DIR}/../library/reverse_kernel.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT}) +else() + add_custom_target(library_code_load.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin -x cu ${CMAKE_CURRENT_SOURCE_DIR}/library_code_load.cc + -o ${CMAKE_CURRENT_BINARY_DIR}/../library/library_code_load.code ${OFFLOAD_ARCH_LIST} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include + -I${HIP_INCLUDE_DIR}) +add_custom_target(reverse_kernel.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin -x cu ${CMAKE_CURRENT_SOURCE_DIR}/reverse_kernel.cc + -o ${CMAKE_CURRENT_BINARY_DIR}/../library/reverse_kernel.code ${OFFLOAD_ARCH_LIST} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include + -I${HIP_INCLUDE_DIR} ) +endif() +set_property(GLOBAL APPEND PROPERTY + G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/library_code_load.code) + set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/reverse_kernel.code) if(HIP_PLATFORM MATCHES "amd") - hip_add_exe_to_target(NAME LibraryTests + hip_add_exe_to_target(NAME LibraryTests TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests LINKER_LIBS hiprtc::hiprtc) else() - hip_add_exe_to_target(NAME LibraryTests + hip_add_exe_to_target(NAME LibraryTests TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests LINKER_LIBS nvrtc) diff --git a/catch/unit/library/hipKernelGetAttribute.cc b/catch/unit/library/hipKernelGetAttribute.cc index ddf741176..c5f9b97f0 100644 --- a/catch/unit/library/hipKernelGetAttribute.cc +++ b/catch/unit/library/hipKernelGetAttribute.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/library/lib_attribute.cc b/catch/unit/library/lib_attribute.cc index e81906a67..446ab8558 100644 --- a/catch/unit/library/lib_attribute.cc +++ b/catch/unit/library/lib_attribute.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/library/library_negative.cc b/catch/unit/library/library_negative.cc index 32c1f652e..73b07b455 100644 --- a/catch/unit/library/library_negative.cc +++ b/catch/unit/library/library_negative.cc @@ -1,28 +1,12 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include -TEST_CASE("Unit_library_negative") { +TEST_CASE(Unit_library_negative) { SECTION("load negative") { HIP_CHECK_ERROR(hipLibraryLoadData(nullptr, nullptr, nullptr, nullptr, 0, nullptr, nullptr, 0), hipErrorInvalidValue); diff --git a/catch/unit/library/loadlib_co.cc b/catch/unit/library/loadlib_co.cc index 268958d7c..882956763 100644 --- a/catch/unit/library/loadlib_co.cc +++ b/catch/unit/library/loadlib_co.cc @@ -1,29 +1,13 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include -TEST_CASE("Unit_hip_library_load_co") { +TEST_CASE(Unit_hip_library_load_co) { constexpr size_t size = 32; constexpr size_t num_kernels = 3; std::vector input1, input2; @@ -213,7 +197,7 @@ TEST_CASE("Unit_hip_library_load_co") { HIP_CHECK(hipFree(d_out)); } -TEST_CASE("Unit_hipKernelGetParamInfo_Negative") { +TEST_CASE(Unit_hipKernelGetParamInfo_Negative) { size_t offset, paramsize; SECTION("Kernel as nullptr") { diff --git a/catch/unit/library/loadlib_rtc.cc b/catch/unit/library/loadlib_rtc.cc index 18c463428..38fdaee9e 100644 --- a/catch/unit/library/loadlib_rtc.cc +++ b/catch/unit/library/loadlib_rtc.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -44,7 +28,7 @@ static std::vector compile_using_hiprtc(const std::string& code, std::stri return res; } -TEST_CASE("Unit_hip_library_load_rtc") { +TEST_CASE(Unit_hip_library_load_rtc) { constexpr size_t size = 32; const std::string kernel1 = "extern \"C\" __global__ void add_kernel(float* out, float*a, float*b) { size_t i = " diff --git a/catch/unit/math/CMakeLists.txt b/catch/unit/math/CMakeLists.txt index ccd8d2de1..94aad198b 100644 --- a/catch/unit/math/CMakeLists.txt +++ b/catch/unit/math/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC trig_funcs.cc @@ -55,8 +39,9 @@ hip_add_exe_to_target(NAME MathsTest COMMON_SHARED_SRC ${COMMON_SHARED_SRC} LINKER_LIBS ${LINKER_LIBS}) + if(UNIX) -file(GLOB NEGATIVE_TEST_SRC + file(GLOB NEGATIVE_TEST_SRC "trig_single_precision_negative_kernels.cc" "trig_double_precision_negative_kernels.cc" "misc_negative_kernels.cc" @@ -82,107 +67,107 @@ file(GLOB NEGATIVE_TEST_SRC "casting_half_float_negative_kernels.cc" ) -file(COPY ${NEGATIVE_TEST_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src) -set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC}) + file(COPY ${NEGATIVE_TEST_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src) + set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC}) -#if(HIP_PLATFORM MATCHES "nvidia") -# set(ERRORS_1 81) -# set(ERRORS_2 100) -#elseif(HIP_PLATFORM MATCHES "amd") -# set(ERRORS_1 76) -# set(ERRORS_2 168) -#endif() -# -#add_test(NAME Unit_Device_Single_Precision_Trig_Functions_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# trig_single_precision_negative_kernels.cc 66) -#add_test(NAME Unit_Device_Double_Precision_Trig_Functions_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# trig_double_precision_negative_kernels.cc 66) -#add_test(NAME Unit_Device_Misc_Functions_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# misc_negative_kernels.cc ${ERRORS_1}) -#add_test(NAME Unit_Device_remainder_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# math_remainder_negative_kernels.cc 67) -#add_test(NAME Unit_Device_rounding_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# math_rounding_negative_kernels.cc 40) -#add_test(NAME Unit_Single_Precision_Intrinsics_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# single_precision_intrinsics_negative_kernels.cc 42) -#add_test(NAME Unit_Double_Precision_Intrinsics_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# double_precision_intrinsics_negative_kernels.cc 18) -#add_test(NAME Unit_Integer_Intrinsics_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# integer_intrinsics_negative_kernels.cc 20) -#add_test(NAME Unit_Device_root_1Dand2D_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# math_root_negative_kernels_1Dand2D.cc 68) -#add_test(NAME Unit_Device_root_3Dand4D_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# math_root_negative_kernels_3Dand4D.cc 56) -#add_test(NAME Unit_Device_pow_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# math_pow_negative_kernels.cc 76) -#add_test(NAME Unit_Device_log_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# math_log_negative_kernels.cc 24) -#add_test(NAME Unit_Device_special_funcs_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# math_special_func_kernels.cc 76) -#add_test(NAME Unit_Device_casting_double_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# casting_double_negative_kernels.cc 69) -#add_test(NAME Unit_Device_casting_float_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# casting_float_negative_kernels.cc 54) -#add_test(NAME Unit_Device_casting_int_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# casting_int_negative_kernels.cc 92) -#add_test(NAME Unit_Device_casting_half2_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# casting_half2_negative_kernels.cc 53) -#add_test(NAME Unit_Half_Precision_Math_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# half_precision_math_negative_kernels.cc 60) -#add_test(NAME Unit_Half_Precision_Arithmetic_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# half_precision_arithmetic_negative_kernels.cc 88) -#add_test(NAME Unit_Half_Precision_Comparison_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# half_precision_comparison_negative_kernels.cc ${ERRORS_2}) -#add_test(NAME Unit_Device_casting_half2int_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# casting_half2int_negative_kernels.cc 78) -#add_test(NAME Unit_Device_casting_int2half_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# casting_int2half_negative_kernels.cc 78) -#add_test(NAME Unit_Device_casting_half_float_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# casting_half_float_negative_kernels.cc 18) + #if(HIP_PLATFORM MATCHES "nvidia") + # set(ERRORS_1 81) + # set(ERRORS_2 100) + #elseif(HIP_PLATFORM MATCHES "amd") + # set(ERRORS_1 76) + # set(ERRORS_2 168) + #endif() + # + #add_test(NAME Unit_Device_Single_Precision_Trig_Functions_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # trig_single_precision_negative_kernels.cc 66) + #add_test(NAME Unit_Device_Double_Precision_Trig_Functions_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # trig_double_precision_negative_kernels.cc 66) + #add_test(NAME Unit_Device_Misc_Functions_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # misc_negative_kernels.cc ${ERRORS_1}) + #add_test(NAME Unit_Device_remainder_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # math_remainder_negative_kernels.cc 67) + #add_test(NAME Unit_Device_rounding_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # math_rounding_negative_kernels.cc 40) + #add_test(NAME Unit_Single_Precision_Intrinsics_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # single_precision_intrinsics_negative_kernels.cc 42) + #add_test(NAME Unit_Double_Precision_Intrinsics_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # double_precision_intrinsics_negative_kernels.cc 18) + #add_test(NAME Unit_Integer_Intrinsics_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # integer_intrinsics_negative_kernels.cc 20) + #add_test(NAME Unit_Device_root_1Dand2D_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # math_root_negative_kernels_1Dand2D.cc 68) + #add_test(NAME Unit_Device_root_3Dand4D_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # math_root_negative_kernels_3Dand4D.cc 56) + #add_test(NAME Unit_Device_pow_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # math_pow_negative_kernels.cc 76) + #add_test(NAME Unit_Device_log_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # math_log_negative_kernels.cc 24) + #add_test(NAME Unit_Device_special_funcs_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # math_special_func_kernels.cc 76) + #add_test(NAME Unit_Device_casting_double_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # casting_double_negative_kernels.cc 69) + #add_test(NAME Unit_Device_casting_float_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # casting_float_negative_kernels.cc 54) + #add_test(NAME Unit_Device_casting_int_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # casting_int_negative_kernels.cc 92) + #add_test(NAME Unit_Device_casting_half2_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # casting_half2_negative_kernels.cc 53) + #add_test(NAME Unit_Half_Precision_Math_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # half_precision_math_negative_kernels.cc 60) + #add_test(NAME Unit_Half_Precision_Arithmetic_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # half_precision_arithmetic_negative_kernels.cc 88) + #add_test(NAME Unit_Half_Precision_Comparison_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # half_precision_comparison_negative_kernels.cc ${ERRORS_2}) + #add_test(NAME Unit_Device_casting_half2int_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # casting_half2int_negative_kernels.cc 78) + #add_test(NAME Unit_Device_casting_int2half_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # casting_int2half_negative_kernels.cc 78) + #add_test(NAME Unit_Device_casting_half_float_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # casting_half_float_negative_kernels.cc 18) endif() diff --git a/catch/unit/math/Float16.hh b/catch/unit/math/Float16.hh index 0983be733..386723499 100644 --- a/catch/unit/math/Float16.hh +++ b/catch/unit/math/Float16.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/binary_common.hh b/catch/unit/math/binary_common.hh index c0764e713..4dee1a983 100644 --- a/catch/unit/math/binary_common.hh +++ b/catch/unit/math/binary_common.hh @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once @@ -131,7 +116,7 @@ void BinaryFloatingPointTest(kernel_sig kernel, ref_sig; \ RT (*ref)(RT, RT) = ref_func; \ const auto ulp = std::is_same_v ? sp_ulp : dp_ulp; \ diff --git a/catch/unit/math/casting_common.hh b/catch/unit/math/casting_common.hh index 84559b2f9..19ac36708 100644 --- a/catch/unit/math/casting_common.hh +++ b/catch/unit/math/casting_common.hh @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/casting_double_funcs.cc b/catch/unit/math/casting_double_funcs.cc index 7ee36bfea..8e6fa45c3 100644 --- a/catch/unit/math/casting_double_funcs.cc +++ b/catch/unit/math/casting_double_funcs.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "casting_common.hh" #include "casting_double_negative_kernels_rtc.hh" @@ -32,7 +17,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, T, double) \ CAST_F2I_REF_DEF(kern_name, T, double, ref_func) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T (*ref)(double) = kern_name##_ref; \ CastDoublePrecisionTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -41,7 +26,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, T, double) \ CAST_F2I_RZ_REF_DEF(kern_name, T, double) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T (*ref)(double) = kern_name##_ref; \ CastDoublePrecisionTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -122,7 +107,7 @@ CAST_DOUBLE2INT_RZ_TEST_DEF(__double2int_rz, int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double2int_Negative_RTC") { NegativeTestRTCWrapper<12>(kDouble2Int); } +TEST_CASE(Unit_Device___double2int_Negative_RTC) { NegativeTestRTCWrapper<12>(kDouble2Int); } /** * Test Description @@ -200,13 +185,13 @@ CAST_DOUBLE2INT_RZ_TEST_DEF(__double2uint_rz, unsigned int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double2uint_Negative_RTC") { NegativeTestRTCWrapper<12>(kDouble2Uint); } +TEST_CASE(Unit_Device___double2uint_Negative_RTC) { NegativeTestRTCWrapper<12>(kDouble2Uint); } #define CAST_DOUBLE2LL_TEST_DEF(kern_name, T, ref_func) \ CAST_KERNEL_DEF(kern_name, T, double) \ CAST_F2I_REF_DEF(kern_name, T, double, ref_func) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T (*ref)(double) = kern_name##_ref; \ UnaryDoublePrecisionBruteForceTest(kern_name##_kernel, ref, EqValidatorBuilderFactory(), \ static_cast(std::numeric_limits::min()), \ @@ -217,7 +202,7 @@ TEST_CASE("Unit_Device___double2uint_Negative_RTC") { NegativeTestRTCWrapper<12> CAST_KERNEL_DEF(kern_name, T, double) \ CAST_F2I_RZ_REF_DEF(kern_name, T, double) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T (*ref)(double) = kern_name##_ref; \ UnaryDoublePrecisionBruteForceTest(kern_name##_kernel, ref, EqValidatorBuilderFactory(), \ static_cast(std::numeric_limits::min()), \ @@ -300,7 +285,7 @@ CAST_DOUBLE2LL_RZ_TEST_DEF(__double2ll_rz, long long int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double2ll_Negative_RTC") { NegativeTestRTCWrapper<12>(kDouble2LL); } +TEST_CASE(Unit_Device___double2ll_Negative_RTC) { NegativeTestRTCWrapper<12>(kDouble2LL); } /** * Test Description @@ -378,13 +363,13 @@ CAST_DOUBLE2LL_RZ_TEST_DEF(__double2ull_rz, unsigned long long int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double2ull_Negative_RTC") { NegativeTestRTCWrapper<12>(kDouble2ULL); } +TEST_CASE(Unit_Device___double2ull_Negative_RTC) { NegativeTestRTCWrapper<12>(kDouble2ULL); } #define CAST_DOUBLE2FLOAT_TEST_DEF(kern_name, round_dir) \ CAST_KERNEL_DEF(kern_name, float, double) \ CAST_RND_REF_DEF(kern_name, float, double, round_dir) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ float (*ref)(double) = kern_name##_ref; \ CastDoublePrecisionTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -393,7 +378,7 @@ TEST_CASE("Unit_Device___double2ull_Negative_RTC") { NegativeTestRTCWrapper<12>( CAST_KERNEL_DEF(kern_name, float, double) \ CAST_REF_DEF(kern_name, float, double) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ float (*ref)(double) = kern_name##_ref; \ CastDoublePrecisionTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -474,7 +459,7 @@ CAST_DOUBLE2FLOAT_TEST_DEF(__double2float_rz, FE_TOWARDZERO) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double2float_Negative_RTC") { NegativeTestRTCWrapper<12>(kDouble2Float); } +TEST_CASE(Unit_Device___double2float_Negative_RTC) { NegativeTestRTCWrapper<12>(kDouble2Float); } CAST_KERNEL_DEF(__double2hiint, int, double) @@ -498,7 +483,7 @@ int __double2hiint_ref(double arg) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double2hiint_Positive") { +TEST_CASE(Unit_Device___double2hiint_Positive) { int (*ref)(double) = __double2hiint_ref; CastDoublePrecisionTest(__double2hiint_kernel, ref, EqValidatorBuilderFactory()); } @@ -515,7 +500,7 @@ TEST_CASE("Unit_Device___double2hiint_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double2hiint_Negative_RTC") { NegativeTestRTCWrapper<3>(kDouble2Hiint); } +TEST_CASE(Unit_Device___double2hiint_Negative_RTC) { NegativeTestRTCWrapper<3>(kDouble2Hiint); } CAST_KERNEL_DEF(__double2loint, int, double) @@ -539,7 +524,7 @@ int __double2loint_ref(double arg) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double2loint_Positive") { +TEST_CASE(Unit_Device___double2loint_Positive) { int (*ref)(double) = __double2loint_ref; CastDoublePrecisionTest(__double2loint_kernel, ref, EqValidatorBuilderFactory()); } @@ -556,7 +541,7 @@ TEST_CASE("Unit_Device___double2loint_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double2loint_Negative_RTC") { NegativeTestRTCWrapper<3>(kDouble2Loint); } +TEST_CASE(Unit_Device___double2loint_Negative_RTC) { NegativeTestRTCWrapper<3>(kDouble2Loint); } CAST_KERNEL_DEF(__double_as_longlong, long long int, double) @@ -574,7 +559,7 @@ CAST_KERNEL_DEF(__double_as_longlong, long long int, double) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double_as_longlong_Positive") { +TEST_CASE(Unit_Device___double_as_longlong_Positive) { long long int (*ref)(double) = type2_as_type1_ref; CastDoublePrecisionTest(__double_as_longlong_kernel, ref, EqValidatorBuilderFactory()); @@ -592,7 +577,7 @@ TEST_CASE("Unit_Device___double_as_longlong_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___double_as_longlong_Negative_RTC") { +TEST_CASE(Unit_Device___double_as_longlong_Negative_RTC) { NegativeTestRTCWrapper<3>(kDoubleAsLonglong); } diff --git a/catch/unit/math/casting_double_negative_kernels.cc b/catch/unit/math/casting_double_negative_kernels.cc index 8386107ae..e4859f9ed 100644 --- a/catch/unit/math/casting_double_negative_kernels.cc +++ b/catch/unit/math/casting_double_negative_kernels.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/casting_double_negative_kernels_rtc.hh b/catch/unit/math/casting_double_negative_kernels_rtc.hh index 440f4cad9..dc8830159 100644 --- a/catch/unit/math/casting_double_negative_kernels_rtc.hh +++ b/catch/unit/math/casting_double_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/casting_float_funcs.cc b/catch/unit/math/casting_float_funcs.cc index bb0888d1c..7e2355360 100644 --- a/catch/unit/math/casting_float_funcs.cc +++ b/catch/unit/math/casting_float_funcs.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "casting_common.hh" #include "casting_float_negative_kernels_rtc.hh" @@ -32,7 +17,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, T, float) \ CAST_F2I_REF_DEF(kern_name, T, float, ref_func) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T (*ref)(float) = kern_name##_ref; \ UnarySinglePrecisionRangeTest(kern_name##_kernel, ref, EqValidatorBuilderFactory(), \ std::numeric_limits::lowest(), \ @@ -43,7 +28,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, T, float) \ CAST_F2I_RZ_REF_DEF(kern_name, T, float) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T (*ref)(float) = kern_name##_ref; \ UnarySinglePrecisionRangeTest(kern_name##_kernel, ref, EqValidatorBuilderFactory(), \ std::numeric_limits::lowest(), \ @@ -122,7 +107,7 @@ CAST_FLOAT2INT_TEST_DEF(__float2int_rz, int, std::trunc) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float2int_Negative_RTC") { NegativeTestRTCWrapper<12>(kFloat2Int); } +TEST_CASE(Unit_Device___float2int_Negative_RTC) { NegativeTestRTCWrapper<12>(kFloat2Int); } /** * Test Description @@ -197,13 +182,13 @@ CAST_FLOAT2INT_RZ_TEST_DEF(__float2uint_rz, unsigned int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float2uint_Negative_RTC") { NegativeTestRTCWrapper<12>(kFloat2Uint); } +TEST_CASE(Unit_Device___float2uint_Negative_RTC) { NegativeTestRTCWrapper<12>(kFloat2Uint); } #define CAST_FLOAT2LL_TEST_DEF(kern_name, T, ref_func) \ CAST_KERNEL_DEF(kern_name, T, float) \ CAST_F2I_REF_DEF(kern_name, T, float, ref_func) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T (*ref)(float) = kern_name##_ref; \ UnarySinglePrecisionRangeTest(kern_name##_kernel, ref, EqValidatorBuilderFactory(), \ static_cast(std::numeric_limits::min()), \ @@ -214,7 +199,7 @@ TEST_CASE("Unit_Device___float2uint_Negative_RTC") { NegativeTestRTCWrapper<12>( CAST_KERNEL_DEF(kern_name, T, float) \ CAST_F2I_RZ_REF_DEF(kern_name, T, float) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T (*ref)(float) = kern_name##_ref; \ UnarySinglePrecisionRangeTest(kern_name##_kernel, ref, EqValidatorBuilderFactory(), \ static_cast(std::numeric_limits::min()), \ @@ -294,7 +279,7 @@ CAST_FLOAT2LL_RZ_TEST_DEF(__float2ll_rz, long long int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float2ll_Negative_RTC") { NegativeTestRTCWrapper<12>(kFloat2LL); } +TEST_CASE(Unit_Device___float2ll_Negative_RTC) { NegativeTestRTCWrapper<12>(kFloat2LL); } /** * Test Description @@ -369,7 +354,7 @@ CAST_FLOAT2LL_RZ_TEST_DEF(__float2ull_rz, unsigned long long int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float2ull_Negative_RTC") { NegativeTestRTCWrapper<12>(kFloat2ULL); } +TEST_CASE(Unit_Device___float2ull_Negative_RTC) { NegativeTestRTCWrapper<12>(kFloat2ULL); } CAST_KERNEL_DEF(__float_as_int, int, float) @@ -386,7 +371,7 @@ CAST_KERNEL_DEF(__float_as_int, int, float) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float_as_int_Positive") { +TEST_CASE(Unit_Device___float_as_int_Positive) { int (*ref)(float) = type2_as_type1_ref; UnarySinglePrecisionTest(__float_as_int_kernel, ref, EqValidatorBuilderFactory()); } @@ -403,7 +388,7 @@ TEST_CASE("Unit_Device___float_as_int_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float_as_int_Negative_RTC") { NegativeTestRTCWrapper<3>(kFloatAsInt); } +TEST_CASE(Unit_Device___float_as_int_Negative_RTC) { NegativeTestRTCWrapper<3>(kFloatAsInt); } CAST_KERNEL_DEF(__float_as_uint, unsigned int, float) @@ -420,7 +405,7 @@ CAST_KERNEL_DEF(__float_as_uint, unsigned int, float) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float_as_uint_Positive") { +TEST_CASE(Unit_Device___float_as_uint_Positive) { unsigned int (*ref)(float) = type2_as_type1_ref; UnarySinglePrecisionTest(__float_as_uint_kernel, ref, EqValidatorBuilderFactory()); } @@ -437,7 +422,7 @@ TEST_CASE("Unit_Device___float_as_uint_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float_as_uint_Negative_RTC") { NegativeTestRTCWrapper<3>(kFloatAsUint); } +TEST_CASE(Unit_Device___float_as_uint_Negative_RTC) { NegativeTestRTCWrapper<3>(kFloatAsUint); } /** * End doxygen group MathTest. diff --git a/catch/unit/math/casting_float_negative_kernels.cc b/catch/unit/math/casting_float_negative_kernels.cc index eecbd6dd7..f1c0b196f 100644 --- a/catch/unit/math/casting_float_negative_kernels.cc +++ b/catch/unit/math/casting_float_negative_kernels.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/casting_float_negative_kernels_rtc.hh b/catch/unit/math/casting_float_negative_kernels_rtc.hh index 45fba3b0e..7859c21b1 100644 --- a/catch/unit/math/casting_float_negative_kernels_rtc.hh +++ b/catch/unit/math/casting_float_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/casting_half2_common.hh b/catch/unit/math/casting_half2_common.hh index 2b4496ccf..603cc6989 100644 --- a/catch/unit/math/casting_half2_common.hh +++ b/catch/unit/math/casting_half2_common.hh @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/casting_half2_funcs.cc b/catch/unit/math/casting_half2_funcs.cc index 844df3e2e..bf3ab9eff 100644 --- a/catch/unit/math/casting_half2_funcs.cc +++ b/catch/unit/math/casting_half2_funcs.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "half_precision_common.hh" #include "casting_common.hh" @@ -49,7 +33,7 @@ static __half2 __half2half2_ref(Float16 x) { return __half2{x, x}; } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___half2half2_Accuracy_Positive") { +TEST_CASE(Unit_Device___half2half2_Accuracy_Positive) { UnaryHalfPrecisionTest(__half2half2_kernel, __half2half2_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -72,7 +56,7 @@ static __half2 make_half2_ref(Float16 x, Float16 y) { return __half2{x, y}; } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_make_half2_Accuracy_Positive") { +TEST_CASE(Unit_Device_make_half2_Accuracy_Positive) { BinaryFloatingPointTest(make_half2_kernel, make_half2_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -95,7 +79,7 @@ static __half2 __halves2half2_ref(Float16 x, Float16 y) { return __half2{x, y}; * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___halves2half2_Accuracy_Positive") { +TEST_CASE(Unit_Device___halves2half2_Accuracy_Positive) { BinaryFloatingPointTest(__halves2half2_kernel, __halves2half2_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -120,7 +104,7 @@ static Float16 __low2half_ref(Float16 x) { return x; } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___low2half_Accuracy_Positive") { +TEST_CASE(Unit_Device___low2half_Accuracy_Positive) { UnaryHalfPrecisionTest(__low2half_kernel, __low2half_ref, EqValidatorBuilderFactory()); } @@ -141,7 +125,7 @@ static Float16 __high2half_ref(Float16 x) { return -x; } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___high2half_Accuracy_Positive") { +TEST_CASE(Unit_Device___high2half_Accuracy_Positive) { UnaryHalfPrecisionTest(__high2half_kernel, __high2half_ref, EqValidatorBuilderFactory()); } @@ -164,7 +148,7 @@ static __half2 __low2half2_ref(Float16 x) { return __half2{x, x}; } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___low2half2_Accuracy_Positive") { +TEST_CASE(Unit_Device___low2half2_Accuracy_Positive) { UnaryHalfPrecisionTest(__low2half2_kernel, __low2half2_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -186,7 +170,7 @@ static __half2 __high2half2_ref(Float16 x) { return __half2{-x, -x}; } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___high2half2_Accuracy_Positive") { +TEST_CASE(Unit_Device___high2half2_Accuracy_Positive) { UnaryHalfPrecisionTest(__high2half2_kernel, __high2half2_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -209,7 +193,7 @@ static __half2 __lowhigh2highlow_ref(Float16 x) { return __half2{-x, x}; } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___lowhigh2highlow_Accuracy_Positive") { +TEST_CASE(Unit_Device___lowhigh2highlow_Accuracy_Positive) { UnaryHalfPrecisionTest(__lowhigh2highlow_kernel, __lowhigh2highlow_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -232,7 +216,7 @@ static __half2 __lows2half2_ref(Float16 x, Float16 y) { return __half2{x, y}; } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___lows2half2_Accuracy_Positive") { +TEST_CASE(Unit_Device___lows2half2_Accuracy_Positive) { BinaryFloatingPointTest(__lows2half2_kernel, __lows2half2_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -255,7 +239,7 @@ static __half2 __highs2half2_ref(Float16 x, Float16 y) { return __half2{-x, -y}; * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___highs2half2_Accuracy_Positive") { +TEST_CASE(Unit_Device___highs2half2_Accuracy_Positive) { BinaryFloatingPointTest(__highs2half2_kernel, __highs2half2_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -282,7 +266,7 @@ static __half2 __float2half2_rn_ref(float x) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float2half2_rn_Accuracy_Positive") { +TEST_CASE(Unit_Device___float2half2_rn_Accuracy_Positive) { UnarySinglePrecisionTest(__float2half2_rn_kernel, __float2half2_rn_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -307,7 +291,7 @@ static __half2 __floats2half2_rn_ref(float x, float y) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___floats2half2_rn_Accuracy_Positive") { +TEST_CASE(Unit_Device___floats2half2_rn_Accuracy_Positive) { BinaryFloatingPointTest(__floats2half2_rn_kernel, __floats2half2_rn_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -341,7 +325,7 @@ static __half2 __float22half2_rn_ref(float x) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float22half2_rn_Accuracy_Positive") { +TEST_CASE(Unit_Device___float22half2_rn_Accuracy_Positive) { UnarySinglePrecisionTest(__float22half2_rn_kernel, __float22half2_rn_ref, Half2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } @@ -366,7 +350,7 @@ static float __low2float_ref(Float16 x) { return static_cast(x); } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___low2float_Accuracy_Positive") { +TEST_CASE(Unit_Device___low2float_Accuracy_Positive) { UnaryHalfPrecisionTest(__low2float_kernel, __low2float_ref, EqValidatorBuilderFactory()); } @@ -388,7 +372,7 @@ static float __high2float_ref(Float16 x) { return static_cast(-x); } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___high2float_Accuracy_Positive") { +TEST_CASE(Unit_Device___high2float_Accuracy_Positive) { UnaryHalfPrecisionTest(__high2float_kernel, __high2float_ref, EqValidatorBuilderFactory()); } @@ -413,7 +397,7 @@ static float2 __half22float2_ref(Float16 x) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___half22float2_Accuracy_Positive") { +TEST_CASE(Unit_Device___half22float2_Accuracy_Positive) { UnaryHalfPrecisionTest(__half22float2_kernel, __half22float2_ref, Float2ValidatorBuilderFactory(EqValidatorBuilderFactory())); } diff --git a/catch/unit/math/casting_half2_negative_kernels.cc b/catch/unit/math/casting_half2_negative_kernels.cc index d1552e45b..1d65a4202 100644 --- a/catch/unit/math/casting_half2_negative_kernels.cc +++ b/catch/unit/math/casting_half2_negative_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/math/casting_half2int_funcs.cc b/catch/unit/math/casting_half2int_funcs.cc index efe2cf50c..3a04b6d4f 100644 --- a/catch/unit/math/casting_half2int_funcs.cc +++ b/catch/unit/math/casting_half2int_funcs.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "half_precision_common.hh" #include "casting_common.hh" @@ -33,7 +17,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, T, Float16) \ CAST_F2I_RZ_REF_DEF(kern_name, T, Float16) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive) { \ T (*ref)(Float16) = kern_name##_ref; \ CastUnaryHalfPrecisionTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -413,7 +397,7 @@ CAST_KERNEL_DEF(__half_as_short, short, Float16) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___half_as_short_Accuracy_Positive") { +TEST_CASE(Unit_Device___half_as_short_Accuracy_Positive) { short (*ref)(Float16) = type2_as_type1_ref; CastUnaryHalfPrecisionTest(__half_as_short_kernel, ref, EqValidatorBuilderFactory()); } @@ -433,7 +417,7 @@ CAST_KERNEL_DEF(__half_as_ushort, unsigned short, Float16) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___half_as_ushort_Accuracy_Positive") { +TEST_CASE(Unit_Device___half_as_ushort_Accuracy_Positive) { unsigned short (*ref)(Float16) = type2_as_type1_ref; CastUnaryHalfPrecisionTest(__half_as_ushort_kernel, ref, EqValidatorBuilderFactory()); diff --git a/catch/unit/math/casting_half2int_negative_kernels.cc b/catch/unit/math/casting_half2int_negative_kernels.cc index 6b7d75040..1371d1c9c 100644 --- a/catch/unit/math/casting_half2int_negative_kernels.cc +++ b/catch/unit/math/casting_half2int_negative_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/math/casting_half_float_funcs.cc b/catch/unit/math/casting_half_float_funcs.cc index 4c40642ac..d486a50cc 100644 --- a/catch/unit/math/casting_half_float_funcs.cc +++ b/catch/unit/math/casting_half_float_funcs.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "half_precision_common.hh" #include "casting_common.hh" @@ -33,7 +17,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, Float16, float) \ CAST_RND_REF_DEF(kern_name, Float16, float, round_dir) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Limited_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Limited_Positive) { \ Float16 (*ref)(float) = kern_name##_ref; \ UnarySinglePrecisionRangeTest(kern_name##_kernel, ref, EqValidatorBuilderFactory(), \ std::numeric_limits::lowest(), 0.f); \ @@ -45,7 +29,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, Float16, float) \ CAST_REF_DEF(kern_name, Float16, float) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive) { \ Float16 (*ref)(float) = kern_name##_ref; \ UnarySinglePrecisionRangeTest(kern_name##_kernel, ref, EqValidatorBuilderFactory(), \ std::numeric_limits::lowest(), \ @@ -145,7 +129,7 @@ CAST_FLOAT2HALF_TEST_DEF(__float2half_rz, FE_TOWARDZERO) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float2half_rd_SmallVals_Sanity_Positive") { +TEST_CASE(Unit_Device___float2half_rd_SmallVals_Sanity_Positive) { const float input[] = {0.8859e-06f, 1.5454e-07f, 6.5955e-08f, 2.7955e-08f, 3.7956e-09f, 4.8995e-10f, 5.7997e-15f, 6.2117e-20f, 7.4999e-25f, 8.9999e-30f, 9.0001e-35f}; @@ -175,7 +159,7 @@ TEST_CASE("Unit_Device___float2half_rd_SmallVals_Sanity_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float2half_ru_SmallVals_Sanity_Positive") { +TEST_CASE(Unit_Device___float2half_ru_SmallVals_Sanity_Positive) { const float input[] = {0.8859e-06f, 1.5454e-07f, 6.5955e-08f, 2.7955e-08f, 3.7956e-09f, 4.8995e-10f, 5.7997e-15f, 6.2117e-20f, 7.4999e-25f, 8.9999e-30f, 9.0001e-35f}; @@ -207,7 +191,7 @@ TEST_CASE("Unit_Device___float2half_ru_SmallVals_Sanity_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___float2half_rz_SmallVals_Sanity_Positive") { +TEST_CASE(Unit_Device___float2half_rz_SmallVals_Sanity_Positive) { const float input[] = {0.8859e-06f, 1.5454e-07f, 6.5955e-08f, 2.7955e-08f, 3.7956e-09f, 4.8995e-10f, 5.7997e-15f, 6.2117e-20f, 7.4999e-25f, 8.9999e-30f, 9.0001e-35f}; @@ -241,7 +225,7 @@ CAST_REF_DEF(__half2float, float, Float16) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___half2float_Accuracy_Positive") { +TEST_CASE(Unit_Device___half2float_Accuracy_Positive) { float (*ref)(Float16) = __half2float_ref; UnaryHalfPrecisionTest(__half2float_kernel, ref, EqValidatorBuilderFactory()); } diff --git a/catch/unit/math/casting_half_float_negative_kernels.cc b/catch/unit/math/casting_half_float_negative_kernels.cc index 9d849e6f5..811c6f7db 100644 --- a/catch/unit/math/casting_half_float_negative_kernels.cc +++ b/catch/unit/math/casting_half_float_negative_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/math/casting_int2half_funcs.cc b/catch/unit/math/casting_int2half_funcs.cc index 217f73dc4..622ae421d 100644 --- a/catch/unit/math/casting_int2half_funcs.cc +++ b/catch/unit/math/casting_int2half_funcs.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "half_precision_common.hh" #include "casting_common.hh" @@ -33,7 +17,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, Float16, T) \ CAST_REF_DEF(kern_name, Float16, T) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive) { \ Float16 (*ref)(T) = kern_name##_ref; \ CastIntRangeTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -282,7 +266,7 @@ CAST_INT2HALF_RN_TEST_DEF(__ushort2half_ru, unsigned short) CAST_KERNEL_DEF(kern_name, Float16, T) \ CAST_REF_DEF(kern_name, Float16, T) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive) { \ Float16 (*ref)(T) = kern_name##_ref; \ CastIntBruteForceTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -422,7 +406,7 @@ CAST_KERNEL_DEF(__short_as_half, Float16, short) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___short_as_half_Accuracy_Positive") { +TEST_CASE(Unit_Device___short_as_half_Accuracy_Positive) { Float16 (*ref)(short) = type2_as_type1_ref; CastIntBruteForceTest(__short_as_half_kernel, ref, EqValidatorBuilderFactory()); } @@ -442,7 +426,7 @@ CAST_KERNEL_DEF(__ushort_as_half, Float16, unsigned short) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___ushort_as_half_Accuracy_Positive") { +TEST_CASE(Unit_Device___ushort_as_half_Accuracy_Positive) { Float16 (*ref)(unsigned short) = type2_as_type1_ref; CastIntBruteForceTest(__ushort_as_half_kernel, ref, EqValidatorBuilderFactory()); } diff --git a/catch/unit/math/casting_int2half_negative_kernels.cc b/catch/unit/math/casting_int2half_negative_kernels.cc index a23da476e..cb5bda242 100644 --- a/catch/unit/math/casting_int2half_negative_kernels.cc +++ b/catch/unit/math/casting_int2half_negative_kernels.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/math/casting_int_funcs.cc b/catch/unit/math/casting_int_funcs.cc index a04e0dd59..96636b5b8 100644 --- a/catch/unit/math/casting_int_funcs.cc +++ b/catch/unit/math/casting_int_funcs.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "casting_common.hh" #include "casting_int_negative_kernels_rtc.hh" @@ -32,7 +17,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, T1, T2) \ CAST_RND_REF_DEF(kern_name, T1, T2, round_dir) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T1 (*ref)(T2) = kern_name##_ref; \ CastIntRangeTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -41,7 +26,7 @@ THE SOFTWARE. CAST_KERNEL_DEF(kern_name, T1, T2) \ CAST_REF_DEF(kern_name, T1, T2) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T1 (*ref)(T2) = kern_name##_ref; \ CastIntRangeTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -118,7 +103,7 @@ CAST_INT2FLOAT_TEST_DEF(__int2float_rz, float, int, FE_TOWARDZERO) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_int2float___Negative_RTC") { NegativeTestRTCWrapper<12>(kInt2Float); } +TEST_CASE(Unit_Device_int2float___Negative_RTC) { NegativeTestRTCWrapper<12>(kInt2Float); } /** * Test Description @@ -192,7 +177,7 @@ CAST_INT2FLOAT_TEST_DEF(__uint2float_rz, float, unsigned int, FE_TOWARDZERO) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___uint2float_Negative_RTC") { NegativeTestRTCWrapper<12>(kUint2Float); } +TEST_CASE(Unit_Device___uint2float_Negative_RTC) { NegativeTestRTCWrapper<12>(kUint2Float); } /** * Test Description @@ -221,7 +206,7 @@ CAST_INT2FLOAT_RN_TEST_DEF(__int2double_rn, double, int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___int2double_Negative_RTC") { NegativeTestRTCWrapper<3>(kInt2Double); } +TEST_CASE(Unit_Device___int2double_Negative_RTC) { NegativeTestRTCWrapper<3>(kInt2Double); } /** * Test Description @@ -250,13 +235,13 @@ CAST_INT2FLOAT_RN_TEST_DEF(__uint2double_rn, double, unsigned int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___uint2double_Negative_RTC") { NegativeTestRTCWrapper<3>(kUint2Double); } +TEST_CASE(Unit_Device___uint2double_Negative_RTC) { NegativeTestRTCWrapper<3>(kUint2Double); } #define CAST_LL2FLOAT_TEST_DEF(kern_name, T1, T2, round_dir) \ CAST_KERNEL_DEF(kern_name, T1, T2) \ CAST_RND_REF_DEF(kern_name, T1, T2, round_dir) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T1 (*ref)(T2) = kern_name##_ref; \ CastIntBruteForceTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -265,7 +250,7 @@ TEST_CASE("Unit_Device___uint2double_Negative_RTC") { NegativeTestRTCWrapper<3>( CAST_KERNEL_DEF(kern_name, T1, T2) \ CAST_REF_DEF(kern_name, T1, T2) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Positive") { \ + TEST_CASE(Unit_Device_##kern_name##_Positive) { \ T1 (*ref)(T2) = kern_name##_ref; \ CastIntBruteForceTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } @@ -345,7 +330,7 @@ CAST_LL2FLOAT_TEST_DEF(__ll2float_rz, float, long long int, FE_TOWARDZERO) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___ll2float_Negative_RTC") { NegativeTestRTCWrapper<12>(kLL2Float); } +TEST_CASE(Unit_Device___ll2float_Negative_RTC) { NegativeTestRTCWrapper<12>(kLL2Float); } /** * Test Description @@ -422,7 +407,7 @@ CAST_LL2FLOAT_TEST_DEF(__ull2float_rz, float, unsigned long long int, FE_TOWARDZ * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___ull2float_Negative_RTC") { NegativeTestRTCWrapper<12>(kULL2Float); } +TEST_CASE(Unit_Device___ull2float_Negative_RTC) { NegativeTestRTCWrapper<12>(kULL2Float); } /** * Test Description @@ -499,7 +484,7 @@ CAST_LL2FLOAT_TEST_DEF(__ll2double_rz, double, long long int, FE_TOWARDZERO) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___ll2double_Negative_RTC") { NegativeTestRTCWrapper<12>(kLL2Double); } +TEST_CASE(Unit_Device___ll2double_Negative_RTC) { NegativeTestRTCWrapper<12>(kLL2Double); } /** * Test Description @@ -576,7 +561,7 @@ CAST_LL2FLOAT_TEST_DEF(__ull2double_rz, double, unsigned long long int, FE_TOWAR * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___ull2double_Negative_RTC") { NegativeTestRTCWrapper<12>(kULL2Double); } +TEST_CASE(Unit_Device___ull2double_Negative_RTC) { NegativeTestRTCWrapper<12>(kULL2Double); } CAST_KERNEL_DEF(__int_as_float, float, int) @@ -593,7 +578,7 @@ CAST_KERNEL_DEF(__int_as_float, float, int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___int_as_float_Positive") { +TEST_CASE(Unit_Device___int_as_float_Positive) { float (*ref)(int) = type2_as_type1_ref; CastIntRangeTest(__int_as_float_kernel, ref, EqValidatorBuilderFactory()); } @@ -610,7 +595,7 @@ TEST_CASE("Unit_Device___int_as_float_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___int_as_float_Negative_RTC") { NegativeTestRTCWrapper<3>(kIntAsFloat); } +TEST_CASE(Unit_Device___int_as_float_Negative_RTC) { NegativeTestRTCWrapper<3>(kIntAsFloat); } CAST_KERNEL_DEF(__uint_as_float, float, unsigned int) @@ -627,7 +612,7 @@ CAST_KERNEL_DEF(__uint_as_float, float, unsigned int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___uint_as_float_Positive") { +TEST_CASE(Unit_Device___uint_as_float_Positive) { float (*ref)(unsigned int) = type2_as_type1_ref; CastIntRangeTest(__uint_as_float_kernel, ref, EqValidatorBuilderFactory()); } @@ -644,7 +629,7 @@ TEST_CASE("Unit_Device___uint_as_float_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___uint_as_float_Negative_RTC") { NegativeTestRTCWrapper<3>(kUintAsFloat); } +TEST_CASE(Unit_Device___uint_as_float_Negative_RTC) { NegativeTestRTCWrapper<3>(kUintAsFloat); } CAST_KERNEL_DEF(__longlong_as_double, double, long long int) @@ -662,7 +647,7 @@ CAST_KERNEL_DEF(__longlong_as_double, double, long long int) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___longlong_as_double_Positive") { +TEST_CASE(Unit_Device___longlong_as_double_Positive) { double (*ref)(long long int) = type2_as_type1_ref; CastIntBruteForceTest(__longlong_as_double_kernel, ref, EqValidatorBuilderFactory()); } @@ -679,7 +664,7 @@ TEST_CASE("Unit_Device___longlong_as_double_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___longlong_as_double_Negative_RTC") { +TEST_CASE(Unit_Device___longlong_as_double_Negative_RTC) { NegativeTestRTCWrapper<3>(kLonglongAsDouble); } @@ -715,7 +700,7 @@ double __hiloint2double_ref(int hi, int lo) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___hiloint2double_Positive") { +TEST_CASE(Unit_Device___hiloint2double_Positive) { double (*ref)(int, int) = __hiloint2double_ref; CastBinaryIntRangeTest(__hiloint2double_kernel, ref, EqValidatorBuilderFactory()); } @@ -732,7 +717,7 @@ TEST_CASE("Unit_Device___hiloint2double_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___hiloint2double_Negative_RTC") { NegativeTestRTCWrapper<5>(kHilo2Double); } +TEST_CASE(Unit_Device___hiloint2double_Negative_RTC) { NegativeTestRTCWrapper<5>(kHilo2Double); } /** * End doxygen group MathTest. diff --git a/catch/unit/math/casting_int_negative_kernels.cc b/catch/unit/math/casting_int_negative_kernels.cc index b107050b3..1010d6361 100644 --- a/catch/unit/math/casting_int_negative_kernels.cc +++ b/catch/unit/math/casting_int_negative_kernels.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/casting_int_negative_kernels_rtc.hh b/catch/unit/math/casting_int_negative_kernels_rtc.hh index acdc621f8..d087555ef 100644 --- a/catch/unit/math/casting_int_negative_kernels_rtc.hh +++ b/catch/unit/math/casting_int_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/double_precision_intrinsics.cc b/catch/unit/math/double_precision_intrinsics.cc index 6677c343c..87fe7af0e 100644 --- a/catch/unit/math/double_precision_intrinsics.cc +++ b/catch/unit/math/double_precision_intrinsics.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -39,7 +23,7 @@ THE SOFTWARE. } #define MATH_UNARY_DP_TEST_DEF_IMPL(func_name, ref_func, validator_builder) \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ UnaryDoublePrecisionTest(func_name##_kernel, ref_func, validator_builder); \ } @@ -106,7 +90,7 @@ MATH_UNARY_DP_TEST_DEF_IMPL(__dsqrt_rn, static_cast(std::sqr } #define MATH_BINARY_DP_TEST_DEF_IMPL(func_name, ref_func, validator_builder) \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ BinaryFloatingPointTest(func_name##_kernel, ref_func, validator_builder); \ } @@ -212,7 +196,7 @@ MATH_BINARY_DP_TEST_DEF_IMPL(__ddiv_rn, __ddiv_rn_ref, EqValidatorBuilderFactory } #define MATH_TERNARY_DP_TEST_DEF_IMPL(func_name, ref_func, validator_builder) \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ TernaryFloatingPointTest(func_name##_kernel, ref_func, validator_builder); \ } diff --git a/catch/unit/math/double_precision_intrinsics_negative_kernels.cc b/catch/unit/math/double_precision_intrinsics_negative_kernels.cc index 4ea26ae10..f6672f83c 100644 --- a/catch/unit/math/double_precision_intrinsics_negative_kernels.cc +++ b/catch/unit/math/double_precision_intrinsics_negative_kernels.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/half_precision_arithmetic.cc b/catch/unit/math/half_precision_arithmetic.cc index 2fdce7fb0..3c596d1e6 100644 --- a/catch/unit/math/half_precision_arithmetic.cc +++ b/catch/unit/math/half_precision_arithmetic.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "half_precision_common.hh" diff --git a/catch/unit/math/half_precision_arithmetic_negative_kernels.cc b/catch/unit/math/half_precision_arithmetic_negative_kernels.cc index 855499816..15cec6236 100644 --- a/catch/unit/math/half_precision_arithmetic_negative_kernels.cc +++ b/catch/unit/math/half_precision_arithmetic_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/math/half_precision_common.hh b/catch/unit/math/half_precision_common.hh index 060e11627..8c4642b6a 100644 --- a/catch/unit/math/half_precision_common.hh +++ b/catch/unit/math/half_precision_common.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once @@ -40,7 +24,7 @@ THE SOFTWARE. } #define MATH_UNARY_HP_TEST_DEF_IMPL(func_name, ref_func, validator_builder) \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ UnaryHalfPrecisionTest(func_name##_kernel, ref_func, validator_builder); \ } @@ -65,7 +49,7 @@ THE SOFTWARE. } #define MATH_BINARY_HP_TEST_DEF_IMPL(func_name, ref_func, validator_builder) \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ BinaryFloatingPointTest(func_name##_kernel, ref_func, validator_builder); \ } @@ -91,7 +75,7 @@ THE SOFTWARE. } #define MATH_TERNARY_HP_TEST_DEF_IMPL(func_name, ref_func, validator_builder) \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ TernaryFloatingPointTest(func_name##_kernel, ref_func, validator_builder); \ } diff --git a/catch/unit/math/half_precision_comparison.cc b/catch/unit/math/half_precision_comparison.cc index 2d462f8d8..7643dee74 100644 --- a/catch/unit/math/half_precision_comparison.cc +++ b/catch/unit/math/half_precision_comparison.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "half_precision_common.hh" @@ -40,7 +24,7 @@ THE SOFTWARE. } \ } \ \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ UnaryHalfPrecisionTest(func_name##_kernel, ref_func, EqValidatorBuilderFactory()); \ } @@ -125,7 +109,7 @@ MATH_UNARY_HP_TEST_DEF_IMPL(__hisnan2, __hisnan2_ref, EqValidatorBuilderFactory< } \ } \ \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ BinaryFloatingPointTest(func_name##_kernel, ref_func, \ EqValidatorBuilderFactory()); \ } diff --git a/catch/unit/math/half_precision_comparison_negative_kernels.cc b/catch/unit/math/half_precision_comparison_negative_kernels.cc index a045af211..8a0213fc0 100644 --- a/catch/unit/math/half_precision_comparison_negative_kernels.cc +++ b/catch/unit/math/half_precision_comparison_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/math/half_precision_math.cc b/catch/unit/math/half_precision_math.cc index f599b5913..cd0b6a262 100644 --- a/catch/unit/math/half_precision_math.cc +++ b/catch/unit/math/half_precision_math.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "half_precision_common.hh" diff --git a/catch/unit/math/half_precision_math_negative_kernels.cc b/catch/unit/math/half_precision_math_negative_kernels.cc index bf0338974..5dbf8fc50 100644 --- a/catch/unit/math/half_precision_math_negative_kernels.cc +++ b/catch/unit/math/half_precision_math_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/math/integer_intrinsics.cc b/catch/unit/math/integer_intrinsics.cc index 730e7691a..453c66beb 100644 --- a/catch/unit/math/integer_intrinsics.cc +++ b/catch/unit/math/integer_intrinsics.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -37,7 +21,7 @@ __global__ void __brev_kernel(unsigned int* y, unsigned int x) { y[0] = __brev(x * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___brev_Sanity_Positive") { +TEST_CASE(Unit_Device___brev_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); __brev_kernel<<<1, 1>>>(y.ptr(), 0xAAAAAAAA); @@ -62,7 +46,7 @@ __global__ void __brevll_kernel(unsigned long long int* y, unsigned long long in * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___brevll_Sanity_Positive") { +TEST_CASE(Unit_Device___brevll_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned long long int)); @@ -86,7 +70,7 @@ template __global__ void __clz_kernel(T* y, T x) { y[0] = __clz(x); * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device___clz_Sanity_Positive", "", int, unsigned int) { +TEMPLATE_TEST_CASE(Unit_Device___clz_Sanity_Positive, int, unsigned int) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(TestType)); __clz_kernel<<<1, 1>>>(y.ptr(), static_cast(0)); @@ -118,7 +102,7 @@ template __global__ void __clzll_kernel(T* y, T x) { y[0] = __clzll * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device___clzll_Sanity_Positive", "", long long int, +TEMPLATE_TEST_CASE(Unit_Device___clzll_Sanity_Positive, long long int, unsigned long long int) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(TestType)); @@ -150,7 +134,7 @@ template __global__ void __ffs_kernel(T* y, T x) { y[0] = __ffs(x); * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device___ffs_Sanity_Positive", "", int, unsigned int) { +TEMPLATE_TEST_CASE(Unit_Device___ffs_Sanity_Positive, int, unsigned int) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(TestType)); __ffs_kernel<<<1, 1>>>(y.ptr(), static_cast(0)); @@ -182,7 +166,7 @@ template __global__ void __ffsll_kernel(T* y, T x) { y[0] = __ffsll * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device___ffsll_Sanity_Positive", "", long long int, +TEMPLATE_TEST_CASE(Unit_Device___ffsll_Sanity_Positive, long long int, unsigned long long int) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(TestType)); @@ -214,7 +198,7 @@ __global__ void __popc_kernel(unsigned int* y, unsigned int x) { y[0] = __popc(x * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___popc_Sanity_Positive") { +TEST_CASE(Unit_Device___popc_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); __popc_kernel<<<1, 1>>>(y.ptr(), 0); @@ -247,7 +231,7 @@ __global__ void __popcll_kernel(unsigned long long int* y, unsigned long long in * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___popcll_Sanity_Positive") { +TEST_CASE(Unit_Device___popcll_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned long long int)); @@ -279,7 +263,7 @@ __global__ void __mul24_kernel(int* y, int x1, int x2) { y[0] = __mul24(x1, x2); * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___mul24_Sanity_Positive") { +TEST_CASE(Unit_Device___mul24_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(int)); int x1 = GENERATE(0, -42, 42, 0xFFFFFFFF); @@ -307,7 +291,7 @@ __global__ void __umul24_kernel(unsigned int* y, unsigned int x1, unsigned int x * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___umul24_Sanity_Positive") { +TEST_CASE(Unit_Device___umul24_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); unsigned int x1 = GENERATE(0, 42, 0xFFFFFF); @@ -336,7 +320,7 @@ __global__ void __funnelshift_l_kernel(unsigned int* y, unsigned int lo, unsigne * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___funnelshift_l_Sanity_Positive") { +TEST_CASE(Unit_Device___funnelshift_l_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); const unsigned int lo = 0xAAAAAAAA, hi = 0xBBBBBBBB; @@ -368,7 +352,7 @@ __global__ void __funnelshift_lc_kernel(unsigned int* y, unsigned int lo, unsign * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___funnelshift_lc_Sanity_Positive") { +TEST_CASE(Unit_Device___funnelshift_lc_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); const unsigned int lo = 0xAAAAAAAA, hi = 0xBBBBBBBB; @@ -400,7 +384,7 @@ __global__ void __funnelshift_r_kernel(unsigned int* y, unsigned int lo, unsigne * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___funnelshift_r_Sanity_Positive") { +TEST_CASE(Unit_Device___funnelshift_r_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); const unsigned int lo = 0xAAAAAAAA, hi = 0xBBBBBBBB; @@ -432,7 +416,7 @@ __global__ void __funnelshift_rc_kernel(unsigned int* y, unsigned int lo, unsign * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___funnelshift_rc_Sanity_Positive") { +TEST_CASE(Unit_Device___funnelshift_rc_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); const unsigned int lo = 0xAAAAAAAA, hi = 0xBBBBBBBB; @@ -461,7 +445,7 @@ __global__ void __hadd_kernel(int* y, int x1, int x2) { y[0] = __hadd(x1, x2); } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___hadd_Sanity_Positive") { +TEST_CASE(Unit_Device___hadd_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(int)); int x1 = GENERATE(0, -42, 42, 0xFFFFFFFF); @@ -491,7 +475,7 @@ __global__ void __uhadd_kernel(unsigned int* y, unsigned int x1, unsigned int x2 * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___uhadd_Sanity_Positive") { +TEST_CASE(Unit_Device___uhadd_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); unsigned int x1 = GENERATE(0, 42, 0xFFFFFFFF); @@ -519,7 +503,7 @@ __global__ void __rhadd_kernel(int* y, int x1, int x2) { y[0] = __rhadd(x1, x2); * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___rhadd_Sanity_Positive") { +TEST_CASE(Unit_Device___rhadd_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(int)); int x1 = GENERATE(0, -42, 42, 0xFFFFFFFF); @@ -549,7 +533,7 @@ __global__ void __urhadd_kernel(unsigned int* y, unsigned int x1, unsigned int x * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___urhadd_Sanity_Positive") { +TEST_CASE(Unit_Device___urhadd_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); unsigned int x1 = GENERATE(0, 42, 0xFFFFFFFF); @@ -578,7 +562,7 @@ __global__ void __mulhi_kernel(int* y, int x1, int x2) { y[0] = __mulhi(x1, x2); * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___mulhi_Sanity_Positive") { +TEST_CASE(Unit_Device___mulhi_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(int)); int x1 = GENERATE(0, -42, 42, 0xFFFFFFFF); @@ -609,7 +593,7 @@ __global__ void __umulhi_kernel(unsigned int* y, unsigned int x1, unsigned int x * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___umulhi_Sanity_Positive") { +TEST_CASE(Unit_Device___umulhi_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); unsigned int x1 = GENERATE(0, 42, 0xFFFFFFFF); @@ -640,7 +624,7 @@ __global__ void __mul64hi_kernel(long long* y, long long x1, long long x2) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___mul64hi_Sanity_Positive") { +TEST_CASE(Unit_Device___mul64hi_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(long long)); long long x1 = GENERATE(0, -42, 42, 0xFFFFFFFF); @@ -672,7 +656,7 @@ __global__ void __umul64hi_kernel(unsigned long long* y, unsigned long long x1, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___umul64hi_Sanity_Positive") { +TEST_CASE(Unit_Device___umul64hi_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned long long)); @@ -704,7 +688,7 @@ __global__ void __sad_kernel(unsigned int* y, int x1, int x2, unsigned int x3) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___sad_Sanity_Positive") { +TEST_CASE(Unit_Device___sad_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); int x1 = GENERATE(0, -42, 42, 0xFFFFFFFF); @@ -735,7 +719,7 @@ __global__ void __usad_kernel(unsigned int* y, unsigned int x1, unsigned int x2, * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___usad_Sanity_Positive") { +TEST_CASE(Unit_Device___usad_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); unsigned int x1 = GENERATE(0, 42, 0xFFFFFFFF); @@ -768,7 +752,7 @@ __global__ void __byte_perm(unsigned int* y, unsigned int x1, unsigned int x2, u * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device___byte_perm_Sanity_Positive") { +TEST_CASE(Unit_Device___byte_perm_Sanity_Positive) { LinearAllocGuard y(LinearAllocs::hipMallocManaged, sizeof(unsigned int)); unsigned int bytes[] = {0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF}; diff --git a/catch/unit/math/integer_intrinsics_negative_kernels.cc b/catch/unit/math/integer_intrinsics_negative_kernels.cc index ec5ac98fe..6ff513905 100644 --- a/catch/unit/math/integer_intrinsics_negative_kernels.cc +++ b/catch/unit/math/integer_intrinsics_negative_kernels.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/log_funcs.cc b/catch/unit/math/log_funcs.cc index 337c32ff0..7abd5e409 100644 --- a/catch/unit/math/log_funcs.cc +++ b/catch/unit/math/log_funcs.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "unary_common.hh" #include "math_log_negative_kernels_rtc.hh" @@ -59,7 +44,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(log, 2, 1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_log_logf_Negative_RTC") { NegativeTestRTCWrapper<4>(kLog); } +TEST_CASE(Unit_Device_log_logf_Negative_RTC) { NegativeTestRTCWrapper<4>(kLog); } /** * Test Description @@ -89,7 +74,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(log2, 1, 1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_log2_log2f_Negative_RTC") { NegativeTestRTCWrapper<4>(kLog2); } +TEST_CASE(Unit_Device_log2_log2f_Negative_RTC) { NegativeTestRTCWrapper<4>(kLog2); } /** * Test Description @@ -120,7 +105,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(log10, 2, 1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_log10_log10f_Negative_RTC") { NegativeTestRTCWrapper<4>(kLog10); } +TEST_CASE(Unit_Device_log10_log10f_Negative_RTC) { NegativeTestRTCWrapper<4>(kLog10); } /** * Test Description @@ -150,7 +135,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(log1p, 1, 1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_log1p_log1pf_Negative_RTC") { NegativeTestRTCWrapper<4>(kLog1p); } +TEST_CASE(Unit_Device_log1p_log1pf_Negative_RTC) { NegativeTestRTCWrapper<4>(kLog1p); } /** * Test Description @@ -180,7 +165,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(logb, 0, 0) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_logb_logbf_Negative_RTC") { NegativeTestRTCWrapper<4>(kLogb); } +TEST_CASE(Unit_Device_logb_logbf_Negative_RTC) { NegativeTestRTCWrapper<4>(kLogb); } template @@ -222,7 +207,7 @@ template int ilogb_ref(T arg) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_ilogbf_Accuracy_Positive") { +TEST_CASE(Unit_Device_ilogbf_Accuracy_Positive) { UnarySinglePrecisionTest(ilogb_kernel, ilogb_ref, EqValidatorBuilderFactory()); } @@ -241,7 +226,7 @@ TEST_CASE("Unit_Device_ilogbf_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_ilogb_Accuracy_Positive") { +TEST_CASE(Unit_Device_ilogb_Accuracy_Positive) { UnaryDoublePrecisionTest(ilogb_kernel, ilogb_ref, EqValidatorBuilderFactory()); } @@ -258,7 +243,7 @@ TEST_CASE("Unit_Device_ilogb_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_ilogb_ilogbf_Negative_RTC") { NegativeTestRTCWrapper<4>(kIlogb); } +TEST_CASE(Unit_Device_ilogb_ilogbf_Negative_RTC) { NegativeTestRTCWrapper<4>(kIlogb); } /** * End doxygen group MathTest. diff --git a/catch/unit/math/math_common.hh b/catch/unit/math/math_common.hh index a92685210..7f822b30c 100644 --- a/catch/unit/math/math_common.hh +++ b/catch/unit/math/math_common.hh @@ -1,22 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/math_log_negative_kernels.cc b/catch/unit/math/math_log_negative_kernels.cc index 732fc62a0..1ecfc050b 100644 --- a/catch/unit/math/math_log_negative_kernels.cc +++ b/catch/unit/math/math_log_negative_kernels.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/math_log_negative_kernels_rtc.hh b/catch/unit/math/math_log_negative_kernels_rtc.hh index fd1cbdfca..b8dca0d0e 100644 --- a/catch/unit/math/math_log_negative_kernels_rtc.hh +++ b/catch/unit/math/math_log_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/math_pow_negative_kernels.cc b/catch/unit/math/math_pow_negative_kernels.cc index c338e744a..0323fd50d 100644 --- a/catch/unit/math/math_pow_negative_kernels.cc +++ b/catch/unit/math/math_pow_negative_kernels.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/math_pow_negative_kernels_rtc.hh b/catch/unit/math/math_pow_negative_kernels_rtc.hh index 7c48640be..3176054a5 100644 --- a/catch/unit/math/math_pow_negative_kernels_rtc.hh +++ b/catch/unit/math/math_pow_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/math_reference_impl.hh b/catch/unit/math/math_reference_impl.hh index f0349bd5d..2894dcc03 100644 --- a/catch/unit/math/math_reference_impl.hh +++ b/catch/unit/math/math_reference_impl.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/math_remainder_negative_kernels.cc b/catch/unit/math/math_remainder_negative_kernels.cc index 2ebd26516..b3c5cce7c 100644 --- a/catch/unit/math/math_remainder_negative_kernels.cc +++ b/catch/unit/math/math_remainder_negative_kernels.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/math_remainder_rounding_negative_kernels_rtc.hh b/catch/unit/math/math_remainder_rounding_negative_kernels_rtc.hh index e67a6d009..9c2d1c1d1 100644 --- a/catch/unit/math/math_remainder_rounding_negative_kernels_rtc.hh +++ b/catch/unit/math/math_remainder_rounding_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/math_root_negative_kernels_1Dand2D.cc b/catch/unit/math/math_root_negative_kernels_1Dand2D.cc index 688eaa95b..62f49d33c 100644 --- a/catch/unit/math/math_root_negative_kernels_1Dand2D.cc +++ b/catch/unit/math/math_root_negative_kernels_1Dand2D.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/math_root_negative_kernels_3Dand4D.cc b/catch/unit/math/math_root_negative_kernels_3Dand4D.cc index be8d206af..029eab449 100644 --- a/catch/unit/math/math_root_negative_kernels_3Dand4D.cc +++ b/catch/unit/math/math_root_negative_kernels_3Dand4D.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/math_root_negative_kernels_rtc.hh b/catch/unit/math/math_root_negative_kernels_rtc.hh index 53507ee23..87c847fad 100644 --- a/catch/unit/math/math_root_negative_kernels_rtc.hh +++ b/catch/unit/math/math_root_negative_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/math_rounding_negative_kernels.cc b/catch/unit/math/math_rounding_negative_kernels.cc index 857f50d5d..2957a5102 100644 --- a/catch/unit/math/math_rounding_negative_kernels.cc +++ b/catch/unit/math/math_rounding_negative_kernels.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/math_special_func_kernels.cc b/catch/unit/math/math_special_func_kernels.cc index 7dec752dd..c1231613f 100644 --- a/catch/unit/math/math_special_func_kernels.cc +++ b/catch/unit/math/math_special_func_kernels.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/math_special_func_kernels_rtc.hh b/catch/unit/math/math_special_func_kernels_rtc.hh index e829db2f3..88084e9e2 100644 --- a/catch/unit/math/math_special_func_kernels_rtc.hh +++ b/catch/unit/math/math_special_func_kernels_rtc.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/misc_funcs.cc b/catch/unit/math/misc_funcs.cc index 93fd39c03..650229a06 100644 --- a/catch/unit/math/misc_funcs.cc +++ b/catch/unit/math/misc_funcs.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "misc_negative_kernels_rtc.hh" @@ -26,24 +11,24 @@ THE SOFTWARE. #include "ternary_common.hh" MATH_UNARY_WITHIN_ULP_TEST_DEF(fabs, std::fabs, 0, 0) -TEST_CASE("Unit_Device_fabs_fabsf_Negative_RTC") { NegativeTestRTCWrapper<4>(kFabs); } +TEST_CASE(Unit_Device_fabs_fabsf_Negative_RTC) { NegativeTestRTCWrapper<4>(kFabs); } MATH_BINARY_WITHIN_ULP_TEST_DEF(copysign, std::copysign, 0, 0) -TEST_CASE("Unit_Device_copysign_copysignf_Negative_RTC") { NegativeTestRTCWrapper<8>(kCopySign); } +TEST_CASE(Unit_Device_copysign_copysignf_Negative_RTC) { NegativeTestRTCWrapper<8>(kCopySign); } MATH_BINARY_WITHIN_ULP_TEST_DEF(fmax, std::fmax, 0, 0) -TEST_CASE("Unit_Device_fmax_fmaxf_Negative_RTC") { NegativeTestRTCWrapper<8>(kFmax); } +TEST_CASE(Unit_Device_fmax_fmaxf_Negative_RTC) { NegativeTestRTCWrapper<8>(kFmax); } MATH_BINARY_WITHIN_ULP_TEST_DEF(fmin, std::fmin, 0, 0) -TEST_CASE("Unit_Device_fmin_fminf_Negative_RTC") { NegativeTestRTCWrapper<8>(kFmin); } +TEST_CASE(Unit_Device_fmin_fminf_Negative_RTC) { NegativeTestRTCWrapper<8>(kFmin); } MATH_BINARY_WITHIN_ULP_TEST_DEF(nextafter, std::nextafter, 1, 1) -TEST_CASE("Unit_Device_nextafter_nextafterf_Negative_RTC") { +TEST_CASE(Unit_Device_nextafter_nextafterf_Negative_RTC) { NegativeTestRTCWrapper<8>(kNextAfter); } MATH_TERNARY_WITHIN_ULP_TEST_DEF(fma, std::fma, 0, 1) -TEST_CASE("Unit_Device_fma_fmaf_Negative_RTC") { NegativeTestRTCWrapper<12>(kFma); } +TEST_CASE(Unit_Device_fma_fmaf_Negative_RTC) { NegativeTestRTCWrapper<12>(kFma); } __global__ void fdividef_kernel(float* const ys, const size_t num_xs, float* const x1s, float* const x2s) { @@ -55,12 +40,12 @@ __global__ void fdividef_kernel(float* const ys, const size_t num_xs, float* con } } -TEST_CASE("Unit_Device_fdividef_Accuracy_Positive") { +TEST_CASE(Unit_Device_fdividef_Accuracy_Positive) { double (*ref)(double, double) = [](double x1, double x2) { return x1 / x2; }; BinaryFloatingPointTest(fdividef_kernel, ref, ULPValidatorBuilderFactory(0)); } -TEST_CASE("Unit_Device_fdividef_Negative_RTC") { NegativeTestRTCWrapper<4>(kFdividef); } +TEST_CASE(Unit_Device_fdividef_Negative_RTC) { NegativeTestRTCWrapper<4>(kFdividef); } #define MATH_BOOL_RETURNING_FUNCTION_TEST_DEF(kern_name, ref_func) \ template \ @@ -73,24 +58,24 @@ TEST_CASE("Unit_Device_fdividef_Negative_RTC") { NegativeTestRTCWrapper<4>(kFdiv } \ } \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive - float") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive_float) { \ bool (*ref)(double) = ref_func; \ UnarySinglePrecisionTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive - double") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive_double) { \ bool (*ref)(long double) = ref_func; \ UnaryDoublePrecisionTest(kern_name##_kernel, ref, EqValidatorBuilderFactory()); \ } MATH_BOOL_RETURNING_FUNCTION_TEST_DEF(isfinite, std::isfinite) -TEST_CASE("Unit_Device_isfinite_Negative_RTC") { NegativeTestRTCWrapper<4>(kIsFinite); } +TEST_CASE(Unit_Device_isfinite_Negative_RTC) { NegativeTestRTCWrapper<4>(kIsFinite); } MATH_BOOL_RETURNING_FUNCTION_TEST_DEF(isinf, std::isinf) -TEST_CASE("Unit_Device_isinf_Negative_RTC") { NegativeTestRTCWrapper<4>(kIsInf); } +TEST_CASE(Unit_Device_isinf_Negative_RTC) { NegativeTestRTCWrapper<4>(kIsInf); } MATH_BOOL_RETURNING_FUNCTION_TEST_DEF(isnan, std::isnan) -TEST_CASE("Unit_Device_isnan_Negative_RTC") { NegativeTestRTCWrapper<4>(kIsNan); } +TEST_CASE(Unit_Device_isnan_Negative_RTC) { NegativeTestRTCWrapper<4>(kIsNan); } MATH_BOOL_RETURNING_FUNCTION_TEST_DEF(signbit, std::signbit) -TEST_CASE("Unit_Device_signbit_Negative_RTC") { NegativeTestRTCWrapper<4>(kSignBit); } \ No newline at end of file +TEST_CASE(Unit_Device_signbit_Negative_RTC) { NegativeTestRTCWrapper<4>(kSignBit); } \ No newline at end of file diff --git a/catch/unit/math/misc_negative_kernels.cc b/catch/unit/math/misc_negative_kernels.cc index 761bd9ceb..26053a143 100644 --- a/catch/unit/math/misc_negative_kernels.cc +++ b/catch/unit/math/misc_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/misc_negative_kernels_rtc.hh b/catch/unit/math/misc_negative_kernels_rtc.hh index d2c00b587..a013c2bc6 100644 --- a/catch/unit/math/misc_negative_kernels_rtc.hh +++ b/catch/unit/math/misc_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ - + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ static constexpr auto kFabs{R"( class Dummy { diff --git a/catch/unit/math/pow_common.hh b/catch/unit/math/pow_common.hh index f09fade08..1eba55408 100644 --- a/catch/unit/math/pow_common.hh +++ b/catch/unit/math/pow_common.hh @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/pow_funcs.cc b/catch/unit/math/pow_funcs.cc index 1e80c6f28..702d56f01 100644 --- a/catch/unit/math/pow_funcs.cc +++ b/catch/unit/math/pow_funcs.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "unary_common.hh" #include "binary_common.hh" @@ -61,7 +46,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(exp, 2, 1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_exp_expf_Negative_RTC") { NegativeTestRTCWrapper<4>(kExp); } +TEST_CASE(Unit_Device_exp_expf_Negative_RTC) { NegativeTestRTCWrapper<4>(kExp); } /** * Test Description @@ -92,7 +77,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(exp2, 2, 1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_exp2_exp2f_Negative_RTC") { NegativeTestRTCWrapper<4>(kExp2); } +TEST_CASE(Unit_Device_exp2_exp2f_Negative_RTC) { NegativeTestRTCWrapper<4>(kExp2); } /** * Test Description @@ -122,7 +107,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(expm1, 1, 1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_expm1_expm1f_Negative_RTC") { NegativeTestRTCWrapper<4>(kExpm1); } +TEST_CASE(Unit_Device_expm1_expm1f_Negative_RTC) { NegativeTestRTCWrapper<4>(kExpm1); } MATH_UNARY_KERNEL_DEF(exp10) @@ -139,7 +124,7 @@ MATH_UNARY_KERNEL_DEF(exp10) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_exp10f_Accuracy_Positive") { +TEST_CASE(Unit_Device_exp10f_Accuracy_Positive) { auto exp10_ref = [](double arg) -> double { return std::pow(10, arg); }; double (*ref)(double) = exp10_ref; UnarySinglePrecisionTest(exp10_kernel, ref, ULPValidatorBuilderFactory(2)); @@ -158,7 +143,7 @@ TEST_CASE("Unit_Device_exp10f_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_exp10_Accuracy_Positive") { +TEST_CASE(Unit_Device_exp10_Accuracy_Positive) { auto exp10_ref = [](long double arg) -> long double { return std::pow(10, arg); }; long double (*ref)(long double) = exp10_ref; UnaryDoublePrecisionTest(exp10_kernel, ref, ULPValidatorBuilderFactory(1)); @@ -176,7 +161,7 @@ TEST_CASE("Unit_Device_exp10_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_exp10_exp10f_Negative_RTC") { NegativeTestRTCWrapper<4>(kExp10); } +TEST_CASE(Unit_Device_exp10_exp10f_Negative_RTC) { NegativeTestRTCWrapper<4>(kExp10); } template __global__ void frexp_kernel(std::pair* const ys, const size_t num_xs, T* const xs) { @@ -212,7 +197,7 @@ template std::pair frexp_ref(T arg) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_frexpf_Accuracy_Positive") { +TEST_CASE(Unit_Device_frexpf_Accuracy_Positive) { UnarySinglePrecisionTest( frexp_kernel, frexp_ref, PairValidatorBuilderFactory(ULPValidatorBuilderFactory(0), @@ -234,7 +219,7 @@ TEST_CASE("Unit_Device_frexpf_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_frexp_Accuracy_Positive") { +TEST_CASE(Unit_Device_frexp_Accuracy_Positive) { UnaryDoublePrecisionTest( frexp_kernel, frexp_ref, PairValidatorBuilderFactory(ULPValidatorBuilderFactory(0), @@ -253,7 +238,7 @@ TEST_CASE("Unit_Device_frexp_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_frexp_frexpf_Negative_RTC") { NegativeTestRTCWrapper<20>(kFrexp); } +TEST_CASE(Unit_Device_frexp_frexpf_Negative_RTC) { NegativeTestRTCWrapper<20>(kFrexp); } /********** Binary Functions **********/ @@ -275,7 +260,7 @@ MATH_BINARY_KERNEL_DEF(pow) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_pow_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_pow_Accuracy_Positive, float, double) { using RT = RefType_t; auto pow_ref = [](RT arg1, RT arg2) -> RT { if (std::isinf(arg1) && arg2 < 0) return 0; @@ -298,7 +283,7 @@ TEMPLATE_TEST_CASE("Unit_Device_pow_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_pow_powf_Negative_RTC") { NegativeTestRTCWrapper<8>(kPow); } +TEST_CASE(Unit_Device_pow_powf_Negative_RTC) { NegativeTestRTCWrapper<8>(kPow); } MATH_POW_INT_KERNEL_DEF(ldexp) @@ -316,7 +301,7 @@ MATH_POW_INT_KERNEL_DEF(ldexp) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_ldexp_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_ldexp_Accuracy_Positive, float, double) { using RT = RefType_t; RT (*ref)(RT, int) = std::ldexp; PowIntFloatingPointTest(ldexp_kernel, ref, @@ -335,7 +320,7 @@ TEMPLATE_TEST_CASE("Unit_Device_ldexp_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_ldexp_ldexpf_Negative_RTC") { NegativeTestRTCWrapper<8>(kLdexp); } +TEST_CASE(Unit_Device_ldexp_ldexpf_Negative_RTC) { NegativeTestRTCWrapper<8>(kLdexp); } MATH_POW_INT_KERNEL_DEF(powi) @@ -354,7 +339,7 @@ MATH_POW_INT_KERNEL_DEF(powi) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_powi_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_powi_Accuracy_Positive, float, double) { using RT = RefType_t; auto pow_ref = [](RT arg1, int arg2) -> RT { if (std::isinf(arg1) && arg2 < 0) return 0; @@ -378,7 +363,7 @@ TEMPLATE_TEST_CASE("Unit_Device_powi_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_powi_powif_Negative_RTC") { NegativeTestRTCWrapper<8>(kPowi); } +TEST_CASE(Unit_Device_powi_powif_Negative_RTC) { NegativeTestRTCWrapper<8>(kPowi); } MATH_POW_INT_KERNEL_DEF(scalbn) @@ -396,7 +381,7 @@ MATH_POW_INT_KERNEL_DEF(scalbn) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_scalbn_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_scalbn_Accuracy_Positive, float, double) { using RT = RefType_t; RT (*ref)(RT, int) = std::scalbn; PowIntFloatingPointTest(scalbn_kernel, ref, @@ -415,7 +400,7 @@ TEMPLATE_TEST_CASE("Unit_Device_scalbn_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_scalbn_scalbnf_Negative_RTC") { NegativeTestRTCWrapper<8>(kScalbn); } +TEST_CASE(Unit_Device_scalbn_scalbnf_Negative_RTC) { NegativeTestRTCWrapper<8>(kScalbn); } MATH_POW_INT_KERNEL_DEF(scalbln) @@ -433,7 +418,7 @@ MATH_POW_INT_KERNEL_DEF(scalbln) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_scalbln_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_scalbln_Accuracy_Positive, float, double) { using RT = RefType_t; RT (*ref)(RT, long int) = std::scalbln; PowIntFloatingPointTest(scalbln_kernel, ref, @@ -452,7 +437,7 @@ TEMPLATE_TEST_CASE("Unit_Device_scalbln_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_scalbln_scalblnf_Negative_RTC") { NegativeTestRTCWrapper<8>(kScalbln); } +TEST_CASE(Unit_Device_scalbln_scalblnf_Negative_RTC) { NegativeTestRTCWrapper<8>(kScalbln); } /** * End doxygen group MathTest. diff --git a/catch/unit/math/quaternary_common.hh b/catch/unit/math/quaternary_common.hh index 0cc5bf22c..a3ca76eed 100644 --- a/catch/unit/math/quaternary_common.hh +++ b/catch/unit/math/quaternary_common.hh @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once @@ -236,7 +221,7 @@ void QuaternaryFloatingPointTest(kernel_sig kernel, #define MATH_QUATERNARY_WITHIN_ULP_TEST_DEF(kern_name, ref_func, sp_ulp, dp_ulp) \ MATH_QUATERNARY_KERNEL_DEF(kern_name) \ \ - TEMPLATE_TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive", "", float, double) { \ + TEMPLATE_TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive, "", float, double) { \ using RT = RefType_t; \ RT (*ref)(RT, RT, RT, RT) = ref_func; \ const auto ulp = std::is_same_v ? sp_ulp : dp_ulp; \ diff --git a/catch/unit/math/remainder_and_rounding_funcs.cc b/catch/unit/math/remainder_and_rounding_funcs.cc index f761cb92a..2fd76aa0c 100644 --- a/catch/unit/math/remainder_and_rounding_funcs.cc +++ b/catch/unit/math/remainder_and_rounding_funcs.cc @@ -1,62 +1,47 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "unary_common.hh" #include "binary_common.hh" #include "math_remainder_rounding_negative_kernels_rtc.hh" MATH_BINARY_WITHIN_ULP_TEST_DEF(fmod, std::fmod, 0, 0) -TEST_CASE("Unit_Device_fmod_fmodf_Negative_RTC") { NegativeTestRTCWrapper<8>(kFmod); } +TEST_CASE(Unit_Device_fmod_fmodf_Negative_RTC) { NegativeTestRTCWrapper<8>(kFmod); } MATH_BINARY_WITHIN_ULP_TEST_DEF(remainder, std::remainder, 0, 0) -TEST_CASE("Unit_Device_remainder_remainder_Negative_RTC") { NegativeTestRTCWrapper<8>(kRemainder); } +TEST_CASE(Unit_Device_remainder_remainder_Negative_RTC) { NegativeTestRTCWrapper<8>(kRemainder); } MATH_BINARY_WITHIN_ULP_TEST_DEF(fdim, std::fdim, 0, 0) -TEST_CASE("Unit_Device_fdim_fdimf_Negative_RTC") { NegativeTestRTCWrapper<8>(kFdim); } +TEST_CASE(Unit_Device_fdim_fdimf_Negative_RTC) { NegativeTestRTCWrapper<8>(kFdim); } MATH_UNARY_WITHIN_ULP_TEST_DEF(trunc, std::trunc, 0, 0) -TEST_CASE("Unit_Device_trunc_truncf_Negative_RTC") { NegativeTestRTCWrapper<4>(kTrunc); } +TEST_CASE(Unit_Device_trunc_truncf_Negative_RTC) { NegativeTestRTCWrapper<4>(kTrunc); } MATH_UNARY_WITHIN_ULP_TEST_DEF(round, std::round, 0, 0) -TEST_CASE("Unit_Device_round_roundf_Negative_RTC") { NegativeTestRTCWrapper<4>(kRound); } +TEST_CASE(Unit_Device_round_roundf_Negative_RTC) { NegativeTestRTCWrapper<4>(kRound); } MATH_UNARY_WITHIN_ULP_TEST_DEF(rint, std::rint, 0, 0) -TEST_CASE("Unit_Device_rint_rintf_Negative_RTC") { NegativeTestRTCWrapper<4>(kRint); } +TEST_CASE(Unit_Device_rint_rintf_Negative_RTC) { NegativeTestRTCWrapper<4>(kRint); } MATH_UNARY_WITHIN_ULP_TEST_DEF(nearbyint, std::nearbyint, 0, 0) -TEST_CASE("Unit_Device_nearbyint_nearbyintf_Negative_RTC") { +TEST_CASE(Unit_Device_nearbyint_nearbyintf_Negative_RTC) { NegativeTestRTCWrapper<4>(kNearbyint); } MATH_UNARY_WITHIN_ULP_TEST_DEF(ceil, std::ceil, 0, 0) -TEST_CASE("Unit_Device_ceil_ceilf_Negative_RTC") { NegativeTestRTCWrapper<4>(kCeil); } +TEST_CASE(Unit_Device_ceil_ceilf_Negative_RTC) { NegativeTestRTCWrapper<4>(kCeil); } MATH_UNARY_WITHIN_ULP_TEST_DEF(floor, std::floor, 0, 0) -TEST_CASE("Unit_Device_floor_floorf_Negative_RTC") { NegativeTestRTCWrapper<4>(kFloor); } +TEST_CASE(Unit_Device_floor_floorf_Negative_RTC) { NegativeTestRTCWrapper<4>(kFloor); } #define LONG_CONVERSION_FUNCTION_TEST_DEF(kern_name, ref_func, lt) \ MATH_UNARY_KERNEL_DEF(kern_name) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive - float") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive_float) { \ lt (*ref)(double) = ref_func; \ UnarySinglePrecisionRangeTest(kern_name##_kernel, ref, \ EqValidatorBuilderFactory(), \ @@ -64,7 +49,7 @@ TEST_CASE("Unit_Device_floor_floorf_Negative_RTC") { NegativeTestRTCWrapper<4>(k static_cast(std::numeric_limits::max())); \ } \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive - double") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive_double) { \ lt (*ref)(long double) = ref_func; \ UnaryDoublePrecisionBruteForceTest(kern_name##_kernel, ref, \ EqValidatorBuilderFactory(), \ @@ -73,16 +58,16 @@ TEST_CASE("Unit_Device_floor_floorf_Negative_RTC") { NegativeTestRTCWrapper<4>(k } LONG_CONVERSION_FUNCTION_TEST_DEF(lrint, std::lrint, long) -TEST_CASE("Unit_Device_lrint_lrintf_Negative_RTC") { NegativeTestRTCWrapper<4>(kLrint); } +TEST_CASE(Unit_Device_lrint_lrintf_Negative_RTC) { NegativeTestRTCWrapper<4>(kLrint); } LONG_CONVERSION_FUNCTION_TEST_DEF(lround, std::lround, long) -TEST_CASE("Unit_Device_lround_lroundf_Negative_RTC") { NegativeTestRTCWrapper<4>(kLround); } +TEST_CASE(Unit_Device_lround_lroundf_Negative_RTC) { NegativeTestRTCWrapper<4>(kLround); } LONG_CONVERSION_FUNCTION_TEST_DEF(llrint, std::llrint, long long) -TEST_CASE("Unit_Device_llrint_llrintf_Negative_RTC") { NegativeTestRTCWrapper<4>(kLlrint); } +TEST_CASE(Unit_Device_llrint_llrintf_Negative_RTC) { NegativeTestRTCWrapper<4>(kLlrint); } LONG_CONVERSION_FUNCTION_TEST_DEF(llround, std::llround, long long) -TEST_CASE("Unit_Device_llround_llroundf_Negative_RTC") { NegativeTestRTCWrapper<4>(kLlround); } +TEST_CASE(Unit_Device_llround_llroundf_Negative_RTC) { NegativeTestRTCWrapper<4>(kLlround); } template __global__ void remquo_kernel(std::pair* const ys, @@ -106,7 +91,7 @@ template std::pair remquo_wrapper(T x1, T x2) { return ret; } -TEMPLATE_TEST_CASE("Unit_Device_remquo_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_remquo_Accuracy_Positive, float, double) { using RT = RefType_t; std::pair (*ref)(RT, RT) = remquo_wrapper; const auto ulp_builder = ULPValidatorBuilderFactory(0); @@ -116,7 +101,7 @@ TEMPLATE_TEST_CASE("Unit_Device_remquo_Accuracy_Positive", "", float, double) { PairValidatorBuilderFactory(ulp_builder, eq_builder)); } -TEST_CASE("Unit_Device_remquo_remquof_Negative_RTC") { NegativeTestRTCWrapper<24>(kRemquo); } +TEST_CASE(Unit_Device_remquo_remquof_Negative_RTC) { NegativeTestRTCWrapper<24>(kRemquo); } template __global__ void modf_kernel(std::pair* const ys, const size_t num_xs, T* const xs) { @@ -138,16 +123,16 @@ template std::pair modf_wrapper(T x) { return ret; } -TEST_CASE("Unit_Device_modf_Accuracy_Positive - float") { +TEST_CASE(Unit_Device_modf_Accuracy_Positive_float) { UnarySinglePrecisionTest( modf_kernel, modf_wrapper, PairValidatorBuilderFactory(ULPValidatorBuilderFactory(0))); } -TEST_CASE("Unit_Device_modf_Accuracy_Positive - double") { +TEST_CASE(Unit_Device_modf_Accuracy_Positive_double) { UnaryDoublePrecisionTest( modf_kernel, modf_wrapper, PairValidatorBuilderFactory(ULPValidatorBuilderFactory(0))); } -TEST_CASE("Unit_Device_modf_modff_Negative_RTC") { NegativeTestRTCWrapper<19>(kModf); } +TEST_CASE(Unit_Device_modf_modff_Negative_RTC) { NegativeTestRTCWrapper<19>(kModf); } diff --git a/catch/unit/math/root_funcs.cc b/catch/unit/math/root_funcs.cc index 4c4e88f6b..a69598ef7 100644 --- a/catch/unit/math/root_funcs.cc +++ b/catch/unit/math/root_funcs.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "unary_common.hh" #include "binary_common.hh" @@ -48,7 +33,7 @@ MATH_UNARY_KERNEL_DEF(sqrt) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_sqrtf_Accuracy_Positive") { +TEST_CASE(Unit_Device_sqrtf_Accuracy_Positive) { float (*ref)(float) = std::sqrt; UnarySinglePrecisionTest(sqrt_kernel, ref, ULPValidatorBuilderFactory(1)); } @@ -68,7 +53,7 @@ TEST_CASE("Unit_Device_sqrtf_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_sqrt_Accuracy_Positive") { +TEST_CASE(Unit_Device_sqrt_Accuracy_Positive) { double (*ref)(double) = std::sqrt; UnaryDoublePrecisionTest(sqrt_kernel, ref, ULPValidatorBuilderFactory(0)); } @@ -85,7 +70,7 @@ TEST_CASE("Unit_Device_sqrt_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_sqrt_sqrtf_Negative_RTC") { NegativeTestRTCWrapper<4>(kSqrt); } +TEST_CASE(Unit_Device_sqrt_sqrtf_Negative_RTC) { NegativeTestRTCWrapper<4>(kSqrt); } MATH_UNARY_KERNEL_DEF(rsqrt) @@ -102,7 +87,7 @@ MATH_UNARY_KERNEL_DEF(rsqrt) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rsqrtf_Accuracy_Positive") { +TEST_CASE(Unit_Device_rsqrtf_Accuracy_Positive) { auto rsqrt_ref = [](double arg) -> double { return 1. / std::sqrt(arg); }; double (*ref)(double) = rsqrt_ref; UnarySinglePrecisionTest(rsqrt_kernel, ref, ULPValidatorBuilderFactory(2)); @@ -121,7 +106,7 @@ TEST_CASE("Unit_Device_rsqrtf_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rsqrt_Accuracy_Positive") { +TEST_CASE(Unit_Device_rsqrt_Accuracy_Positive) { auto rsqrt_ref = [](long double arg) -> long double { return 1.L / std::sqrt(arg); }; long double (*ref)(long double) = rsqrt_ref; UnaryDoublePrecisionTest(rsqrt_kernel, ref, ULPValidatorBuilderFactory(1)); @@ -139,7 +124,7 @@ TEST_CASE("Unit_Device_rsqrt_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rsqrt_rsqrtf_Negative_RTC") { NegativeTestRTCWrapper<4>(kRsqrt); } +TEST_CASE(Unit_Device_rsqrt_rsqrtf_Negative_RTC) { NegativeTestRTCWrapper<4>(kRsqrt); } /** * Test Description @@ -169,7 +154,7 @@ MATH_UNARY_WITHIN_ULP_TEST_DEF(cbrt, std::cbrt, 1, 1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_cbrt_cbrtf_Negative_RTC") { NegativeTestRTCWrapper<4>(kCbrt); } +TEST_CASE(Unit_Device_cbrt_cbrtf_Negative_RTC) { NegativeTestRTCWrapper<4>(kCbrt); } MATH_UNARY_KERNEL_DEF(rcbrt) @@ -186,7 +171,7 @@ MATH_UNARY_KERNEL_DEF(rcbrt) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rcbrtf_Accuracy_Positive") { +TEST_CASE(Unit_Device_rcbrtf_Accuracy_Positive) { auto rcbrt_ref = [](double arg) -> double { return 1. / std::cbrt(arg); }; double (*ref)(double) = rcbrt_ref; UnarySinglePrecisionTest(rcbrt_kernel, ref, ULPValidatorBuilderFactory(1)); @@ -205,7 +190,7 @@ TEST_CASE("Unit_Device_rcbrtf_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rcbrt_Accuracy_Positive") { +TEST_CASE(Unit_Device_rcbrt_Accuracy_Positive) { auto rcbrt_ref = [](long double arg) -> long double { return 1. / std::cbrt(arg); }; long double (*ref)(long double) = rcbrt_ref; UnaryDoublePrecisionTest(rcbrt_kernel, ref, ULPValidatorBuilderFactory(1)); @@ -223,7 +208,7 @@ TEST_CASE("Unit_Device_rcbrt_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rcbrt_rcbrtf_Negative_RTC") { NegativeTestRTCWrapper<4>(kRcbrt); } +TEST_CASE(Unit_Device_rcbrt_rcbrtf_Negative_RTC) { NegativeTestRTCWrapper<4>(kRcbrt); } /********** Binary Functions **********/ @@ -256,7 +241,7 @@ MATH_BINARY_WITHIN_ULP_TEST_DEF(hypot, std::hypot, 3, 2) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_hypot_hypotf_Negative_RTC") { NegativeTestRTCWrapper<8>(kHypot); } +TEST_CASE(Unit_Device_hypot_hypotf_Negative_RTC) { NegativeTestRTCWrapper<8>(kHypot); } MATH_BINARY_KERNEL_DEF(rhypot) @@ -274,7 +259,7 @@ MATH_BINARY_KERNEL_DEF(rhypot) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_rhypot_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_rhypot_Accuracy_Positive, float, double) { using RT = RefType_t; auto rhypot_ref = [](RT arg1, RT arg2) -> RT { return 1. / std::hypot(arg1, arg2); }; RT (*ref)(RT, RT) = rhypot_ref; @@ -294,7 +279,7 @@ TEMPLATE_TEST_CASE("Unit_Device_rhypot_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rhypot_rhypotf_Negative_RTC") { NegativeTestRTCWrapper<8>(kRhypot); } +TEST_CASE(Unit_Device_rhypot_rhypotf_Negative_RTC) { NegativeTestRTCWrapper<8>(kRhypot); } /********** Ternary Functions **********/ @@ -314,7 +299,7 @@ MATH_TERNARY_KERNEL_DEF(norm3d) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_norm3d_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_norm3d_Accuracy_Positive, float, double) { using RT = RefType_t; auto norm3d_ref = [](RT arg1, RT arg2, RT arg3) -> RT { if (std::isinf(arg1) || std::isinf(arg2) || std::isinf(arg3)) { @@ -339,7 +324,7 @@ TEMPLATE_TEST_CASE("Unit_Device_norm3d_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_norm3d_norm3df_Negative_RTC") { NegativeTestRTCWrapper<12>(kNorm3D); } +TEST_CASE(Unit_Device_norm3d_norm3df_Negative_RTC) { NegativeTestRTCWrapper<12>(kNorm3D); } MATH_TERNARY_KERNEL_DEF(rnorm3d) @@ -357,7 +342,7 @@ MATH_TERNARY_KERNEL_DEF(rnorm3d) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_rnorm3d_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_rnorm3d_Accuracy_Positive, float, double) { using RT = RefType_t; auto rnorm3d_ref = [](RT arg1, RT arg2, RT arg3) -> RT { if (std::isinf(arg1) || std::isinf(arg2) || std::isinf(arg3)) { @@ -383,7 +368,7 @@ TEMPLATE_TEST_CASE("Unit_Device_rnorm3d_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rnorm3d_rnorm3df_Negative_RTC") { NegativeTestRTCWrapper<12>(kRnorm3D); } +TEST_CASE(Unit_Device_rnorm3d_rnorm3df_Negative_RTC) { NegativeTestRTCWrapper<12>(kRnorm3D); } /********** Quaternary Functions **********/ @@ -403,7 +388,7 @@ MATH_QUATERNARY_KERNEL_DEF(norm4d) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_norm4d_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_norm4d_Accuracy_Positive, float, double) { using RT = RefType_t; auto norm4d_ref = [](RT arg1, RT arg2, RT arg3, RT arg4) -> RT { if (std::isinf(arg1) || std::isinf(arg2) || std::isinf(arg3) || std::isinf(arg4)) { @@ -429,7 +414,7 @@ TEMPLATE_TEST_CASE("Unit_Device_norm4d_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_norm4d_norm4df_Negative_RTC") { NegativeTestRTCWrapper<16>(kNorm4D); } +TEST_CASE(Unit_Device_norm4d_norm4df_Negative_RTC) { NegativeTestRTCWrapper<16>(kNorm4D); } MATH_QUATERNARY_KERNEL_DEF(rnorm4d) @@ -447,7 +432,7 @@ MATH_QUATERNARY_KERNEL_DEF(rnorm4d) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_rnorm4d_Accuracy_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_rnorm4d_Accuracy_Positive, float, double) { using RT = RefType_t; auto rnorm4d_ref = [](RT arg1, RT arg2, RT arg3, RT arg4) -> RT { if (std::isinf(arg1) || std::isinf(arg2) || std::isinf(arg3) || std::isinf(arg4)) { @@ -473,7 +458,7 @@ TEMPLATE_TEST_CASE("Unit_Device_rnorm4d_Accuracy_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rnorm4d_rnorm4df_Negative_RTC") { NegativeTestRTCWrapper<16>(kRnorm4D); } +TEST_CASE(Unit_Device_rnorm4d_rnorm4df_Negative_RTC) { NegativeTestRTCWrapper<16>(kRnorm4D); } /********** norm Function **********/ @@ -531,7 +516,7 @@ MATH_NORM_KERNEL_DEF(norm) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_norm_Sanity_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_norm_Sanity_Positive, float, double) { using RT = RefType_t; auto norm_ref = [](int dim, TestType* args) -> RT { RT sum = 0; @@ -558,7 +543,7 @@ TEMPLATE_TEST_CASE("Unit_Device_norm_Sanity_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_norm_normf_Negative_RTC") { NegativeTestRTCWrapper<18>(kNorm); } +TEST_CASE(Unit_Device_norm_normf_Negative_RTC) { NegativeTestRTCWrapper<18>(kNorm); } MATH_NORM_KERNEL_DEF(rnorm) @@ -574,7 +559,7 @@ MATH_NORM_KERNEL_DEF(rnorm) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_Device_rnorm_Sanity_Positive", "", float, double) { +TEMPLATE_TEST_CASE(Unit_Device_rnorm_Sanity_Positive, float, double) { using RT = RefType_t; auto rnorm_ref = [](int dim, TestType* args) -> RT { RT sum = 0; @@ -601,7 +586,7 @@ TEMPLATE_TEST_CASE("Unit_Device_rnorm_Sanity_Positive", "", float, double) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_rnorm_rnormf_Negative_RTC") { NegativeTestRTCWrapper<18>(kRnorm); } +TEST_CASE(Unit_Device_rnorm_rnormf_Negative_RTC) { NegativeTestRTCWrapper<18>(kRnorm); } /** * End doxygen group MathTest. diff --git a/catch/unit/math/single_precision_intrinsics.cc b/catch/unit/math/single_precision_intrinsics.cc index 3879fc610..b54128f0a 100644 --- a/catch/unit/math/single_precision_intrinsics.cc +++ b/catch/unit/math/single_precision_intrinsics.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -39,7 +23,7 @@ THE SOFTWARE. } #define MATH_UNARY_SP_TEST_DEF_IMPL(func_name, ref_func, validator_builder) \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ UnarySinglePrecisionTest(func_name##_kernel, ref_func, validator_builder); \ } @@ -365,7 +349,7 @@ MATH_UNARY_SP_TEST_DEF_IMPL(__sincosf_cos, static_cast(std:: } #define MATH_BINARY_SP_TEST_DEF_IMPL(func_name, ref_func, validator_builder) \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ BinaryFloatingPointTest(func_name##_kernel, ref_func, validator_builder); \ } @@ -499,7 +483,7 @@ MATH_BINARY_SP_TEST_DEF(__fdividef, __fdiv_rn_ref); } #define MATH_TERNARY_SP_TEST_DEF_IMPL(func_name, ref_func, validator_builder) \ - TEST_CASE("Unit_Device_" #func_name "_Accuracy_Positive") { \ + TEST_CASE(Unit_Device_##func_name##_Accuracy_Positive) { \ TernaryFloatingPointTest(func_name##_kernel, ref_func, validator_builder); \ } diff --git a/catch/unit/math/single_precision_intrinsics_negative_kernels.cc b/catch/unit/math/single_precision_intrinsics_negative_kernels.cc index f293894f8..134534cf3 100644 --- a/catch/unit/math/single_precision_intrinsics_negative_kernels.cc +++ b/catch/unit/math/single_precision_intrinsics_negative_kernels.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/special_common.hh b/catch/unit/math/special_common.hh index ac821c925..bbc06878f 100644 --- a/catch/unit/math/special_common.hh +++ b/catch/unit/math/special_common.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/special_funcs.cc b/catch/unit/math/special_funcs.cc index 6e91c627d..1b4e0570f 100644 --- a/catch/unit/math/special_funcs.cc +++ b/catch/unit/math/special_funcs.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "unary_common.hh" #include "binary_common.hh" @@ -62,7 +47,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(erf, 2, 2) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erf_erff_Negative_RTC") { NegativeTestRTCWrapper<4>(kErf); } +TEST_CASE(Unit_Device_erf_erff_Negative_RTC) { NegativeTestRTCWrapper<4>(kErf); } /** * Test Description @@ -93,7 +78,7 @@ MATH_UNARY_WITHIN_ULP_STL_REF_TEST_DEF(erfc, 4, 5) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfc_erfcf_Negative_RTC") { NegativeTestRTCWrapper<4>(kErfc); } +TEST_CASE(Unit_Device_erfc_erfcf_Negative_RTC) { NegativeTestRTCWrapper<4>(kErfc); } MATH_UNARY_KERNEL_DEF(erfinv) @@ -111,7 +96,7 @@ MATH_UNARY_KERNEL_DEF(erfinv) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfinvf_Accuracy_Positive") { +TEST_CASE(Unit_Device_erfinvf_Accuracy_Positive) { auto erfinv_ref = [](double arg) -> double { if (arg == 0) return 0; if (arg == 1) @@ -141,7 +126,7 @@ TEST_CASE("Unit_Device_erfinvf_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfinv_Accuracy_Positive") { +TEST_CASE(Unit_Device_erfinv_Accuracy_Positive) { auto erfinv_ref = [](long double arg) -> long double { if (arg == 0) return 0; if (arg == 1) @@ -168,7 +153,7 @@ TEST_CASE("Unit_Device_erfinv_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfinv_erfinvf_Negative_RTC") { NegativeTestRTCWrapper<4>(kErfinv); } +TEST_CASE(Unit_Device_erfinv_erfinvf_Negative_RTC) { NegativeTestRTCWrapper<4>(kErfinv); } MATH_UNARY_KERNEL_DEF(erfcinv) @@ -186,7 +171,7 @@ MATH_UNARY_KERNEL_DEF(erfcinv) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfcinvf_Accuracy_Positive") { +TEST_CASE(Unit_Device_erfcinvf_Accuracy_Positive) { auto erfcinv_ref = [](double arg) -> double { if (arg == 0) return std::numeric_limits::infinity(); @@ -215,7 +200,7 @@ TEST_CASE("Unit_Device_erfcinvf_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfcinv_Accuracy_Positive") { +TEST_CASE(Unit_Device_erfcinv_Accuracy_Positive) { auto erfcinv_ref = [](long double arg) -> long double { if (arg == 0) return std::numeric_limits::infinity(); @@ -241,7 +226,7 @@ TEST_CASE("Unit_Device_erfcinv_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfcinv_erfcinvf_Negative_RTC") { NegativeTestRTCWrapper<4>(kErfcinv); } +TEST_CASE(Unit_Device_erfcinv_erfcinvf_Negative_RTC) { NegativeTestRTCWrapper<4>(kErfcinv); } MATH_UNARY_KERNEL_DEF(erfcx) @@ -257,7 +242,7 @@ MATH_UNARY_KERNEL_DEF(erfcx) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfcxf_Sanity_Positive") { +TEST_CASE(Unit_Device_erfcxf_Sanity_Positive) { constexpr std::array input{-std::numeric_limits::infinity(), -1000.f, -100.f, @@ -296,7 +281,7 @@ TEST_CASE("Unit_Device_erfcxf_Sanity_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfcx_Sanity_Positive") { +TEST_CASE(Unit_Device_erfcx_Sanity_Positive) { constexpr std::array input{ -std::numeric_limits::infinity(), -1000., -100., -5., -0.5, 0., 0.75, 15., 200., 500., std::numeric_limits::infinity()}; @@ -327,7 +312,7 @@ TEST_CASE("Unit_Device_erfcx_Sanity_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_erfcx_erfcxf_Negative_RTC") { NegativeTestRTCWrapper<4>(kErfcx); } +TEST_CASE(Unit_Device_erfcx_erfcxf_Negative_RTC) { NegativeTestRTCWrapper<4>(kErfcx); } MATH_UNARY_KERNEL_DEF(normcdf) @@ -344,7 +329,7 @@ MATH_UNARY_KERNEL_DEF(normcdf) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_normcdff_Accuracy_Positive") { +TEST_CASE(Unit_Device_normcdff_Accuracy_Positive) { auto normcdf_ref = [](double arg) -> double { return std::erfc(-arg / std::sqrt(2)) / 2; }; double (*ref)(double) = normcdf_ref; UnarySinglePrecisionTest(normcdf_kernel, ref, ULPValidatorBuilderFactory(5)); @@ -363,7 +348,7 @@ TEST_CASE("Unit_Device_normcdff_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_normcdf_Accuracy_Positive") { +TEST_CASE(Unit_Device_normcdf_Accuracy_Positive) { auto normcdf_ref = [](long double arg) -> long double { return std::erfc(-arg / std::sqrt(2.L)) / 2; }; @@ -383,7 +368,7 @@ TEST_CASE("Unit_Device_normcdf_Accuracy_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_normcdf_normcdff_Negative_RTC") { NegativeTestRTCWrapper<4>(kNormcdf); } +TEST_CASE(Unit_Device_normcdf_normcdff_Negative_RTC) { NegativeTestRTCWrapper<4>(kNormcdf); } MATH_UNARY_KERNEL_DEF(normcdfinv) @@ -399,7 +384,7 @@ MATH_UNARY_KERNEL_DEF(normcdfinv) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_normcdfinvf_Sanity_Positive") { +TEST_CASE(Unit_Device_normcdfinvf_Sanity_Positive) { constexpr std::array input{0.f, 0.1f, 0.25f, 0.4f, 0.5f, 0.6f, 0.75f, 0.9f, 1.f}; constexpr std::array reference{-std::numeric_limits::infinity(), -1.28155160f, @@ -426,7 +411,7 @@ TEST_CASE("Unit_Device_normcdfinvf_Sanity_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_normcdfinv_Sanity_Positive") { +TEST_CASE(Unit_Device_normcdfinv_Sanity_Positive) { constexpr std::array input{0., 0.1, 0.25, 0.4, 0.5, 0.6, 0.75, 0.9, 1.}; constexpr std::array reference{-std::numeric_limits::infinity(), -1.2815515655446004, @@ -453,7 +438,7 @@ TEST_CASE("Unit_Device_normcdfinv_Sanity_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_normcdfinv_normcdfinvf_Negative_RTC") { +TEST_CASE(Unit_Device_normcdfinv_normcdfinvf_Negative_RTC) { NegativeTestRTCWrapper<4>(kNormcdfinv); } @@ -474,7 +459,7 @@ MATH_UNARY_KERNEL_DEF(tgamma) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_tgammaf_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_tgammaf_Accuracy_Limited_Positive) { double (*ref)(double) = std::tgamma; UnarySinglePrecisionRangeTest(tgamma_kernel, ref, ULPValidatorBuilderFactory(5), std::numeric_limits::lowest(), -0.001f); @@ -497,7 +482,7 @@ TEST_CASE("Unit_Device_tgammaf_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_tgamma_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_tgamma_Accuracy_Limited_Positive) { long double (*ref)(long double) = std::tgamma; UnaryDoublePrecisionTest(tgamma_kernel, ref, ULPValidatorBuilderFactory(10)); } @@ -514,7 +499,7 @@ TEST_CASE("Unit_Device_tgamma_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_tgamma_tgammaf_Negative_RTC") { NegativeTestRTCWrapper<4>(kTgamma); } +TEST_CASE(Unit_Device_tgamma_tgammaf_Negative_RTC) { NegativeTestRTCWrapper<4>(kTgamma); } MATH_UNARY_KERNEL_DEF(lgamma) @@ -532,7 +517,7 @@ MATH_UNARY_KERNEL_DEF(lgamma) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_lgammaf_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_lgammaf_Accuracy_Limited_Positive) { double (*ref)(double) = std::lgamma; UnarySinglePrecisionRangeTest(lgamma_kernel, ref, ULPValidatorBuilderFactory(7), std::numeric_limits::lowest(), -11.0001f); @@ -555,7 +540,7 @@ TEST_CASE("Unit_Device_lgammaf_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_lgamma_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_lgamma_Accuracy_Limited_Positive) { long double (*ref)(long double) = std::lgamma; UnaryDoublePrecisionBruteForceTest(lgamma_kernel, ref, ULPValidatorBuilderFactory(4), @@ -577,7 +562,7 @@ TEST_CASE("Unit_Device_lgamma_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_lgamma_lgammaf_Negative_RTC") { NegativeTestRTCWrapper<4>(kLgamma); } +TEST_CASE(Unit_Device_lgamma_lgammaf_Negative_RTC) { NegativeTestRTCWrapper<4>(kLgamma); } MATH_UNARY_KERNEL_DEF(cyl_bessel_i0) @@ -595,7 +580,7 @@ MATH_UNARY_KERNEL_DEF(cyl_bessel_i0) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_cyl_bessel_i0f_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_cyl_bessel_i0f_Accuracy_Limited_Positive) { auto cyl_bessel_i0_ref = [](double arg) -> double { return std::cyl_bessel_i(0, arg); }; double (*ref)(double) = cyl_bessel_i0_ref; UnarySinglePrecisionRangeTest(cyl_bessel_i0_kernel, ref, @@ -617,7 +602,7 @@ TEST_CASE("Unit_Device_cyl_bessel_i0f_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_cyl_bessel_i0_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_cyl_bessel_i0_Accuracy_Limited_Positive) { auto cyl_bessel_i0_ref = [](long double arg) -> long double { return std::cyl_bessel_i(0, arg); }; long double (*ref)(long double) = cyl_bessel_i0_ref; UnaryDoublePrecisionBruteForceTest(cyl_bessel_i0_kernel, ref, @@ -636,7 +621,7 @@ TEST_CASE("Unit_Device_cyl_bessel_i0_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_cyl_bessel_i0_cyl_bessel_i0f_Negative_RTC") { +TEST_CASE(Unit_Device_cyl_bessel_i0_cyl_bessel_i0f_Negative_RTC) { NegativeTestRTCWrapper<4>(kCylBesselI0); } @@ -656,7 +641,7 @@ MATH_UNARY_KERNEL_DEF(cyl_bessel_i1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_cyl_bessel_i1f_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_cyl_bessel_i1f_Accuracy_Limited_Positive) { auto cyl_bessel_i1_ref = [](double arg) -> double { return std::cyl_bessel_i(1, arg); }; double (*ref)(double) = cyl_bessel_i1_ref; UnarySinglePrecisionRangeTest(cyl_bessel_i1_kernel, ref, @@ -678,7 +663,7 @@ TEST_CASE("Unit_Device_cyl_bessel_i1f_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_cyl_bessel_i1_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_cyl_bessel_i1_Accuracy_Limited_Positive) { auto cyl_bessel_i1_ref = [](long double arg) -> long double { return std::cyl_bessel_i(1, arg); }; long double (*ref)(long double) = cyl_bessel_i1_ref; UnaryDoublePrecisionBruteForceTest(cyl_bessel_i1_kernel, ref, @@ -697,7 +682,7 @@ TEST_CASE("Unit_Device_cyl_bessel_i1_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_cyl_bessel_i1_cyl_bessel_i1f_Negative_RTC") { +TEST_CASE(Unit_Device_cyl_bessel_i1_cyl_bessel_i1f_Negative_RTC) { NegativeTestRTCWrapper<4>(kCylBesselI1); } @@ -719,7 +704,7 @@ MATH_UNARY_KERNEL_DEF(y0) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_y0f_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_y0f_Accuracy_Limited_Positive) { #ifdef __unix__ double (*ref)(double) = y0; #elif _WIN64 @@ -746,7 +731,7 @@ TEST_CASE("Unit_Device_y0f_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_y0_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_y0_Accuracy_Limited_Positive) { #ifdef __unix__ long double (*ref)(long double) = y0l; #elif _WIN64 @@ -769,7 +754,7 @@ TEST_CASE("Unit_Device_y0_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_y0_y0f_Negative_RTC") { NegativeTestRTCWrapper<4>(kY0); } +TEST_CASE(Unit_Device_y0_y0f_Negative_RTC) { NegativeTestRTCWrapper<4>(kY0); } MATH_UNARY_KERNEL_DEF(y1) @@ -787,7 +772,7 @@ MATH_UNARY_KERNEL_DEF(y1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_y1f_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_y1f_Accuracy_Limited_Positive) { #ifdef __unix__ double (*ref)(double) = y1; #elif _WIN64 @@ -814,7 +799,7 @@ TEST_CASE("Unit_Device_y1f_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_y1_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_y1_Accuracy_Limited_Positive) { #ifdef __unix__ long double (*ref)(long double) = y1l; #elif _WIN64 @@ -837,7 +822,7 @@ TEST_CASE("Unit_Device_y1_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_y1_y1f_Negative_RTC") { NegativeTestRTCWrapper<4>(kY1); } +TEST_CASE(Unit_Device_y1_y1f_Negative_RTC) { NegativeTestRTCWrapper<4>(kY1); } MATH_BESSEL_N_KERNEL_DEF(yn) @@ -855,7 +840,7 @@ MATH_BESSEL_N_KERNEL_DEF(yn) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_ynf_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_ynf_Accuracy_Limited_Positive) { #ifdef __unix__ double (*ref)(int, double) = yn; #elif _WIN64 @@ -881,7 +866,7 @@ TEST_CASE("Unit_Device_ynf_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_yn_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_yn_Accuracy_Limited_Positive) { #ifdef __unix__ long double (*ref)(int, long double) = ynl; #elif _WIN64 @@ -905,7 +890,7 @@ TEST_CASE("Unit_Device_yn_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_yn_ynf_Negative_RTC") { NegativeTestRTCWrapper<8>(kYn); } +TEST_CASE(Unit_Device_yn_ynf_Negative_RTC) { NegativeTestRTCWrapper<8>(kYn); } MATH_UNARY_KERNEL_DEF(j0) @@ -923,7 +908,7 @@ MATH_UNARY_KERNEL_DEF(j0) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_j0f_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_j0f_Accuracy_Limited_Positive) { #ifdef __unix__ double (*ref)(double) = j0; #elif _WIN64 @@ -952,7 +937,7 @@ TEST_CASE("Unit_Device_j0f_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_j0_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_j0_Accuracy_Limited_Positive) { #ifdef __unix__ long double (*ref)(long double) = j0l; #elif _WIN64 @@ -975,7 +960,7 @@ TEST_CASE("Unit_Device_j0_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_j0_j0f_Negative_RTC") { NegativeTestRTCWrapper<4>(kJ0); } +TEST_CASE(Unit_Device_j0_j0f_Negative_RTC) { NegativeTestRTCWrapper<4>(kJ0); } MATH_UNARY_KERNEL_DEF(j1) @@ -993,7 +978,7 @@ MATH_UNARY_KERNEL_DEF(j1) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_j1f_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_j1f_Accuracy_Limited_Positive) { #ifdef __unix__ double (*ref)(double) = j1; #elif _WIN64 @@ -1022,7 +1007,7 @@ TEST_CASE("Unit_Device_j1f_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_j1_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_j1_Accuracy_Limited_Positive) { #ifdef __unix__ long double (*ref)(long double) = j1l; #elif _WIN64 @@ -1045,7 +1030,7 @@ TEST_CASE("Unit_Device_j1_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_j1_j1f_Negative_RTC") { NegativeTestRTCWrapper<4>(kJ1); } +TEST_CASE(Unit_Device_j1_j1f_Negative_RTC) { NegativeTestRTCWrapper<4>(kJ1); } MATH_BESSEL_N_KERNEL_DEF(jn) @@ -1063,7 +1048,7 @@ MATH_BESSEL_N_KERNEL_DEF(jn) * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_jnf_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_jnf_Accuracy_Limited_Positive) { #ifdef __unix__ double (*ref)(int, double) = jn; #elif _WIN64 @@ -1089,7 +1074,7 @@ TEST_CASE("Unit_Device_jnf_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_jn_Accuracy_Limited_Positive") { +TEST_CASE(Unit_Device_jn_Accuracy_Limited_Positive) { #ifdef __unix__ long double (*ref)(int, long double) = jnl; #elif _WIN64 @@ -1113,7 +1098,7 @@ TEST_CASE("Unit_Device_jn_Accuracy_Limited_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Device_jn_jnf_Negative_RTC") { NegativeTestRTCWrapper<8>(kJn); } +TEST_CASE(Unit_Device_jn_jnf_Negative_RTC) { NegativeTestRTCWrapper<8>(kJn); } /** * End doxygen group MathTest. diff --git a/catch/unit/math/ternary_common.hh b/catch/unit/math/ternary_common.hh index 50d48828c..065cc36df 100644 --- a/catch/unit/math/ternary_common.hh +++ b/catch/unit/math/ternary_common.hh @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once @@ -141,7 +126,7 @@ void TernaryFloatingPointTest(kernel_sig kernel, #define MATH_TERNARY_WITHIN_ULP_TEST_DEF(kern_name, ref_func, sp_ulp, dp_ulp) \ MATH_TERNARY_KERNEL_DEF(kern_name) \ \ - TEMPLATE_TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive", "", float, double) { \ + TEMPLATE_TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive, float, double) { \ using RT = RefType_t; \ RT (*ref)(RT, RT, RT) = ref_func; \ const auto ulp = std::is_same_v ? sp_ulp : dp_ulp; \ diff --git a/catch/unit/math/thread_pool.hh b/catch/unit/math/thread_pool.hh index 2ca7a5762..6520ecc8b 100644 --- a/catch/unit/math/thread_pool.hh +++ b/catch/unit/math/thread_pool.hh @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/math/trig_double_precision_negative_kernels.cc b/catch/unit/math/trig_double_precision_negative_kernels.cc index 2008837fd..cb3f216fb 100644 --- a/catch/unit/math/trig_double_precision_negative_kernels.cc +++ b/catch/unit/math/trig_double_precision_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/trig_funcs.cc b/catch/unit/math/trig_funcs.cc index d020c579a..84749c353 100644 --- a/catch/unit/math/trig_funcs.cc +++ b/catch/unit/math/trig_funcs.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "trig_negative_kernels_rtc.hh" @@ -27,49 +12,49 @@ THE SOFTWARE. MATH_UNARY_WITHIN_ULP_TEST_DEF(sin, std::sin, 2, 2); -TEST_CASE("Unit_Device_sin_sinf_Negative_RTC") { NegativeTestRTCWrapper<4>(kSin); } +TEST_CASE(Unit_Device_sin_sinf_Negative_RTC) { NegativeTestRTCWrapper<4>(kSin); } MATH_UNARY_WITHIN_ULP_TEST_DEF(cos, std::cos, 2, 2) -TEST_CASE("Unit_Device_cos_cosf_Negative_RTC") { NegativeTestRTCWrapper<4>(kCos); } +TEST_CASE(Unit_Device_cos_cosf_Negative_RTC) { NegativeTestRTCWrapper<4>(kCos); } MATH_UNARY_WITHIN_ULP_TEST_DEF(tan, std::tan, 4, 2) -TEST_CASE("Unit_Device_tan_tanf_Negative_RTC") { NegativeTestRTCWrapper<4>(kTan); } +TEST_CASE(Unit_Device_tan_tanf_Negative_RTC) { NegativeTestRTCWrapper<4>(kTan); } MATH_UNARY_WITHIN_ULP_TEST_DEF(asin, std::asin, 3, 2) -TEST_CASE("Unit_Device_asin_asinf_Negative_RTC") { NegativeTestRTCWrapper<4>(kAsin); } +TEST_CASE(Unit_Device_asin_asinf_Negative_RTC) { NegativeTestRTCWrapper<4>(kAsin); } MATH_UNARY_WITHIN_ULP_TEST_DEF(acos, std::acos, 2, 2) -TEST_CASE("Unit_Device_acos_acosf_Negative_RTC") { NegativeTestRTCWrapper<4>(kAcos); } +TEST_CASE(Unit_Device_acos_acosf_Negative_RTC) { NegativeTestRTCWrapper<4>(kAcos); } MATH_UNARY_WITHIN_ULP_TEST_DEF(atan, std::atan, 2, 2) -TEST_CASE("Unit_Device_atan_atanf_Negative_RTC") { NegativeTestRTCWrapper<4>(kAtan); } +TEST_CASE(Unit_Device_atan_atanf_Negative_RTC) { NegativeTestRTCWrapper<4>(kAtan); } MATH_UNARY_WITHIN_ULP_TEST_DEF(sinh, std::sinh, 3, 2) -TEST_CASE("Unit_Device_sinh_sinhf_Negative_RTC") { NegativeTestRTCWrapper<4>(kSinh); } +TEST_CASE(Unit_Device_sinh_sinhf_Negative_RTC) { NegativeTestRTCWrapper<4>(kSinh); } MATH_UNARY_WITHIN_ULP_TEST_DEF(cosh, std::cosh, 2, 1) -TEST_CASE("Unit_Device_cosh_coshf_Negative_RTC") { NegativeTestRTCWrapper<4>(kCosh); } +TEST_CASE(Unit_Device_cosh_coshf_Negative_RTC) { NegativeTestRTCWrapper<4>(kCosh); } MATH_UNARY_WITHIN_ULP_TEST_DEF(tanh, std::tanh, 2, 1) -TEST_CASE("Unit_Device_tanh_tanhf_Negative_RTC") { NegativeTestRTCWrapper<4>(kTanh); } +TEST_CASE(Unit_Device_tanh_tanhf_Negative_RTC) { NegativeTestRTCWrapper<4>(kTanh); } MATH_UNARY_WITHIN_ULP_TEST_DEF(asinh, std::asinh, 3, 2) -TEST_CASE("Unit_Device_asinh_asinhf_Negative_RTC") { NegativeTestRTCWrapper<4>(kAsinh); } +TEST_CASE(Unit_Device_asinh_asinhf_Negative_RTC) { NegativeTestRTCWrapper<4>(kAsinh); } MATH_UNARY_WITHIN_ULP_TEST_DEF(acosh, std::acosh, 4, 2) -TEST_CASE("Unit_Device_acosh_acoshf_Negative_RTC") { NegativeTestRTCWrapper<4>(kAcosh); } +TEST_CASE(Unit_Device_acosh_acoshf_Negative_RTC) { NegativeTestRTCWrapper<4>(kAcosh); } MATH_UNARY_WITHIN_ULP_TEST_DEF(atanh, std::atanh, 3, 2) -TEST_CASE("Unit_Device_atanh_atanhf_Negative_RTC") { NegativeTestRTCWrapper<4>(kAtanh); } +TEST_CASE(Unit_Device_atanh_atanhf_Negative_RTC) { NegativeTestRTCWrapper<4>(kAtanh); } MATH_UNARY_WITHIN_ULP_TEST_DEF(sinpi, math_reference::sin_pi, 2, 2); -TEST_CASE("Unit_Device_sinpi_sinpif_Negative_RTC") { NegativeTestRTCWrapper<4>(kSinpi); } +TEST_CASE(Unit_Device_sinpi_sinpif_Negative_RTC) { NegativeTestRTCWrapper<4>(kSinpi); } MATH_UNARY_WITHIN_ULP_TEST_DEF(cospi, math_reference::cos_pi, 2, 2); -TEST_CASE("Unit_Device_cospi_cospif_Negative_RTC") { NegativeTestRTCWrapper<4>(kCospi); } +TEST_CASE(Unit_Device_cospi_cospif_Negative_RTC) { NegativeTestRTCWrapper<4>(kCospi); } MATH_BINARY_WITHIN_ULP_TEST_DEF(atan2, std::atan2, 3, 2); -TEST_CASE("Unit_Device_atan2_atan2f_Negative_RTC") { NegativeTestRTCWrapper<8>(kAtan2); } +TEST_CASE(Unit_Device_atan2_atan2f_Negative_RTC) { NegativeTestRTCWrapper<8>(kAtan2); } template @@ -88,19 +73,19 @@ __global__ void sincos_kernel(std::pair* const ys, const size_t num_xs, T* template std::pair sincos(T x) { return {std::sin(x), std::cos(x)}; } -TEST_CASE("Unit_Device_sincos_Accuracy_Positive - float") { +TEST_CASE(Unit_Device_sincos_Accuracy_Positive_float) { UnarySinglePrecisionTest( sincos_kernel, sincos, PairValidatorBuilderFactory(ULPValidatorBuilderFactory(2))); } -TEST_CASE("Unit_Device_sincos_Accuracy_Positive - double") { +TEST_CASE(Unit_Device_sincos_Accuracy_Positive_double) { const auto validator_builder = PairValidatorBuilderFactory(ULPValidatorBuilderFactory(2)); UnaryDoublePrecisionTest(sincos_kernel, sincos, validator_builder); } -TEST_CASE("Unit_Device_sincos_sincosf_Negative_RTC") { NegativeTestRTCWrapper<36>(kSincos); } +TEST_CASE(Unit_Device_sincos_sincosf_Negative_RTC) { NegativeTestRTCWrapper<36>(kSincos); } template @@ -121,16 +106,16 @@ template std::pair sincospi(T x) { return {math_reference::sin_pi(x), math_reference::cos_pi(x)}; } -TEST_CASE("Unit_Device_sincospi_Accuracy_Positive - float") { +TEST_CASE(Unit_Device_sincospi_Accuracy_Positive_float) { UnarySinglePrecisionTest( sincospi_kernel, sincospi, PairValidatorBuilderFactory(ULPValidatorBuilderFactory(2))); } -TEST_CASE("Unit_Device_sincospi_Accuracy_Positive - double") { +TEST_CASE(Unit_Device_sincospi_Accuracy_Positive_double) { const auto validator_builder = PairValidatorBuilderFactory(ULPValidatorBuilderFactory(2)); UnaryDoublePrecisionTest(sincospi_kernel, sincospi, validator_builder); } -TEST_CASE("Unit_Device_sincospi_sincospif_Negative_RTC") { NegativeTestRTCWrapper<36>(kSincospi); } \ No newline at end of file +TEST_CASE(Unit_Device_sincospi_sincospif_Negative_RTC) { NegativeTestRTCWrapper<36>(kSincospi); } \ No newline at end of file diff --git a/catch/unit/math/trig_single_precision_negative_kernels.cc b/catch/unit/math/trig_single_precision_negative_kernels.cc index 5e66d386b..7c52d99c6 100644 --- a/catch/unit/math/trig_single_precision_negative_kernels.cc +++ b/catch/unit/math/trig_single_precision_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/math/unary_common.hh b/catch/unit/math/unary_common.hh index ecb0eb936..942c6b83f 100644 --- a/catch/unit/math/unary_common.hh +++ b/catch/unit/math/unary_common.hh @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once @@ -235,13 +220,13 @@ void UnaryDoublePrecisionTest(kernel_sig kernel, ref_sig r #define MATH_UNARY_WITHIN_ULP_TEST_DEF(kern_name, ref_func, sp_ulp, dp_ulp) \ MATH_UNARY_KERNEL_DEF(kern_name) \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive - float") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive_float) { \ double (*ref)(double) = ref_func; \ UnarySinglePrecisionTest(kern_name##_kernel, ref, \ ULPValidatorBuilderFactory(sp_ulp)); \ } \ \ - TEST_CASE("Unit_Device_" #kern_name "_Accuracy_Positive - double") { \ + TEST_CASE(Unit_Device_##kern_name##_Accuracy_Positive_double) { \ long double (*ref)(long double) = ref_func; \ UnaryDoublePrecisionTest(kern_name##_kernel, ref, \ ULPValidatorBuilderFactory(dp_ulp)); \ diff --git a/catch/unit/math/validators.hh b/catch/unit/math/validators.hh index d62ec5381..79d6543a1 100644 --- a/catch/unit/math/validators.hh +++ b/catch/unit/math/validators.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/memory/CMakeLists.txt b/catch/unit/memory/CMakeLists.txt index b7a4ccb9c..b2a8fb252 100644 --- a/catch/unit/memory/CMakeLists.txt +++ b/catch/unit/memory/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(COMMON_SHARED_SRC DriverContext.cc) @@ -27,8 +11,6 @@ set(COMMON_SHARED_SRC DriverContext.cc) # But this exposes several problems with hipcc and build system on windows. # While those are fixed, this hack should allow us to pass windows CI. set(TEST_SRC - malloc.cc - hipMemsetBasic.cc hipMemcpy2DToArray.cc hipMemcpy2DToArray_old.cc hipMemcpy2DToArrayAsync.cc @@ -38,7 +20,6 @@ set(TEST_SRC hipMemcpy3DAsync.cc hipMemcpy3DAsync_old.cc hipMemcpyParam2D.cc - hipMemcpyParam2D_old.cc hipMemcpyParam2DAsync.cc hipMemcpyParam2DAsync_old.cc hipMemcpy2D.cc @@ -167,7 +148,6 @@ set(TEST_SRC hipMemPoolTrimTo.cc hipMallocFromPoolAsync.cc hipMemcpyPeer.cc - hipMemcpyPeer_old.cc hipMemcpyPeerAsync.cc hipMemcpyPeerAsync_old.cc hipMemcpyWithStream_old.cc @@ -210,7 +190,6 @@ set(TEST_SRC hipFreeHost.cc hipMallocAsync.cc hipStreamAttachMemAsync.cc - hipMemRangeGetAttributes_old.cc hipMemGetAddressRange.cc hipMallocMipmappedArray.cc hipFreeMipmappedArray.cc @@ -271,17 +250,17 @@ hip_add_exe_to_target(NAME MemoryTest2 TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC}) if(HIP_PLATFORM MATCHES "amd") -set(TEST_SRC + set(TEST_SRC inlineVar.cc memoryCommon.cc ) -#hip_add_exe_to_target(NAME InlineVarTest -# TEST_SRC ${TEST_SRC} -# TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC}) -# -# set_target_properties(InlineVarTest PROPERTIES COMPILE_FLAGS -fgpu-rdc) -# set_target_properties(InlineVarTest PROPERTIES LINK_FLAGS -fgpu-rdc) + #hip_add_exe_to_target(NAME InlineVarTest + # TEST_SRC ${TEST_SRC} + # TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC}) + # + # set_target_properties(InlineVarTest PROPERTIES COMPILE_FLAGS -fgpu-rdc) + # set_target_properties(InlineVarTest PROPERTIES LINK_FLAGS -fgpu-rdc) endif() set(TEST_SRC @@ -295,8 +274,11 @@ hip_add_exe_to_target(NAME SVMAtomicTest TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests COMMON_SHARED_SRC ${COMMON_SHARED_SRC}) +target_link_libraries(SVMAtomicTest hip::host hip::device) +target_link_libraries(MemoryTest1 hip::host hip::device) +target_link_libraries(MemoryTest2 hip::host hip::device) if(HIP_PLATFORM MATCHES "nvidia") - set_target_properties(SVMAtomicTest PROPERTIES COMPILE_FLAGS -arch=sm_70) - set_target_properties(MemoryTest1 PROPERTIES COMPILE_FLAGS -arch=sm_70) - set_target_properties(MemoryTest2 PROPERTIES COMPILE_FLAGS -arch=sm_70) + set_target_properties(SVMAtomicTest PROPERTIES COMPILE_FLAGS -arch=compute_75) + set_target_properties(MemoryTest1 PROPERTIES COMPILE_FLAGS -arch=compute_75) + set_target_properties(MemoryTest2 PROPERTIES COMPILE_FLAGS -arch=compute_75) endif() diff --git a/catch/unit/memory/DriverContext.cc b/catch/unit/memory/DriverContext.cc index dc27a6200..313aed5a3 100644 --- a/catch/unit/memory/DriverContext.cc +++ b/catch/unit/memory/DriverContext.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "DriverContext.hh" #include diff --git a/catch/unit/memory/DriverContext.hh b/catch/unit/memory/DriverContext.hh index 24a84dcd3..cf2539d7f 100644 --- a/catch/unit/memory/DriverContext.hh +++ b/catch/unit/memory/DriverContext.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #include diff --git a/catch/unit/memory/MemUtils.hh b/catch/unit/memory/MemUtils.hh index b80343d00..2b1133c5c 100644 --- a/catch/unit/memory/MemUtils.hh +++ b/catch/unit/memory/MemUtils.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #include diff --git a/catch/unit/memory/array_memcpy_tests_common.hh b/catch/unit/memory/array_memcpy_tests_common.hh index 0e33413ea..ac456d7a6 100644 --- a/catch/unit/memory/array_memcpy_tests_common.hh +++ b/catch/unit/memory/array_memcpy_tests_common.hh @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/memory/hipArray.cc b/catch/unit/memory/hipArray.cc index 54f6c6bd5..2c6d3c00f 100644 --- a/catch/unit/memory/hipArray.cc +++ b/catch/unit/memory/hipArray.cc @@ -1,23 +1,11 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include -TEST_CASE("Unit_hipArray_Valid") { +TEST_CASE(Unit_hipArray_Valid) { CHECK_IMAGE_SUPPORT hipArray_t array = nullptr; @@ -30,7 +18,7 @@ TEST_CASE("Unit_hipArray_Valid") { HIP_CHECK(hipFreeArray(array)); } -TEST_CASE("Unit_hipArray_Invalid") { +TEST_CASE(Unit_hipArray_Invalid) { CHECK_IMAGE_SUPPORT void* data = malloc(sizeof(char)); @@ -38,13 +26,13 @@ TEST_CASE("Unit_hipArray_Invalid") { REQUIRE(hipFreeArray(arrayPtr) == hipErrorContextIsDestroyed); free(data); } -TEST_CASE("Unit_hipArray_Nullptr") { +TEST_CASE(Unit_hipArray_Nullptr) { CHECK_IMAGE_SUPPORT hipArray_t array = nullptr; REQUIRE(hipFreeArray(array) == hipErrorInvalidValue); } -TEST_CASE("Unit_hipArray_DoubleFree") { +TEST_CASE(Unit_hipArray_DoubleFree) { CHECK_IMAGE_SUPPORT hipArray_t array = nullptr; @@ -57,7 +45,7 @@ TEST_CASE("Unit_hipArray_DoubleFree") { HIP_CHECK(hipFreeArray(array)); REQUIRE(hipFreeArray(array) == hipErrorContextIsDestroyed); } -TEST_CASE("Unit_hipArray_TrippleDestroy") { +TEST_CASE(Unit_hipArray_TrippleDestroy) { CHECK_IMAGE_SUPPORT hipArray_t array = nullptr; @@ -71,14 +59,14 @@ TEST_CASE("Unit_hipArray_TrippleDestroy") { REQUIRE(hipArrayDestroy(array) == hipErrorContextIsDestroyed); REQUIRE(hipArrayDestroy(array) == hipErrorContextIsDestroyed); } -TEST_CASE("Unit_hipArray_DoubleNullptr") { +TEST_CASE(Unit_hipArray_DoubleNullptr) { CHECK_IMAGE_SUPPORT hipArray_t array = nullptr; REQUIRE(hipFreeArray(array) == hipErrorInvalidValue); REQUIRE(hipFreeArray(array) == hipErrorInvalidValue); } -TEST_CASE("Unit_hipArray_DoubleInvalid") { +TEST_CASE(Unit_hipArray_DoubleInvalid) { CHECK_IMAGE_SUPPORT void* data = malloc(sizeof(char)); diff --git a/catch/unit/memory/hipArray3DCreate.cc b/catch/unit/memory/hipArray3DCreate.cc index 978009f68..716630d3d 100644 --- a/catch/unit/memory/hipArray3DCreate.cc +++ b/catch/unit/memory/hipArray3DCreate.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "DriverContext.hh" @@ -48,7 +35,7 @@ void testInvalidDescription(HIP_ARRAY3D_DESCRIPTOR desc) { } } // namespace -TEMPLATE_TEST_CASE("Unit_hipArray3DCreate_happy", "", char, uchar2, uint2, int4, short4, float, +TEMPLATE_TEST_CASE(Unit_hipArray3DCreate_happy, char, uchar2, uint2, int4, short4, float, float2, float4) { CHECK_IMAGE_SUPPORT @@ -88,7 +75,7 @@ TEMPLATE_TEST_CASE("Unit_hipArray3DCreate_happy", "", char, uchar2, uint2, int4, } } -TEMPLATE_TEST_CASE("Unit_hipArray3DCreate_MaxTexture", "", int, uint4, short, ushort2, +TEMPLATE_TEST_CASE(Unit_hipArray3DCreate_MaxTexture, int, uint4, short, ushort2, unsigned char, float, float4) { CHECK_IMAGE_SUPPORT @@ -210,7 +197,7 @@ constexpr HIP_ARRAY3D_DESCRIPTOR defaultDescriptor(unsigned int flags, size_t si } // Providing the array pointer as nullptr should return an error -TEST_CASE("Unit_hipArray3DCreate_Negative_NullArrayPtr") { +TEST_CASE(Unit_hipArray3DCreate_Negative_NullArrayPtr) { CHECK_IMAGE_SUPPORT auto desc = defaultDescriptor(0, 64); @@ -220,7 +207,7 @@ TEST_CASE("Unit_hipArray3DCreate_Negative_NullArrayPtr") { } // Providing the description pointer as nullptr should return an error -TEST_CASE("Unit_hipArray3DCreate_Negative_NullDescPtr") { +TEST_CASE(Unit_hipArray3DCreate_Negative_NullDescPtr) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -230,7 +217,7 @@ TEST_CASE("Unit_hipArray3DCreate_Negative_NullDescPtr") { // Zero width arrays are not allowed -TEST_CASE("Unit_hipArray3DCreate_Negative_ZeroWidth") { +TEST_CASE(Unit_hipArray3DCreate_Negative_ZeroWidth) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -244,7 +231,7 @@ TEST_CASE("Unit_hipArray3DCreate_Negative_ZeroWidth") { } // Zero height arrays are only allowed for 1D arrays and layered arrays -TEST_CASE("Unit_hipArray3DCreate_Negative_ZeroHeight") { +TEST_CASE(Unit_hipArray3DCreate_Negative_ZeroHeight) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -266,7 +253,7 @@ TEST_CASE("Unit_hipArray3DCreate_Negative_ZeroHeight") { } // Arrays must be created with a valid data format -TEST_CASE("Unit_hipArray3DCreate_Negative_InvalidFormat") { +TEST_CASE(Unit_hipArray3DCreate_Negative_InvalidFormat) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -282,7 +269,7 @@ TEST_CASE("Unit_hipArray3DCreate_Negative_InvalidFormat") { } // An array must have either 1,2, or 4 channels -TEST_CASE("Unit_hipArray3DCreate_Negative_NumChannels") { +TEST_CASE(Unit_hipArray3DCreate_Negative_NumChannels) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -294,7 +281,7 @@ TEST_CASE("Unit_hipArray3DCreate_Negative_NumChannels") { } // Using invalid flags should result in an error -TEST_CASE("Unit_hipArray3DCreate_Negative_InvalidFlags") { +TEST_CASE(Unit_hipArray3DCreate_Negative_InvalidFlags) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -321,7 +308,7 @@ TEST_CASE("Unit_hipArray3DCreate_Negative_InvalidFlags") { // hipArray3DCreate should handle the max numeric value gracefully. -TEST_CASE("Unit_hipArray3DCreate_Negative_NumericLimit") { +TEST_CASE(Unit_hipArray3DCreate_Negative_NumericLimit) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -333,7 +320,7 @@ TEST_CASE("Unit_hipArray3DCreate_Negative_NumericLimit") { } // texture gather arrays may only be 2D -TEMPLATE_TEST_CASE("Unit_hipArray3DCreate_Negative_Non2DTextureGather", "", char, uint2, int4, +TEMPLATE_TEST_CASE(Unit_hipArray3DCreate_Negative_Non2DTextureGather, char, uint2, int4, float2, float4) { CHECK_IMAGE_SUPPORT diff --git a/catch/unit/memory/hipArray3DGetDescriptor.cc b/catch/unit/memory/hipArray3DGetDescriptor.cc index ebbce4804..3a18a28c7 100644 --- a/catch/unit/memory/hipArray3DGetDescriptor.cc +++ b/catch/unit/memory/hipArray3DGetDescriptor.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipArray3DGetDescriptor hipArray3DGetDescriptor @@ -42,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipArray3DGetDescriptor_Positive_Basic") { +TEST_CASE(Unit_hipArray3DGetDescriptor_Positive_Basic) { CHECK_IMAGE_SUPPORT DrvArrayAllocGuard array(make_hipExtent(1024, 4, 2)); @@ -69,7 +53,7 @@ TEST_CASE("Unit_hipArray3DGetDescriptor_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipArray3DGetDescriptor_Negative_Parameters") { +TEST_CASE(Unit_hipArray3DGetDescriptor_Negative_Parameters) { CHECK_IMAGE_SUPPORT DrvArrayAllocGuard array(make_hipExtent(1024, 4, 2)); diff --git a/catch/unit/memory/hipArrayCommon.hh b/catch/unit/memory/hipArrayCommon.hh index 685072277..f78912429 100644 --- a/catch/unit/memory/hipArrayCommon.hh +++ b/catch/unit/memory/hipArrayCommon.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/memory/hipArrayCreate.cc b/catch/unit/memory/hipArrayCreate.cc index 85a1fd607..d4ba8d81b 100644 --- a/catch/unit/memory/hipArrayCreate.cc +++ b/catch/unit/memory/hipArrayCreate.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* hipArrayCreate API test scenarios @@ -73,7 +60,7 @@ static void ArrayCreate_DiffSizes(int gpu) { } /* This testcase verifies hipArrayCreate API for small and big chunks data*/ -TEST_CASE("Unit_hipArrayCreate_DiffSizes") { +TEST_CASE(Unit_hipArrayCreate_DiffSizes) { CHECK_IMAGE_SUPPORT ArrayCreate_DiffSizes(0); @@ -85,7 +72,7 @@ This testcase verifies the hipArrayCreate API in multithreaded scenario by launching threads in parallel on multiple GPUs and verifies the hipArrayCreate API with small and big chunks data */ -TEST_CASE("Unit_hipArrayCreate_MultiThread", "[multigpu]") { +TEST_CASE(Unit_hipArrayCreate_MultiThread) { CHECK_IMAGE_SUPPORT std::vector threadlist; @@ -200,7 +187,7 @@ void testArrayAsTexture(hipArray_t array, const size_t width, const size_t heigh // Selection of types chosen since trying all types would be slow to compile // Test the happy path of the hipArrayCreate -TEMPLATE_TEST_CASE("Unit_hipArrayCreate_happy", "", uint, int, int4, ushort, short2, char, uchar2, +TEMPLATE_TEST_CASE(Unit_hipArrayCreate_happy, uint, int, int4, ushort, short2, char, uchar2, char4, float, float2, float4) { CHECK_IMAGE_SUPPORT @@ -225,7 +212,7 @@ TEMPLATE_TEST_CASE("Unit_hipArrayCreate_happy", "", uint, int, int4, ushort, sho // Only widths and Heights up to the maxTexture size is supported -TEMPLATE_TEST_CASE("Unit_hipArrayCreate_maxTexture", "", uint, int, int4, ushort, short2, char, +TEMPLATE_TEST_CASE(Unit_hipArrayCreate_maxTexture, uint, int, int4, ushort, short2, char, uchar2, char4, float, float2, float4) { CHECK_IMAGE_SUPPORT @@ -286,7 +273,7 @@ TEMPLATE_TEST_CASE("Unit_hipArrayCreate_maxTexture", "", uint, int, int4, ushort } // zero-width array is not supported -TEST_CASE("Unit_hipArrayCreate_ZeroWidth") { +TEST_CASE(Unit_hipArrayCreate_ZeroWidth) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -302,7 +289,7 @@ TEST_CASE("Unit_hipArrayCreate_ZeroWidth") { } // HipArrayCreate will return an error when nullptr is used as the array argument -TEST_CASE("Unit_hipArrayCreate_Nullptr") { +TEST_CASE(Unit_hipArrayCreate_Nullptr) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -322,7 +309,7 @@ TEST_CASE("Unit_hipArrayCreate_Nullptr") { } // Only elements with 1,2, or 4 channels is supported -TEST_CASE("Unit_hipArrayCreate_BadNumberChannelElement") { +TEST_CASE(Unit_hipArrayCreate_BadNumberChannelElement) { CHECK_IMAGE_SUPPORT DriverContext ctx; @@ -340,7 +327,7 @@ TEST_CASE("Unit_hipArrayCreate_BadNumberChannelElement") { } // Only certain channel formats are acceptable. -TEST_CASE("Unit_hipArrayCreate_BadChannelFormat") { +TEST_CASE(Unit_hipArrayCreate_BadChannelFormat) { CHECK_IMAGE_SUPPORT DriverContext ctx; diff --git a/catch/unit/memory/hipArrayGetDescriptor.cc b/catch/unit/memory/hipArrayGetDescriptor.cc index 130bcdf5b..d7998db22 100644 --- a/catch/unit/memory/hipArrayGetDescriptor.cc +++ b/catch/unit/memory/hipArrayGetDescriptor.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -233,7 +220,7 @@ float* funcToChkArray(hipArray_t array) { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipArrayGetDescriptor_1D_2D_ArrayParameterChk", "[multigpu]") { +TEST_CASE(Unit_hipArrayGetDescriptor_1D_2D_ArrayParameterChk) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -318,8 +305,7 @@ TEST_CASE("Unit_hipArrayGetDescriptor_1D_2D_ArrayParameterChk", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipArrayGetDescriptor_MultiThreadScenarioFor1D_2D_Array", - "[multigpu]") { +TEST_CASE(Unit_hipArrayGetDescriptor_MultiThreadScenarioFor1D_2D_Array) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -369,7 +355,7 @@ TEST_CASE("Unit_hipArrayGetDescriptor_MultiThreadScenarioFor1D_2D_Array", * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipArrayGetDescriptor_Host2Array_Array2Host", "[multigpu]") { +TEST_CASE(Unit_hipArrayGetDescriptor_Host2Array_Array2Host) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -439,7 +425,7 @@ TEST_CASE("Unit_hipArrayGetDescriptor_Host2Array_Array2Host", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipArrayGetDescriptor_Negative_Scenarios") { +TEST_CASE(Unit_hipArrayGetDescriptor_Negative_Scenarios) { hipError_t error; HIP_ARRAY_DESCRIPTOR desc_Neg; SECTION("Array Address As Nullptr") { @@ -477,7 +463,7 @@ TEST_CASE("Unit_hipArrayGetDescriptor_Negative_Scenarios") { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipArrayGetDescriptor_Positive_Basic") { +TEST_CASE(Unit_hipArrayGetDescriptor_Positive_Basic) { CHECK_IMAGE_SUPPORT HIP_ARRAY_DESCRIPTOR expected_desc{}; @@ -512,7 +498,7 @@ TEST_CASE("Unit_hipArrayGetDescriptor_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipArrayGetDescriptor_Negative_Parameters") { +TEST_CASE(Unit_hipArrayGetDescriptor_Negative_Parameters) { CHECK_IMAGE_SUPPORT HIP_ARRAY_DESCRIPTOR expected_desc{}; diff --git a/catch/unit/memory/hipArrayGetInfo.cc b/catch/unit/memory/hipArrayGetInfo.cc index 8dcfcf574..f8cd3eefc 100644 --- a/catch/unit/memory/hipArrayGetInfo.cc +++ b/catch/unit/memory/hipArrayGetInfo.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipArrayGetInfo hipArrayGetInfo @@ -42,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipArrayGetInfo_Positive_Basic") { +TEST_CASE(Unit_hipArrayGetInfo_Positive_Basic) { CHECK_IMAGE_SUPPORT ArrayAllocGuard array(make_hipExtent(1024, 4, 2)); @@ -78,7 +62,7 @@ TEST_CASE("Unit_hipArrayGetInfo_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipArrayGetInfo_Negative_Parameters") { +TEST_CASE(Unit_hipArrayGetInfo_Negative_Parameters) { CHECK_IMAGE_SUPPORT ArrayAllocGuard array(make_hipExtent(1024, 4, 4)); diff --git a/catch/unit/memory/hipDeviceGetMemPool.cc b/catch/unit/memory/hipDeviceGetMemPool.cc index d1a62ba33..2714cb7fe 100644 --- a/catch/unit/memory/hipDeviceGetMemPool.cc +++ b/catch/unit/memory/hipDeviceGetMemPool.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipDeviceGetMemPool hipDeviceGetMemPool @@ -73,7 +57,7 @@ static bool checkMallocAsync() { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipDeviceGetMemPool_Basic") { +TEST_CASE(Unit_hipDeviceGetMemPool_Basic) { checkMempoolSupported(0) hipMemPool_t mem_pool_device = nullptr, mem_pool_default = nullptr; SECTION("Check current mempool is default mempool") { // assign default mem pool to device @@ -113,7 +97,7 @@ TEST_CASE("Unit_hipDeviceGetMemPool_Basic") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipDeviceGetMemPool_Functional") { +TEST_CASE(Unit_hipDeviceGetMemPool_Functional) { hipMemPool_t mem_pool = nullptr; checkMempoolSupported(0) // assign current mem pool to device @@ -137,7 +121,7 @@ TEST_CASE("Unit_hipDeviceGetMemPool_Functional") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipDeviceGetMemPool_Multidevice", "[multigpu]") { +TEST_CASE(Unit_hipDeviceGetMemPool_Multidevice) { int num_devices; HIP_CHECK(hipGetDeviceCount(&num_devices)); @@ -165,7 +149,7 @@ TEST_CASE("Unit_hipDeviceGetMemPool_Multidevice", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipDeviceGetDefaultMemPool_Functional") { +TEST_CASE(Unit_hipDeviceGetDefaultMemPool_Functional) { hipMemPool_t mem_pool = nullptr; checkMempoolSupported(0) // assign current mem pool to device diff --git a/catch/unit/memory/hipDeviceSetMemPool.cc b/catch/unit/memory/hipDeviceSetMemPool.cc index 689bdf848..d19071b00 100644 --- a/catch/unit/memory/hipDeviceSetMemPool.cc +++ b/catch/unit/memory/hipDeviceSetMemPool.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipDeviceSetMemPool hipDeviceSetMemPool @@ -74,7 +58,7 @@ static bool checkMallocAsync() { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipDeviceSetMemPool_Basic") { +TEST_CASE(Unit_hipDeviceSetMemPool_Basic) { int num_devices; HIP_CHECK(hipGetDeviceCount(&num_devices)); for (int dev = 0; dev < num_devices; dev++) { @@ -108,7 +92,7 @@ TEST_CASE("Unit_hipDeviceSetMemPool_Basic") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipDeviceSetMemPool_DestroyCurrentMempool", "[multigpu]") { +TEST_CASE(Unit_hipDeviceSetMemPool_DestroyCurrentMempool) { int num_devices; HIP_CHECK(hipGetDeviceCount(&num_devices)); for (int dev = 0; dev < num_devices; dev++) { @@ -144,7 +128,7 @@ TEST_CASE("Unit_hipDeviceSetMemPool_DestroyCurrentMempool", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipDeviceSetMemPool_functional") { +TEST_CASE(Unit_hipDeviceSetMemPool_functional) { checkMempoolSupported(0) hipMemPool_t mem_pool = nullptr; // create explicit mem pool hipMemPoolProps PoolProps{}; @@ -171,7 +155,7 @@ TEST_CASE("Unit_hipDeviceSetMemPool_functional") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipDeviceSetMemPool_functionalAttribute") { +TEST_CASE(Unit_hipDeviceSetMemPool_functionalAttribute) { checkMempoolSupported(0) hipMemPool_t mem_pool = nullptr; // create explicit mem pool hipMemPoolProps PoolProps{}; diff --git a/catch/unit/memory/hipDrvMemcpy2DUnaligned.cc b/catch/unit/memory/hipDrvMemcpy2DUnaligned.cc index abf470a7a..671807554 100644 --- a/catch/unit/memory/hipDrvMemcpy2DUnaligned.cc +++ b/catch/unit/memory/hipDrvMemcpy2DUnaligned.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -41,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy2DUnaligned_NegTst") { +TEST_CASE(Unit_hipDrvMemcpy2DUnaligned_NegTst) { // declare host and device arrays int rows, cols; rows = GENERATE(3, 4, 100); @@ -183,7 +170,7 @@ TEST_CASE("Unit_hipDrvMemcpy2DUnaligned_NegTst") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy2DUnaligned_FuncTst") { +TEST_CASE(Unit_hipDrvMemcpy2DUnaligned_FuncTst) { SECTION( "Different types of memory transfers functional tests to check if\ copied array contains correct values") { @@ -269,7 +256,7 @@ TEST_CASE("Unit_hipDrvMemcpy2DUnaligned_FuncTst") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy2DUnaligned_Positive_Basic", "[multigpu]") { +TEST_CASE(Unit_hipDrvMemcpy2DUnaligned_Positive_Basic) { CHECK_IMAGE_SUPPORT SECTION("Device to Device") { @@ -298,7 +285,7 @@ TEST_CASE("Unit_hipDrvMemcpy2DUnaligned_Positive_Basic", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy2DUnaligned_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipDrvMemcpy2DUnaligned_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT HIP_CHECK(hipDeviceSynchronize()); @@ -325,6 +312,6 @@ TEST_CASE("Unit_hipDrvMemcpy2DUnaligned_Positive_Synchronization_Behavior") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy2DUnaligned_Positive_Parameters") { +TEST_CASE(Unit_hipDrvMemcpy2DUnaligned_Positive_Parameters) { Memcpy2DZeroWidthHeight(DrvMemcpy2DUnalignedAdapter()); } diff --git a/catch/unit/memory/hipDrvMemcpy3D.cc b/catch/unit/memory/hipDrvMemcpy3D.cc index 6fb49d664..e4ece2f2e 100644 --- a/catch/unit/memory/hipDrvMemcpy3D.cc +++ b/catch/unit/memory/hipDrvMemcpy3D.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -28,7 +12,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipDrvMemcpy3D_Positive_Basic") { +TEST_CASE(Unit_hipDrvMemcpy3D_Positive_Basic) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -53,7 +37,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_Positive_Basic") { #endif } -TEST_CASE("Unit_hipDrvMemcpy3D_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipDrvMemcpy3D_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT HIP_CHECK(hipDeviceSynchronize()); @@ -71,7 +55,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_Positive_Synchronization_Behavior") { SECTION("Host to Host") { Memcpy3DHtoHSyncBehavior(DrvMemcpy3DWrapper<>, true); } } -TEST_CASE("Unit_hipDrvMemcpy3D_Positive_Parameters") { +TEST_CASE(Unit_hipDrvMemcpy3D_Positive_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -79,7 +63,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_Positive_Parameters") { } // Disabled on AMD due to defect - EXSWHTEC-238 -TEST_CASE("Unit_hipDrvMemcpy3D_Positive_Array") { +TEST_CASE(Unit_hipDrvMemcpy3D_Positive_Array) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -87,7 +71,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_Positive_Array") { SECTION("Array from/to Device") { DrvMemcpy3DArrayDeviceShell(DrvMemcpy3DWrapper<>); } } -TEST_CASE("Unit_hipDrvMemcpy3D_Negative_Parameters") { +TEST_CASE(Unit_hipDrvMemcpy3D_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr hipExtent extent{128 * sizeof(int), 128, 8}; @@ -226,7 +210,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_Negative_Parameters") { } } -TEST_CASE("Unit_hipDrvMemcpy3D_Capture") { +TEST_CASE(Unit_hipDrvMemcpy3D_Capture) { CHECK_IMAGE_SUPPORT constexpr hipExtent extent{128 * sizeof(int), 128, 8}; diff --git a/catch/unit/memory/hipDrvMemcpy3DAsync.cc b/catch/unit/memory/hipDrvMemcpy3DAsync.cc index eb490f605..39340c6e8 100644 --- a/catch/unit/memory/hipDrvMemcpy3DAsync.cc +++ b/catch/unit/memory/hipDrvMemcpy3DAsync.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -28,7 +12,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipDrvMemcpy3DAsync_Positive_Basic") { +TEST_CASE(Unit_hipDrvMemcpy3DAsync_Positive_Basic) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -57,7 +41,7 @@ TEST_CASE("Unit_hipDrvMemcpy3DAsync_Positive_Basic") { #endif } -TEST_CASE("Unit_hipDrvMemcpy3DAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipDrvMemcpy3DAsync_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -85,7 +69,7 @@ TEST_CASE("Unit_hipDrvMemcpy3DAsync_Positive_Synchronization_Behavior") { #endif } -TEST_CASE("Unit_hipDrvMemcpy3DAsync_Positive_Parameters") { +TEST_CASE(Unit_hipDrvMemcpy3DAsync_Positive_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -93,7 +77,7 @@ TEST_CASE("Unit_hipDrvMemcpy3DAsync_Positive_Parameters") { } // Disabled on AMD due to defect - EXSWHTEC-238 -TEST_CASE("Unit_hipDrvMemcpy3DAsync_Positive_Array") { +TEST_CASE(Unit_hipDrvMemcpy3DAsync_Positive_Array) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -101,7 +85,7 @@ TEST_CASE("Unit_hipDrvMemcpy3DAsync_Positive_Array") { SECTION("Array from/to Device") { DrvMemcpy3DArrayDeviceShell(DrvMemcpy3DWrapper); } } -TEST_CASE("Unit_hipDrvMemcpy3DAsync_Negative_Parameters") { +TEST_CASE(Unit_hipDrvMemcpy3DAsync_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -253,7 +237,7 @@ TEST_CASE("Unit_hipDrvMemcpy3DAsync_Negative_Parameters") { } } -TEST_CASE("Unit_hipDrvMemcpy3DAsync_Capture") { +TEST_CASE(Unit_hipDrvMemcpy3DAsync_Capture) { CHECK_IMAGE_SUPPORT constexpr hipExtent kExtent{128 * sizeof(int), 128, 8}; diff --git a/catch/unit/memory/hipDrvMemcpy3DAsync_old.cc b/catch/unit/memory/hipDrvMemcpy3DAsync_old.cc index 768dd1008..2681ba785 100644 --- a/catch/unit/memory/hipDrvMemcpy3DAsync_old.cc +++ b/catch/unit/memory/hipDrvMemcpy3DAsync_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipDrvMemcpy3DAsync hipDrvMemcpy3DAsync @@ -445,89 +432,6 @@ template void DrvMemcpy3DAsync::DeAllocateMemory() { free(hData); } -/** - * Test Description - * ------------------------ - * - Verifying hipDrvMemcpy3DAsync API Host to Array for different datatypes - * Test source - * ------------------------ - * - unit/memory/hipDrvMemcpy3DAsync_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEMPLATE_TEST_CASE("Unit_hipDrvMemcpy3DAsync_MultipleDataTypes", "", uint8_t, int, float) { - CHECK_IMAGE_SUPPORT - for (int i = 1; i < 25; i++) { - if (std::is_same::value) { - DrvMemcpy3DAsync memcpy3d_float(i, i, i, HIP_AD_FORMAT_FLOAT); - memcpy3d_float.HostArray_DrvMemcpy3DAsync(); - } else if (std::is_same::value) { - DrvMemcpy3DAsync memcpy3d_intx(i, i, i, HIP_AD_FORMAT_UNSIGNED_INT8); - memcpy3d_intx.HostArray_DrvMemcpy3DAsync(); - } else if (std::is_same::value) { - DrvMemcpy3DAsync memcpy3d_inty(i, i, i, HIP_AD_FORMAT_SIGNED_INT32); - memcpy3d_inty.HostArray_DrvMemcpy3DAsync(); - } - } -} - -/** - * Test Description - * ------------------------ - * - This testcase verifies H2D copy of hipDrvMemcpy3DAsync API - * Test source - * ------------------------ - * - unit/memory/hipDrvMemcpy3DAsync_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEST_CASE("Unit_hipDrvMemcpy3DAsync_HosttoDevice") { - CHECK_IMAGE_SUPPORT - DrvMemcpy3DAsync memcpy3d_D2H_float(10, 10, 1, HIP_AD_FORMAT_FLOAT); - memcpy3d_D2H_float.HostDevice_DrvMemcpy3DAsync(); -} - -/** - * Test Description - * ------------------------ - * - This testcase verifies negative scenarios of hipDrvMemcpy3DAsync API - * Test source - * ------------------------ - * - unit/memory/hipDrvMemcpy3DAsync_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -#if HT_NVIDIA -TEST_CASE("Unit_hipDrvMemcpy3DAsync_Negative") { - DrvMemcpy3DAsync memcpy3d(10, 10, 1, HIP_AD_FORMAT_FLOAT); - memcpy3d.NegativeTests(); -} -#endif - -/** - * Test Description - * ------------------------ - * - This testcase verifies extent validation scenarios of - hipDrvMemcpy3DAsync API - * Test source - * ------------------------ - * - unit/memory/hipDrvMemcpy3DAsync_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEST_CASE("Unit_hipDrvMemcpy3DAsync_ExtentValidation") { - CHECK_IMAGE_SUPPORT - DrvMemcpy3DAsync memcpy3d(10, 10, 1, HIP_AD_FORMAT_FLOAT); - memcpy3d.Extent_Validation(); -} /** * Test Description @@ -542,7 +446,7 @@ TEST_CASE("Unit_hipDrvMemcpy3DAsync_ExtentValidation") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy3DAsync_H2DDeviceContextChange", "[multigpu]") { +TEST_CASE(Unit_hipDrvMemcpy3DAsync_H2DDeviceContextChange) { CHECK_IMAGE_SUPPORT int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -567,8 +471,7 @@ TEST_CASE("Unit_hipDrvMemcpy3DAsync_H2DDeviceContextChange", "[multigpu]") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy3DAsync_Host2ArrayDeviceContextChange", - "[multigpu]") { +TEST_CASE(Unit_hipDrvMemcpy3DAsync_Host2ArrayDeviceContextChange) { CHECK_IMAGE_SUPPORT int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -596,8 +499,7 @@ TEST_CASE("Unit_hipDrvMemcpy3DAsync_Host2ArrayDeviceContextChange", * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy3DAsync_multiDevice_Basic_Size_Test", - "[multigpu]") { +TEST_CASE(Unit_hipDrvMemcpy3DAsync_multiDevice_Basic_Size_Test) { CHECK_IMAGE_SUPPORT constexpr int size_128b = 128, size_256b = 256; int numDevices = 0; diff --git a/catch/unit/memory/hipDrvMemcpy3D_old.cc b/catch/unit/memory/hipDrvMemcpy3D_old.cc index d27e32b28..cff79c665 100644 --- a/catch/unit/memory/hipDrvMemcpy3D_old.cc +++ b/catch/unit/memory/hipDrvMemcpy3D_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipDrvMemcpy3D hipDrvMemcpy3D @@ -440,7 +427,7 @@ template void DrvMemcpy3D::DeAllocateMemory() { * - HIP_VERSION >= 6.0 */ -TEMPLATE_TEST_CASE("Unit_hipDrvMemcpy3D_MultipleDataTypes", "", uint8_t, int, float) { +TEMPLATE_TEST_CASE(Unit_hipDrvMemcpy3D_MultipleDataTypes, uint8_t, int, float) { CHECK_IMAGE_SUPPORT for (int i = 1; i < 25; i++) { if (std::is_same::value) { @@ -468,7 +455,7 @@ TEMPLATE_TEST_CASE("Unit_hipDrvMemcpy3D_MultipleDataTypes", "", uint8_t, int, fl * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy3D_HosttoDevice") { +TEST_CASE(Unit_hipDrvMemcpy3D_HosttoDevice) { CHECK_IMAGE_SUPPORT DrvMemcpy3D memcpy3d_D2H_float(10, 10, 1, HIP_AD_FORMAT_FLOAT); memcpy3d_D2H_float.HostDevice_DrvMemcpy3D(); @@ -487,7 +474,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_HosttoDevice") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy3D_Negative") { +TEST_CASE(Unit_hipDrvMemcpy3D_Negative) { DrvMemcpy3D memcpy3d(10, 10, 1, HIP_AD_FORMAT_FLOAT); memcpy3d.NegativeTests(); } @@ -505,7 +492,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_Negative") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy3D_ExtentValidation") { +TEST_CASE(Unit_hipDrvMemcpy3D_ExtentValidation) { CHECK_IMAGE_SUPPORT DrvMemcpy3D memcpy3d(10, 10, 1, HIP_AD_FORMAT_FLOAT); memcpy3d.Extent_Validation(); @@ -524,7 +511,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_ExtentValidation") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy3D_H2DDeviceContextChange", "[multigpu]") { +TEST_CASE(Unit_hipDrvMemcpy3D_H2DDeviceContextChange) { CHECK_IMAGE_SUPPORT int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -549,7 +536,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_H2DDeviceContextChange", "[multigpu]") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy3D_Host2ArrayDeviceContextChange", "[multigpu]") { +TEST_CASE(Unit_hipDrvMemcpy3D_Host2ArrayDeviceContextChange) { CHECK_IMAGE_SUPPORT int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -577,7 +564,7 @@ TEST_CASE("Unit_hipDrvMemcpy3D_Host2ArrayDeviceContextChange", "[multigpu]") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDrvMemcpy3D_multiDevice_Basic_Size_Test", "[multigpu]") { +TEST_CASE(Unit_hipDrvMemcpy3D_multiDevice_Basic_Size_Test) { CHECK_IMAGE_SUPPORT constexpr int size_128b = 128, size_256b = 256; int numDevices = 0; diff --git a/catch/unit/memory/hipDrvPtrGetAttributes.cc b/catch/unit/memory/hipDrvPtrGetAttributes.cc index 0c3740731..d0c769c9c 100644 --- a/catch/unit/memory/hipDrvPtrGetAttributes.cc +++ b/catch/unit/memory/hipDrvPtrGetAttributes.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* * Tests for hipDrvPointerGetAttributes API @@ -42,7 +26,7 @@ constexpr size_t N{1000000}; /* This testcase verifies Negative Scenarios of * hipDrvPointerGetAttributes API */ -TEST_CASE("Unit_hipDrvPtrGetAttributes_Negative") { +TEST_CASE(Unit_hipDrvPtrGetAttributes_Negative) { HIP_CHECK(hipSetDevice(0)); Nbytes = N * sizeof(int); int deviceId; @@ -97,7 +81,7 @@ TEST_CASE("Unit_hipDrvPtrGetAttributes_Negative") { } // Testcase verifies functional scenarios of hipDrvPointerGetAttributes API -TEST_CASE("Unit_hipDrvPtrGetAttributes_Functional") { +TEST_CASE(Unit_hipDrvPtrGetAttributes_Functional) { HIP_CHECK(hipSetDevice(0)); Nbytes = N * sizeof(int); int deviceId; diff --git a/catch/unit/memory/hipExtMallocWithFlags.cc b/catch/unit/memory/hipExtMallocWithFlags.cc index 874325428..a859ed8d6 100644 --- a/catch/unit/memory/hipExtMallocWithFlags.cc +++ b/catch/unit/memory/hipExtMallocWithFlags.cc @@ -1,30 +1,14 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include #include -TEST_CASE("Unit_hipExtMallocWithFlags_Positive_Basic") { +TEST_CASE(Unit_hipExtMallocWithFlags_Positive_Basic) { void* ptr = nullptr; SECTION("hipDeviceMallocDefault") { @@ -56,14 +40,14 @@ TEST_CASE("Unit_hipExtMallocWithFlags_Positive_Basic") { } } -TEST_CASE("Unit_hipExtMallocWithFlags_Positive_Zero_Size") { +TEST_CASE(Unit_hipExtMallocWithFlags_Positive_Zero_Size) { void* ptr = reinterpret_cast(0x1); const auto flag = GENERATE(hipDeviceMallocDefault, hipDeviceMallocFinegrained); HIP_CHECK(hipExtMallocWithFlags(&ptr, 0, flag)); REQUIRE(ptr == nullptr); } -TEST_CASE("Unit_hipExtMallocWithFlags_Positive_Alignment") { +TEST_CASE(Unit_hipExtMallocWithFlags_Positive_Alignment) { void *ptr1 = nullptr, *ptr2 = nullptr; const auto flag = GENERATE(hipDeviceMallocDefault, hipDeviceMallocFinegrained); if (flag == hipDeviceMallocFinegrained && @@ -79,7 +63,7 @@ TEST_CASE("Unit_hipExtMallocWithFlags_Positive_Alignment") { HIP_CHECK(hipFree(ptr2)); } -TEST_CASE("Unit_hipExtMallocWithFlags_Negative_Parameters") { +TEST_CASE(Unit_hipExtMallocWithFlags_Negative_Parameters) { SECTION("Invalid flags") { void* ptr = nullptr; HIP_CHECK_ERROR( diff --git a/catch/unit/memory/hipFree.cc b/catch/unit/memory/hipFree.cc index 3e205f498..22d279ceb 100644 --- a/catch/unit/memory/hipFree.cc +++ b/catch/unit/memory/hipFree.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ enum class FreeType { DevFree, ArrayFree, ArrayDestroy, HostFree }; using namespace std::chrono_literals; constexpr size_t numAllocs = 10; -TEST_CASE("Unit_hipFreeImplicitSyncDev") { +TEST_CASE(Unit_hipFreeImplicitSyncDev) { int* devPtr{}; size_t size_mult = GENERATE(1, 32, 64, 128, 256); HIP_CHECK(hipMalloc(&devPtr, sizeof(*devPtr) * size_mult)); @@ -65,7 +49,7 @@ TEST_CASE("Unit_hipFreeImplicitSyncDev") { HIP_CHECK(hipStreamQuery(nullptr)); } -TEST_CASE("Unit_hipFreeImplicitSyncHost") { +TEST_CASE(Unit_hipFreeImplicitSyncHost) { int* hostPtr{}; size_t size_mult = GENERATE(1, 32, 64, 128, 256); @@ -84,7 +68,7 @@ TEST_CASE("Unit_hipFreeImplicitSyncHost") { } #if HT_NVIDIA -TEMPLATE_TEST_CASE("Unit_hipFreeImplicitSyncArray", "", char, float, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipFreeImplicitSyncArray, char, float, float2, float4) { CHECK_IMAGE_SUPPORT using vec_info = vector_info; @@ -124,7 +108,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeImplicitSyncArray", "", char, float, float2, flo } #else // AMD -TEMPLATE_TEST_CASE("Unit_hipFreeImplicitSyncArray", "", char, float, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipFreeImplicitSyncArray, char, float, float2, float4) { CHECK_IMAGE_SUPPORT hipArray_t arrayPtr{}; @@ -156,7 +140,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeImplicitSyncArray", "", char, float, float2, flo #endif // Freeing a invalid pointer with on device -TEST_CASE("Unit_hipFreeNegativeDev") { +TEST_CASE(Unit_hipFreeNegativeDev) { SECTION("InvalidPtr") { char value; HIP_CHECK_ERROR(hipFree(&value), hipErrorInvalidValue); @@ -165,7 +149,7 @@ TEST_CASE("Unit_hipFreeNegativeDev") { } // Freeing a invalid pointer with on host -TEST_CASE("Unit_hipFreeNegativeHost") { +TEST_CASE(Unit_hipFreeNegativeHost) { SECTION("NullPtr") { HIP_CHECK(hipHostFree(nullptr)); } SECTION("InvalidPtr") { char hostPtr; @@ -193,7 +177,7 @@ TEST_CASE("Unit_hipFreeNegativeHost") { } #if HT_NVIDIA -TEST_CASE("Unit_hipFreeNegativeArray") { +TEST_CASE(Unit_hipFreeNegativeArray) { DriverContext ctx; SECTION("ArrayFree") { HIP_CHECK(hipFreeArray(nullptr)); } @@ -204,14 +188,14 @@ TEST_CASE("Unit_hipFreeNegativeArray") { #else // Freeing a invalid pointer with array -TEST_CASE("Unit_hipFreeNegativeArray") { +TEST_CASE(Unit_hipFreeNegativeArray) { SECTION("ArrayFree") { HIP_CHECK_ERROR(hipFreeArray(nullptr), hipErrorInvalidValue); } SECTION("ArrayDestroy") { HIP_CHECK_ERROR(hipArrayDestroy(nullptr), hipErrorInvalidValue); } } #endif -TEST_CASE("Unit_hipFreeDoubleDevice") { +TEST_CASE(Unit_hipFreeDoubleDevice) { size_t width = GENERATE(32, 512, 1024); char* ptr{}; size_t size_mult = width; @@ -221,7 +205,7 @@ TEST_CASE("Unit_hipFreeDoubleDevice") { HIP_CHECK_ERROR(hipFree(ptr), hipErrorInvalidValue); } -TEST_CASE("Unit_hipFreeDoubleHost") { +TEST_CASE(Unit_hipFreeDoubleHost) { size_t width = GENERATE(32, 512, 1024); char* ptr{}; size_t size_mult = width; @@ -233,7 +217,7 @@ TEST_CASE("Unit_hipFreeDoubleHost") { } #if HT_NVIDIA -TEST_CASE("Unit_hipFreeDoubleArrayFree") { +TEST_CASE(Unit_hipFreeDoubleArrayFree) { HipTest::HIP_SKIP_TEST("EXSWCPHIPT-120"); return; @@ -251,7 +235,7 @@ TEST_CASE("Unit_hipFreeDoubleArrayFree") { HIP_CHECK_ERROR(hipFreeArray(arrayPtr), hipErrorContextIsDestroyed); } -TEST_CASE("Unit_hipFreeDoubleArrayDestroy") { +TEST_CASE(Unit_hipFreeDoubleArrayDestroy) { HipTest::HIP_SKIP_TEST("EXSWCPHIPT-120"); return; using vec_info = vector_info; @@ -273,7 +257,7 @@ TEST_CASE("Unit_hipFreeDoubleArrayDestroy") { #else // AMD -TEST_CASE("Unit_hipFreeDoubleArray") { +TEST_CASE(Unit_hipFreeDoubleArray) { CHECK_IMAGE_SUPPORT size_t width = GENERATE(32, 512, 1024); @@ -299,7 +283,7 @@ TEST_CASE("Unit_hipFreeDoubleArray") { #endif -TEMPLATE_TEST_CASE("Unit_hipFreeMultiTDev", "", char, int, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipFreeMultiTDev, char, int, float2, float4) { std::vector ptrs(numAllocs); size_t allocSize = sizeof(TestType) * GENERATE(1, 32, 64, 128); @@ -322,7 +306,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeMultiTDev", "", char, int, float2, float4) { HIP_CHECK_THREAD_FINALIZE(); } -TEMPLATE_TEST_CASE("Unit_hipFreeMultiTHost", "", char, int, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipFreeMultiTHost, char, int, float2, float4) { std::vector ptrs(numAllocs); size_t allocSize = sizeof(TestType) * GENERATE(1, 32, 64, 128); @@ -346,7 +330,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeMultiTHost", "", char, int, float2, float4) { } #if HT_NVIDIA -TEMPLATE_TEST_CASE("Unit_hipFreeMultiTArray", "", char, int, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipFreeMultiTArray, char, int, float2, float4) { using vec_info = vector_info; size_t width = GENERATE(32, 128, 256, 512, 1024); @@ -406,7 +390,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeMultiTArray", "", char, int, float2, float4) { } #else -TEMPLATE_TEST_CASE("Unit_hipFreeMultiTArray", "", char, int, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipFreeMultiTArray, char, int, float2, float4) { CHECK_IMAGE_SUPPORT using vec_info = vector_info; diff --git a/catch/unit/memory/hipFreeArray.cc b/catch/unit/memory/hipFreeArray.cc index 082e55ff1..a5a574350 100644 --- a/catch/unit/memory/hipFreeArray.cc +++ b/catch/unit/memory/hipFreeArray.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* hipFreeArray API test scenarios @@ -29,7 +16,7 @@ hipFreeArray API test scenarios #include -TEMPLATE_TEST_CASE("Unit_hipFreeArray_DifferentSizes", "", uchar2, char, ushort, short, short4, +TEMPLATE_TEST_CASE(Unit_hipFreeArray_DifferentSizes, uchar2, char, ushort, short, short4, uint, int, int4, float, float4) { CHECK_IMAGE_SUPPORT @@ -46,7 +33,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeArray_DifferentSizes", "", uchar2, char, ushort, HIP_CHECK(hipFreeArray(arrayPtr)); } -TEST_CASE("Unit_hipFreeArray_NegativeArray") { +TEST_CASE(Unit_hipFreeArray_NegativeArray) { #if HT_NVIDIA HIP_CHECK(hipFreeArray(nullptr)); #else @@ -54,7 +41,7 @@ TEST_CASE("Unit_hipFreeArray_NegativeArray") { #endif } -TEST_CASE("Unit_hipFreeArray_DoubleFree") { +TEST_CASE(Unit_hipFreeArray_DoubleFree) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("EXSWCPHIPT-120"); return; @@ -83,7 +70,7 @@ TEST_CASE("Unit_hipFreeArray_DoubleFree") { * arrays of different types and size and then call hipFreeArray for each array */ -TEMPLATE_TEST_CASE("Unit_hipFreeArray_MultiThreaded", "", char, int, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipFreeArray_MultiThreaded, char, int, float2, float4) { CHECK_IMAGE_SUPPORT constexpr size_t arr_size = 1024; diff --git a/catch/unit/memory/hipFreeAsync.cc b/catch/unit/memory/hipFreeAsync.cc index 964975962..942dbeb05 100644 --- a/catch/unit/memory/hipFreeAsync.cc +++ b/catch/unit/memory/hipFreeAsync.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipFreeAsync_Negative_Parameters") { +TEST_CASE(Unit_hipFreeAsync_Negative_Parameters) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); @@ -86,7 +70,7 @@ TEST_CASE("Unit_hipFreeAsync_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipFreeAsync_capturehipFreeAsync") { +TEST_CASE(Unit_hipFreeAsync_capturehipFreeAsync) { HIP_CHECK(hipSetDevice(0)); hipGraph_t graph{nullptr}; hipGraphExec_t graphExec{nullptr}; diff --git a/catch/unit/memory/hipFreeHost.cc b/catch/unit/memory/hipFreeHost.cc index 5041eb0da..a331585d5 100644 --- a/catch/unit/memory/hipFreeHost.cc +++ b/catch/unit/memory/hipFreeHost.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -34,7 +18,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipFreeHost_InvalidMemory") { +TEST_CASE(Unit_hipFreeHost_InvalidMemory) { SECTION("Nullptr") { HIP_CHECK(hipFreeHost(nullptr)); } SECTION("Invalid ptr") { @@ -76,7 +60,7 @@ TEST_CASE("Unit_hipFreeHost_InvalidMemory") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipFreeHost_DoubleFree") { +TEST_CASE(Unit_hipFreeHost_DoubleFree) { void* ptr = NULL; size_t ptr_size = 1024; @@ -96,7 +80,7 @@ TEST_CASE("Unit_hipFreeHost_DoubleFree") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipFreeHost_Multithreading") { +TEST_CASE(Unit_hipFreeHost_Multithreading) { std::vector ptrs(10); size_t ptr_size = 1024; @@ -119,7 +103,7 @@ TEST_CASE("Unit_hipFreeHost_Multithreading") { HIP_CHECK_THREAD_FINALIZE(); } -TEST_CASE("Unit_hipFreeHost_Capture_negative") { +TEST_CASE(Unit_hipFreeHost_Capture_negative) { void* ptr = nullptr; constexpr size_t kPtrSize = 1024; diff --git a/catch/unit/memory/hipFreeMipmappedArray.cc b/catch/unit/memory/hipFreeMipmappedArray.cc index 1b5060a14..d09d1652b 100644 --- a/catch/unit/memory/hipFreeMipmappedArray.cc +++ b/catch/unit/memory/hipFreeMipmappedArray.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -36,7 +20,7 @@ THE SOFTWARE. * 4. Call hipFreeMipmappedArray twice on the same pointer and check that the implementation handles * the second call correctly. */ -TEMPLATE_TEST_CASE("Unit_hipFreeMipmappedArrayImplicitSyncArray", "", char, float) { +TEMPLATE_TEST_CASE(Unit_hipFreeMipmappedArrayImplicitSyncArray, char, float) { hipMipmappedArray_t arrayPtr{}; hipExtent extent{}; hipChannelFormatDesc desc = hipCreateChannelDesc(); @@ -84,7 +68,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeMipmappedArrayImplicitSyncArray", "", char, floa } } -TEST_CASE("Unit_hipFreeMipmappedArray_Negative_Nullptr") { +TEST_CASE(Unit_hipFreeMipmappedArray_Negative_Nullptr) { #if HT_AMD HIP_CHECK_ERROR(hipFreeMipmappedArray(nullptr), hipErrorInvalidValue); #else @@ -92,7 +76,7 @@ TEST_CASE("Unit_hipFreeMipmappedArray_Negative_Nullptr") { #endif } -TEMPLATE_TEST_CASE("Unit_hipFreeMipmappedArrayMultiTArray", "", char, int) { +TEMPLATE_TEST_CASE(Unit_hipFreeMipmappedArrayMultiTArray, char, int) { constexpr size_t numAllocs = 10; std::vector threads; std::vector ptrs(numAllocs); diff --git a/catch/unit/memory/hipGetProcAddressMemoryApis.cc b/catch/unit/memory/hipGetProcAddressMemoryApis.cc index 408604f58..7d3ad1b92 100644 --- a/catch/unit/memory/hipGetProcAddressMemoryApis.cc +++ b/catch/unit/memory/hipGetProcAddressMemoryApis.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -37,7 +24,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisMallocFree") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisMallocFree) { void* hipMalloc_ptr = nullptr; void* hipFree_ptr = nullptr; void* hipExtMallocWithFlags_ptr = nullptr; @@ -353,7 +340,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMallocFree") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisRegisterUnReg") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisRegisterUnReg) { void* hipHostRegister_ptr = nullptr; void* hipHostUnregister_ptr = nullptr; @@ -408,7 +395,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisRegisterUnReg") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisArrayRelated") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisArrayRelated) { CHECK_IMAGE_SUPPORT void* hipMallocArray_ptr = nullptr; @@ -830,7 +817,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisArrayRelated") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisSetAndGetAttributes") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisSetAndGetAttributes) { void* hipPointerGetAttribute_ptr = nullptr; void* hipPointerGetAttributes_ptr = nullptr; void* hipDrvPointerGetAttributes_ptr = nullptr; @@ -1184,7 +1171,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisSetAndGetAttributes") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemCopy") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisMemCopy) { void* hipMemcpyHtoD_ptr = nullptr; void* hipMemcpyDtoH_ptr = nullptr; void* hipMemcpyDtoD_ptr = nullptr; @@ -1414,7 +1401,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemCopy") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemCopyWithStreams") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisMemCopyWithStreams) { void* hipMemcpyHtoDAsync_ptr = nullptr; void* hipMemcpyDtoHAsync_ptr = nullptr; void* hipMemcpyDtoDAsync_ptr = nullptr; @@ -2192,7 +2179,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemCopyWithStreams") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemset") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisMemset) { void* hipMemsetD8_ptr = nullptr; void* hipMemsetD16_ptr = nullptr; void* hipMemsetD32_ptr = nullptr; @@ -2485,7 +2472,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemset") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemset2D3D") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisMemset2D3D) { CHECK_IMAGE_SUPPORT void* hipMemset2D_ptr = nullptr; @@ -2663,7 +2650,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemset2D3D") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisGetMemInfoRelated") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisGetMemInfoRelated) { void* hipMemGetInfo_ptr = nullptr; void* hipMemPtrGetInfo_ptr = nullptr; @@ -2714,7 +2701,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisGetMemInfoRelated") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemcpy2DRelated", "[multigpu]") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisMemcpy2DRelated) { CHECK_IMAGE_SUPPORT void* hipMemcpy2D_ptr = nullptr; @@ -4491,7 +4478,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemcpy2DRelated", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemcpy3DRelated") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisMemcpy3DRelated) { CHECK_IMAGE_SUPPORT void* hipMemcpy3D_ptr = nullptr; @@ -5347,7 +5334,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisMemcpy3DRelated") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisAddressRelated") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisAddressRelated) { int currentHipVersion = 0; HIP_CHECK(hipRuntimeGetVersion(¤tHipVersion)); @@ -5389,7 +5376,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisAddressRelated") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisManagedMemory") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisManagedMemory) { if (HmmAttrPrint() != 1) { HipTest::HIP_SKIP_TEST("Skipping test since managed memory not supported"); return; @@ -5678,7 +5665,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisManagedMemory") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisStreamOrderedMemory") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisStreamOrderedMemory) { HIP_CHECK(hipSetDevice(0)); int mem_pool_support = 0; @@ -6024,7 +6011,7 @@ TEST_CASE("Unit_hipGetProcAddress_MemoryApisStreamOrderedMemory") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_MemoryApisPeerToPeer", "[multigpu]") { +TEST_CASE(Unit_hipGetProcAddress_MemoryApisPeerToPeer) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); diff --git a/catch/unit/memory/hipGetSymbolSizeAddress.cc b/catch/unit/memory/hipGetSymbolSizeAddress.cc index 5c011c7e8..8556cc0e0 100644 --- a/catch/unit/memory/hipGetSymbolSizeAddress.cc +++ b/catch/unit/memory/hipGetSymbolSizeAddress.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -87,14 +72,14 @@ static void HipGetSymbolSizeAddressTest(const void* symbol) { HipGetSymbolSizeAddressTest( \ SYMBOL(type##_arr)); -TEST_CASE("Unit_hipGetSymbolSizeAddress_Positive_Basic") { +TEST_CASE(Unit_hipGetSymbolSizeAddress_Positive_Basic) { SECTION("int") { HIP_GET_SYMBOL_SIZE_ADDRESS_TEST(int); } SECTION("float") { HIP_GET_SYMBOL_SIZE_ADDRESS_TEST(float); } SECTION("char") { HIP_GET_SYMBOL_SIZE_ADDRESS_TEST(char); } SECTION("double") { HIP_GET_SYMBOL_SIZE_ADDRESS_TEST(double); } } -TEST_CASE("Unit_hipGetSymbolAddress_Negative_Parameters") { +TEST_CASE(Unit_hipGetSymbolAddress_Negative_Parameters) { // Causes a segfault in CUDA #if HT_AMD SECTION("devPtr == nullptr") { @@ -108,7 +93,7 @@ TEST_CASE("Unit_hipGetSymbolAddress_Negative_Parameters") { } } -TEST_CASE("Unit_hipGetSymbolSize_Negative_Parameters") { +TEST_CASE(Unit_hipGetSymbolSize_Negative_Parameters) { // Causes a segfault in CUDA #if HT_AMD SECTION("size == nullptr") { diff --git a/catch/unit/memory/hipHostAlloc.cc b/catch/unit/memory/hipHostAlloc.cc index df2f42581..36328b87b 100644 --- a/catch/unit/memory/hipHostAlloc.cc +++ b/catch/unit/memory/hipHostAlloc.cc @@ -1,22 +1,9 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #ifdef _WIN32 #define NOMINMAX @@ -103,7 +90,7 @@ int get_flags() { hipHostMallocPortable | hipHostMallocMapped | hipHostMallocWriteCombined); } -TEST_CASE("Unit_hipHostAlloc_Positive") { +TEST_CASE(Unit_hipHostAlloc_Positive) { int* host_memory = nullptr; int flags = get_flags(); @@ -114,7 +101,7 @@ TEST_CASE("Unit_hipHostAlloc_Positive") { HIP_CHECK(hipFreeHost(host_memory)); } -TEST_CASE("Unit_hipHostAlloc_DataValidation") { +TEST_CASE(Unit_hipHostAlloc_DataValidation) { int validation_number = 10; int* host_memory = nullptr; int* device_memory = nullptr; @@ -145,7 +132,7 @@ TEST_CASE("Unit_hipHostAlloc_DataValidation") { HIP_CHECK(hipFreeHost(host_memory)); } -TEST_CASE("Unit_hipHostAlloc_Negative") { +TEST_CASE(Unit_hipHostAlloc_Negative) { int* host_memory = nullptr; int flags = get_flags(); @@ -179,7 +166,7 @@ TEST_CASE("Unit_hipHostAlloc_Negative") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipHostAlloc_Basic") { +TEST_CASE(Unit_hipHostAlloc_Basic) { static constexpr auto LEN{1024 * 1024}; static constexpr auto SIZE{LEN * sizeof(float)}; @@ -237,7 +224,7 @@ TEST_CASE("Unit_hipHostAlloc_Basic") { * using different synchronization techniquies * validates the result. */ -TEST_CASE("Unit_hipHostAlloc_Default") { +TEST_CASE(Unit_hipHostAlloc_Default) { int* A = nullptr; HIP_CHECK(hipHostAlloc(reinterpret_cast(&A), SIZEBYTES, hipHostMallocDefault)); std::string kPtrType{"default"}; @@ -262,7 +249,7 @@ TEST_CASE("Unit_hipHostAlloc_Default") { * - HIP_VERSION >= 6.3 */ #if HT_AMD -TEST_CASE("Unit_hipHostAlloc_Negative_NonCoherent") { +TEST_CASE(Unit_hipHostAlloc_Negative_NonCoherent) { int* A = nullptr; REQUIRE(hipHostAlloc(reinterpret_cast(&A), SIZEBYTES, hipHostMallocNonCoherent) == hipErrorInvalidValue); @@ -285,7 +272,7 @@ TEST_CASE("Unit_hipHostAlloc_Negative_NonCoherent") { * - HIP_VERSION >= 6.3 */ #if HT_AMD -TEST_CASE("Unit_hipHostAlloc_Negative_Coherent") { +TEST_CASE(Unit_hipHostAlloc_Negative_Coherent) { int* A = nullptr; REQUIRE(hipHostAlloc(reinterpret_cast(&A), SIZEBYTES, hipHostMallocCoherent) == hipErrorInvalidValue); @@ -308,7 +295,7 @@ TEST_CASE("Unit_hipHostAlloc_Negative_Coherent") { * - HIP_VERSION >= 6.3 */ #if HT_AMD -TEST_CASE("Unit_hipHostAlloc_Negative_NumaUser") { +TEST_CASE(Unit_hipHostAlloc_Negative_NumaUser) { int* A = nullptr; REQUIRE(hipHostAlloc(reinterpret_cast(&A), SIZEBYTES, hipHostMallocNumaUser) == hipErrorInvalidValue); @@ -329,7 +316,7 @@ TEST_CASE("Unit_hipHostAlloc_Negative_NumaUser") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipHostAlloc_AllocateMoreThanTotalSystemMemory") { +TEST_CASE(Unit_hipHostAlloc_AllocateMoreThanTotalSystemMemory) { char* host_ptr = nullptr; const size_t total_ram_mb = HipTest::getTotalSystemMemoryInMB(); if (total_ram_mb == 0) { @@ -361,7 +348,7 @@ TEST_CASE("Unit_hipHostAlloc_AllocateMoreThanTotalSystemMemory") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipHostAlloc_ArgValidation") { +TEST_CASE(Unit_hipHostAlloc_ArgValidation) { constexpr size_t allocSize = 1000; char* ptr; @@ -382,7 +369,7 @@ TEST_CASE("Unit_hipHostAlloc_ArgValidation") { } } -TEST_CASE("Unit_hipHostAlloc_Capture") { +TEST_CASE(Unit_hipHostAlloc_Capture) { int* host_memory = nullptr; int flags = get_flags(); diff --git a/catch/unit/memory/hipHostFree.cc b/catch/unit/memory/hipHostFree.cc index 2134bd1ff..de7277f92 100644 --- a/catch/unit/memory/hipHostFree.cc +++ b/catch/unit/memory/hipHostFree.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -33,7 +17,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipHostFree_InvalidMemory") { +TEST_CASE(Unit_hipHostFree_InvalidMemory) { SECTION("Nullptr") { HIP_CHECK(hipHostFree(nullptr)); } SECTION("Invalid ptr") { @@ -76,7 +60,7 @@ TEST_CASE("Unit_hipHostFree_InvalidMemory") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipHostFree_DoubleFree") { +TEST_CASE(Unit_hipHostFree_DoubleFree) { void* ptr = NULL; size_t ptr_size = 1024; @@ -96,7 +80,7 @@ TEST_CASE("Unit_hipHostFree_DoubleFree") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipHostFree_Multithreading") { +TEST_CASE(Unit_hipHostFree_Multithreading) { std::vector ptrs(10); size_t ptr_size = 1024; @@ -119,7 +103,7 @@ TEST_CASE("Unit_hipHostFree_Multithreading") { HIP_CHECK_THREAD_FINALIZE(); } -TEST_CASE("Unit_hipHostFree_Capture") { +TEST_CASE(Unit_hipHostFree_Capture) { void* host_ptr = nullptr; constexpr size_t kAllocSize = 1024; HIP_CHECK(hipHostMalloc(&host_ptr, kAllocSize)); diff --git a/catch/unit/memory/hipHostGetDevicePointer.cc b/catch/unit/memory/hipHostGetDevicePointer.cc index d57d03706..d63089fb0 100644 --- a/catch/unit/memory/hipHostGetDevicePointer.cc +++ b/catch/unit/memory/hipHostGetDevicePointer.cc @@ -1,29 +1,13 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include -TEST_CASE("Unit_hipHostGetDevicePointer_Negative") { +TEST_CASE(Unit_hipHostGetDevicePointer_Negative) { int* hPtr{nullptr}; int* dPtr{nullptr}; HIP_CHECK(hipHostMalloc(&hPtr, sizeof(int))); @@ -61,7 +45,7 @@ TEST_CASE("Unit_hipHostGetDevicePointer_Negative") { template __global__ void set(T* ptr, T val) { *ptr = val; } -TEST_CASE("Unit_hipHostGetDevicePointer_UseCase") { +TEST_CASE(Unit_hipHostGetDevicePointer_UseCase) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCanMapHostMemory)) { HipTest::HIP_SKIP_TEST("Device does not support mapping host memory"); return; @@ -101,7 +85,7 @@ TEST_CASE("Unit_hipHostGetDevicePointer_UseCase") { HIP_CHECK(hipHostFree(hPtr)); } -TEST_CASE("Unit_hipHostGetDevicePointer_Capture") { +TEST_CASE(Unit_hipHostGetDevicePointer_Capture) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCanMapHostMemory)) { HipTest::HIP_SKIP_TEST("Device does not support mapping host memory"); return; diff --git a/catch/unit/memory/hipHostGetFlags.cc b/catch/unit/memory/hipHostGetFlags.cc index 2063bbbc7..5563f3837 100644 --- a/catch/unit/memory/hipHostGetFlags.cc +++ b/catch/unit/memory/hipHostGetFlags.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This testcase verifies the basic scenario of hipHostGetFlags API @@ -85,7 +69,7 @@ inline void checkFlags(unsigned int expected, unsigned int obtained) { REQUIRE(expected == obtained); } -TEST_CASE("Unit_hipHostGetFlags_flagCombos") { +TEST_CASE(Unit_hipHostGetFlags_flagCombos) { constexpr auto SIZE{LEN * sizeof(int)}; int* A_h{nullptr}; @@ -118,7 +102,7 @@ TEST_CASE("Unit_hipHostGetFlags_flagCombos") { } // Test Allocation with flags and getting flags in another thread -TEST_CASE("Unit_hipHostGetFlags_DifferentThreads") { +TEST_CASE(Unit_hipHostGetFlags_DifferentThreads) { constexpr auto SIZE{LEN * sizeof(int)}; int* A_h{nullptr}; @@ -151,7 +135,7 @@ TEST_CASE("Unit_hipHostGetFlags_DifferentThreads") { } // Test behaviour of hipHostGetFlags with invalid args -TEST_CASE("Unit_hipHostGetFlags_InvalidArgs") { +TEST_CASE(Unit_hipHostGetFlags_InvalidArgs) { constexpr auto SIZE{LEN * sizeof(int)}; int* A_h{nullptr}; @@ -221,7 +205,7 @@ TEST_CASE("Unit_hipHostGetFlags_InvalidArgs") { } } -TEST_CASE("Unit_hipHostGetFlags_Capture") { +TEST_CASE(Unit_hipHostGetFlags_Capture) { unsigned int host_flags = 0; void* host_ptr = nullptr; constexpr size_t kAllocSize = 1024; diff --git a/catch/unit/memory/hipHostMalloc.cc b/catch/unit/memory/hipHostMalloc.cc index 28e6bdb94..050d79698 100644 --- a/catch/unit/memory/hipHostMalloc.cc +++ b/catch/unit/memory/hipHostMalloc.cc @@ -1,23 +1,7 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* @@ -109,7 +93,7 @@ Allocates the memory using hipHostMalloc API Launches the kernel and performs vector addition. validates thes result. */ -TEST_CASE("Unit_hipHostMalloc_Basic") { +TEST_CASE(Unit_hipHostMalloc_Basic) { static constexpr auto LEN{1024 * 1024}; static constexpr auto SIZE{LEN * sizeof(float)}; @@ -163,7 +147,7 @@ TEST_CASE("Unit_hipHostMalloc_Basic") { This testcase verifies the hipHostMalloc API by passing nullptr to the pointer variable */ -TEST_CASE("Unit_hipHostMalloc_Negative") { +TEST_CASE(Unit_hipHostMalloc_Negative) { #if HT_AMD { // Stimulate error condition: @@ -182,7 +166,7 @@ This testcase verifies the hipHostMalloc API by techniquies 3. validates the result. */ -TEST_CASE("Unit_hipHostMalloc_NonCoherent") { +TEST_CASE(Unit_hipHostMalloc_NonCoherent) { int* A = nullptr; HIP_CHECK(hipHostMalloc(reinterpret_cast(&A), sizeBytes, hipHostMallocNonCoherent)); const char* ptrType = "non-coherent"; @@ -200,7 +184,7 @@ This testcase verifies the hipHostMalloc API by techniquies 3. validates the result. */ -TEST_CASE("Unit_hipHostMalloc_Coherent") { +TEST_CASE(Unit_hipHostMalloc_Coherent) { int* A = nullptr; if (hipHostMalloc(reinterpret_cast(&A), sizeBytes, hipHostMallocCoherent) == hipSuccess) { const char* ptrType = "coherent"; @@ -226,7 +210,7 @@ This testcase verifies the hipHostMalloc API by techniquies 3. validates the result. */ -TEST_CASE("Unit_hipHostMalloc_Default") { +TEST_CASE(Unit_hipHostMalloc_Default) { int* A = nullptr; HIP_CHECK(hipHostMalloc(reinterpret_cast(&A), sizeBytes)); const char* ptrType = "default"; @@ -236,21 +220,11 @@ TEST_CASE("Unit_hipHostMalloc_Default") { HIP_CHECK(hipFreeHost(A)); } -TEST_CASE("Unit_hipHostGetDevicePointer_NullCheck") { - int* d_a; - HIP_CHECK(hipHostMalloc(reinterpret_cast(&d_a), sizeof(int))); - - auto res = hipHostGetDevicePointer(nullptr, d_a, 0); - REQUIRE(res == hipErrorInvalidValue); - - HIP_CHECK(hipHostFree(d_a)); -} - /* This testcase verifies the hipHostMalloc API by 1. Allocating more memory than total system RAM. Should return hipErrorOutOfMemory. */ -TEST_CASE("Unit_hipHostMalloc_AllocateMoreThanTotalSystemMemory") { +TEST_CASE(Unit_hipHostMalloc_AllocateMoreThanTotalSystemMemory) { char* host_ptr = nullptr; const size_t total_ram_mb = HipTest::getTotalSystemMemoryInMB(); if (total_ram_mb == 0) { @@ -265,7 +239,7 @@ TEST_CASE("Unit_hipHostMalloc_AllocateMoreThanTotalSystemMemory") { REQUIRE(host_ptr == nullptr); } -TEST_CASE("Unit_hipHostMalloc_Capture") { +TEST_CASE(Unit_hipHostMalloc_Capture) { int* host_ptr = nullptr; hipError_t capture_error = hipSuccess; diff --git a/catch/unit/memory/hipHostMallocTests.cc b/catch/unit/memory/hipHostMallocTests.cc index 9b25f613a..2cdc18a5d 100644 --- a/catch/unit/memory/hipHostMallocTests.cc +++ b/catch/unit/memory/hipHostMallocTests.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -34,7 +21,7 @@ Testcase Scenarios : /** * Performs argument validation of hipHostMalloc api. */ -TEST_CASE("Unit_hipHostMalloc_ArgValidation") { +TEST_CASE(Unit_hipHostMalloc_ArgValidation) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("TODO: Need to debug"); #endif diff --git a/catch/unit/memory/hipHostRegister.cc b/catch/unit/memory/hipHostRegister.cc index 651836085..52628646c 100644 --- a/catch/unit/memory/hipHostRegister.cc +++ b/catch/unit/memory/hipHostRegister.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2022-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipHostRegister hipHostRegister @@ -110,7 +94,7 @@ void doMemCopy(size_t numElements, int offset, T* A, T* Bh, T* Bd, bool internal * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipHostRegister_ReferenceFromKernelandhipMemset") { +TEST_CASE(Unit_hipHostRegister_ReferenceFromKernelandhipMemset) { size_t sizeBytes{LEN * sizeof(int)}; int *A, **Ad; int num_devices = 0; @@ -176,7 +160,7 @@ TEST_CASE("Unit_hipHostRegister_ReferenceFromKernelandhipMemset") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_DirectReferenceFromKernel") { +TEST_CASE(Unit_hipHostRegister_DirectReferenceFromKernel) { auto flags = GENERATE(hipHostRegisterDefault, hipHostRegisterPortable, hipHostRegisterMapped); size_t sizeBytes{LEN * sizeof(int)}; int* A; @@ -214,7 +198,7 @@ TEST_CASE("Unit_hipHostRegister_DirectReferenceFromKernel") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_DirectReferenceMultGpu") { +TEST_CASE(Unit_hipHostRegister_DirectReferenceMultGpu) { // 1 refers to doing hipHostRegister once for all devices // 0 refers to doing hipHostRegister for each device auto register_once = GENERATE(0, 1); @@ -269,7 +253,7 @@ TEST_CASE("Unit_hipHostRegister_DirectReferenceMultGpu") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_SameChunkRepeat") { +TEST_CASE(Unit_hipHostRegister_SameChunkRepeat) { size_t sizeBytes{LEN * sizeof(uint8_t)}; uint8_t* A; A = reinterpret_cast(malloc(sizeBytes)); @@ -306,7 +290,7 @@ TEST_CASE("Unit_hipHostRegister_SameChunkRepeat") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_Chunks_SingleAttempt") { +TEST_CASE(Unit_hipHostRegister_Chunks_SingleAttempt) { size_t sizeBytes{LARGE_CHUNK_LEN * sizeof(uint8_t)}; size_t sizeBytesChunk{SMALL_CHUNK_LEN * sizeof(uint8_t)}; uint8_t* A; @@ -352,7 +336,7 @@ TEST_CASE("Unit_hipHostRegister_Chunks_SingleAttempt") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_Chunks_RoundRobin") { +TEST_CASE(Unit_hipHostRegister_Chunks_RoundRobin) { size_t sizeBytes{LARGE_CHUNK_LEN * sizeof(int)}; size_t sizeBytesChunk{SMALL_CHUNK_LEN * sizeof(int)}; int* A; @@ -390,7 +374,7 @@ TEST_CASE("Unit_hipHostRegister_Chunks_RoundRobin") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_Perform_hipMemset") { +TEST_CASE(Unit_hipHostRegister_Perform_hipMemset) { size_t sizeBytes{LEN * sizeof(uint8_t)}; uint8_t* A; uint8_t* dPtr = nullptr; @@ -424,7 +408,7 @@ TEST_CASE("Unit_hipHostRegister_Perform_hipMemset") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_Perform_hipMemcpy") { +TEST_CASE(Unit_hipHostRegister_Perform_hipMemcpy) { size_t sizeBytes{LEN * sizeof(uint8_t)}; uint8_t *A, *B, *dPtr; A = reinterpret_cast(malloc(sizeBytes)); @@ -464,7 +448,7 @@ TEST_CASE("Unit_hipHostRegister_Perform_hipMemcpy") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_AsyncApis") { +TEST_CASE(Unit_hipHostRegister_AsyncApis) { size_t sizeBytes{LEN * sizeof(uint32_t)}; uint32_t *A, *B, *dPtr; A = reinterpret_cast(malloc(sizeBytes)); @@ -506,7 +490,7 @@ TEST_CASE("Unit_hipHostRegister_AsyncApis") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_Graphs") { +TEST_CASE(Unit_hipHostRegister_Graphs) { size_t sizeBytes{LEN * sizeof(uint32_t)}; uint32_t *A, *B, *dPtr; A = reinterpret_cast(malloc(sizeBytes)); @@ -574,7 +558,7 @@ TEST_CASE("Unit_hipHostRegister_Graphs") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipHostRegister_MemAdvise_SetGet") { +TEST_CASE(Unit_hipHostRegister_MemAdvise_SetGet) { hipDeviceProp_t prop; HIP_CHECK(hipGetDeviceProperties(&prop, 0)); if (prop.concurrentManagedAccess == 0) { @@ -643,7 +627,7 @@ TEST_CASE("Unit_hipHostRegister_MemAdvise_SetGet") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipHostRegister_Memcpy") { +TEST_CASE(Unit_hipHostRegister_Memcpy) { // 1 refers to hipHostRegister // 0 refers to malloc auto mem_type = GENERATE(0, 1); @@ -687,7 +671,7 @@ TEST_CASE("Unit_hipHostRegister_Memcpy") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipHostRegister_Flags") { +TEST_CASE(Unit_hipHostRegister_Flags) { size_t sizeBytes = 1 * sizeof(int); int* hostPtr = reinterpret_cast(malloc(sizeBytes)); @@ -737,7 +721,7 @@ TEST_CASE("Unit_hipHostRegister_Flags") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipHostRegister_Negative") { +TEST_CASE(Unit_hipHostRegister_Negative) { int* hostPtr = nullptr; size_t sizeBytes = 1 * sizeof(int); @@ -772,7 +756,7 @@ TEST_CASE("Unit_hipHostRegister_Negative") { } } -TEST_CASE("Unit_hipHostRegister_Capture") { +TEST_CASE(Unit_hipHostRegister_Capture) { constexpr size_t kBufferSize = 1024; auto buffer = std::make_unique(kBufferSize); hipError_t capture_error = hipSuccess; diff --git a/catch/unit/memory/hipHostUnregister.cc b/catch/unit/memory/hipHostUnregister.cc index c691e1c09..5b991322d 100644 --- a/catch/unit/memory/hipHostUnregister.cc +++ b/catch/unit/memory/hipHostUnregister.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -45,7 +29,7 @@ inline bool hipHostRegisterSupported() { } -TEST_CASE("Unit_hipHostUnregister_MemoryNotAccessableAfterUnregister") { +TEST_CASE(Unit_hipHostUnregister_MemoryNotAccessableAfterUnregister) { if (!hipHostRegisterSupported()) { return; } @@ -64,23 +48,23 @@ TEST_CASE("Unit_hipHostUnregister_MemoryNotAccessableAfterUnregister") { } } -TEST_CASE("Unit_hipHostUnregister_NullPtr") { +TEST_CASE(Unit_hipHostUnregister_NullPtr) { HIP_CHECK_ERROR(hipHostUnregister(nullptr), hipErrorInvalidValue); } -TEST_CASE("Unit_hipHostUnregister_Ptr_Different_Than_Specified_To_Register") { +TEST_CASE(Unit_hipHostUnregister_Ptr_Different_Than_Specified_To_Register) { std::vector alloc(2); HIP_CHECK(hipHostRegister(alloc.data(), alloc.size(), 0)); HIP_CHECK_ERROR(hipHostUnregister(&alloc.data()[1]), hipErrorHostMemoryNotRegistered); HIP_CHECK(hipHostUnregister(alloc.data())); } -TEST_CASE("Unit_hipHostUnregister_NotRegisteredPointer") { +TEST_CASE(Unit_hipHostUnregister_NotRegisteredPointer) { auto x = std::unique_ptr(new int); HIP_CHECK_ERROR(hipHostUnregister(x.get()), hipErrorHostMemoryNotRegistered); } -TEST_CASE("Unit_hipHostUnregister_AlreadyUnregisteredPointer") { +TEST_CASE(Unit_hipHostUnregister_AlreadyUnregisteredPointer) { if (!hipHostRegisterSupported()) { return; } @@ -95,7 +79,7 @@ TEST_CASE("Unit_hipHostUnregister_AlreadyUnregisteredPointer") { } } -TEST_CASE("Unit_hipHostUnregister_Capture") { +TEST_CASE(Unit_hipHostUnregister_Capture) { constexpr size_t kBufferSize = 1024; auto buffer = std::make_unique(kBufferSize); hipError_t capture_error = hipSuccess; diff --git a/catch/unit/memory/hipMalloc.cc b/catch/unit/memory/hipMalloc.cc index 8b93a0c09..9f066413e 100644 --- a/catch/unit/memory/hipMalloc.cc +++ b/catch/unit/memory/hipMalloc.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #ifdef _WIN32 #define NOMINMAX @@ -36,7 +20,7 @@ THE SOFTWARE. static constexpr size_t ONE_MB = 1024 * 1024; -TEST_CASE("Unit_hipMalloc_Positive_Basic") { +TEST_CASE(Unit_hipMalloc_Positive_Basic) { constexpr size_t page_size = 4096; void* ptr = nullptr; const auto alloc_size = @@ -47,13 +31,13 @@ TEST_CASE("Unit_hipMalloc_Positive_Basic") { HIP_CHECK(hipFree(ptr)); } -TEST_CASE("Unit_hipMalloc_Positive_Zero_Size") { +TEST_CASE(Unit_hipMalloc_Positive_Zero_Size) { void* ptr = reinterpret_cast(0x1); HIP_CHECK(hipMalloc(&ptr, 0)); REQUIRE(ptr == nullptr); } -TEST_CASE("Unit_hipMalloc_Positive_Alignment") { +TEST_CASE(Unit_hipMalloc_Positive_Alignment) { void *ptr1 = nullptr, *ptr2 = nullptr; HIP_CHECK(hipMalloc(&ptr1, 1)); HIP_CHECK(hipMalloc(&ptr2, 10)); @@ -63,7 +47,7 @@ TEST_CASE("Unit_hipMalloc_Positive_Alignment") { HIP_CHECK(hipFree(ptr2)); } -TEST_CASE("Unit_hipMalloc_Negative_Parameters") { +TEST_CASE(Unit_hipMalloc_Negative_Parameters) { SECTION("ptr == nullptr") { HIP_CHECK_ERROR(hipMalloc(nullptr, 4096), hipErrorInvalidValue); } SECTION("size == max size_t") { void* ptr; @@ -153,7 +137,7 @@ static void performOperations(char* devMem, size_t size) { * ------------------------ * - unit/memory/hipMalloc.cc */ -TEST_CASE("Unit_hipMalloc_Allocate90PercentOfDeviceMemory") { +TEST_CASE(Unit_hipMalloc_Allocate90PercentOfDeviceMemory) { char* devMem = nullptr; size_t freeVRAM = 0, totalVRAM = 0; HIP_CHECK(hipMemGetInfo(&freeVRAM, &totalVRAM)); @@ -193,7 +177,7 @@ TEST_CASE("Unit_hipMalloc_Allocate90PercentOfDeviceMemory") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipMalloc_Allocate110PercentOfDeviceMemory") { +TEST_CASE(Unit_hipMalloc_Allocate110PercentOfDeviceMemory) { char *devMem = nullptr; size_t freeVRAM = 0, totalVRAM = 0; HIP_CHECK(hipMemGetInfo(&freeVRAM, &totalVRAM)); @@ -266,7 +250,7 @@ TEST_CASE("Unit_hipMalloc_Allocate110PercentOfDeviceMemory") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipMalloc_AllocateAvailableVRAMAndPossibleRAM") { +TEST_CASE(Unit_hipMalloc_AllocateAvailableVRAMAndPossibleRAM) { char *devMem = nullptr; size_t freeVRAM = 0, totalVRAM = 0; HIP_CHECK(hipMemGetInfo(&freeVRAM, &totalVRAM)); @@ -327,7 +311,7 @@ TEST_CASE("Unit_hipMalloc_AllocateAvailableVRAMAndPossibleRAM") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipMalloc_AllocateMoreThanTotalRAM") { +TEST_CASE(Unit_hipMalloc_AllocateMoreThanTotalRAM) { char *devMem = nullptr; size_t totalRAM = getTotalRAM(); @@ -356,7 +340,7 @@ TEST_CASE("Unit_hipMalloc_AllocateMoreThanTotalRAM") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipMalloc_AllocateMoreThanTotalVRAM") { +TEST_CASE(Unit_hipMalloc_AllocateMoreThanTotalVRAM) { char *devMem = nullptr; size_t freeVRAM = 0, totalVRAM = 0; diff --git a/catch/unit/memory/hipMalloc3D.cc b/catch/unit/memory/hipMalloc3D.cc index 8844c0639..50eeb527c 100644 --- a/catch/unit/memory/hipMalloc3D.cc +++ b/catch/unit/memory/hipMalloc3D.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* hipMalloc3D API test scenarios @@ -67,7 +54,7 @@ static void Malloc3DThreadFunc(int gpu) { MemoryAlloc3DDiffSizes(gpu); } * allocation whose combined size goes over PalSettings::subAllocationChunkSize_; * hipMemGetInfo() should indicate the memory went down after we hipFree() all of them */ -TEST_CASE("Unit_hipMalloc3D_Basic") { +TEST_CASE(Unit_hipMalloc3D_Basic) { CHECK_IMAGE_SUPPORT static constexpr int ChunkSize = 64; // (in megabytes) @@ -116,7 +103,7 @@ TEST_CASE("Unit_hipMalloc3D_Basic") { This testcase verifies the hipMalloc3D API by allocating smaller and big chunk data. */ -TEST_CASE("Unit_hipMalloc3D_SmallandBigChunks") { +TEST_CASE(Unit_hipMalloc3D_SmallandBigChunks) { CHECK_IMAGE_SUPPORT MemoryAlloc3DDiffSizes(0); @@ -127,7 +114,7 @@ This testcase verifies the hipMalloc3D API in multithreaded scenario by launching threads in parallel on multiple GPUs and verifies the hipMalloc3D API with small and big chunks data */ -TEST_CASE("Unit_hipMalloc3D_MultiThread", "[multigpu]") { +TEST_CASE(Unit_hipMalloc3D_MultiThread) { CHECK_IMAGE_SUPPORT std::vector threadlist; diff --git a/catch/unit/memory/hipMalloc3DArray.cc b/catch/unit/memory/hipMalloc3DArray.cc index b2506f44c..6a5774d7d 100644 --- a/catch/unit/memory/hipMalloc3DArray.cc +++ b/catch/unit/memory/hipMalloc3DArray.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* hipMalloc3DArray API test scenarios @@ -66,7 +53,7 @@ static void Malloc3DArray_DiffSizes(int gpu) { } } -TEST_CASE("Unit_hipMalloc3DArray_DiffSizes") { +TEST_CASE(Unit_hipMalloc3DArray_DiffSizes) { CHECK_IMAGE_SUPPORT Malloc3DArray_DiffSizes(0); @@ -78,7 +65,7 @@ This testcase verifies the hipMalloc3DArray API in multithreaded scenario by launching threads in parallel on multiple GPUs and verifies the hipMalloc3DArray API with small and big chunks data */ -TEST_CASE("Unit_hipMalloc3DArray_MultiThread", "[multigpu]") { +TEST_CASE(Unit_hipMalloc3DArray_MultiThread) { CHECK_IMAGE_SUPPORT std::vector threadlist; @@ -124,7 +111,7 @@ void checkArrayIsExpected(hipArray_t array, const hipChannelFormatDesc& expected } } // namespace -TEMPLATE_TEST_CASE("Unit_hipMalloc3DArray_happy", "", char, uchar2, uint2, int4, short4, float, +TEMPLATE_TEST_CASE(Unit_hipMalloc3DArray_happy, char, uchar2, uint2, int4, short4, float, float2, float4) { CHECK_IMAGE_SUPPORT @@ -155,7 +142,7 @@ TEMPLATE_TEST_CASE("Unit_hipMalloc3DArray_happy", "", char, uchar2, uint2, int4, } } -TEMPLATE_TEST_CASE("Unit_hipMalloc3DArray_MaxTexture", "", int, uint4, short, ushort2, +TEMPLATE_TEST_CASE(Unit_hipMalloc3DArray_MaxTexture, int, uint4, short, ushort2, unsigned char, float, float4) { CHECK_IMAGE_SUPPORT @@ -248,7 +235,7 @@ hipExtent makeExtent(unsigned int flag, size_t s) { // Providing the array pointer as nullptr should return an error -TEST_CASE("Unit_hipMalloc3DArray_Negative_NullArrayPtr") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_NullArrayPtr) { CHECK_IMAGE_SUPPORT hipChannelFormatDesc desc = hipCreateChannelDesc(); @@ -260,7 +247,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_NullArrayPtr") { } // Providing the description pointer as nullptr should return an error -TEST_CASE("Unit_hipMalloc3DArray_Negative_NullDescPtr") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_NullDescPtr) { CHECK_IMAGE_SUPPORT constexpr size_t s = 6; // 6 to keep cubemap happy @@ -273,7 +260,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_NullDescPtr") { } // Zero width arrays are not allowed -TEST_CASE("Unit_hipMalloc3DArray_Negative_ZeroWidth") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_ZeroWidth) { CHECK_IMAGE_SUPPORT constexpr size_t s = 6; // 6 to keep cubemap happy @@ -287,7 +274,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_ZeroWidth") { } // Zero height arrays are only allowed for 1D arrays and layered arrays -TEST_CASE("Unit_hipMalloc3DArray_Negative_ZeroHeight") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_ZeroHeight) { CHECK_IMAGE_SUPPORT constexpr size_t s = 6; // 6 to keep cubemap happy @@ -305,7 +292,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_ZeroHeight") { } } -TEST_CASE("Unit_hipMalloc3DArray_Negative_InvalidFlags") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_InvalidFlags) { CHECK_IMAGE_SUPPORT constexpr size_t s = 6; // 6 to keep cubemap happy @@ -342,7 +329,7 @@ void testInvalidDescription(hipChannelFormatDesc desc) { HIP_CHECK_ERROR(hipMalloc3DArray(&array, &desc, makeExtent(flag, s), flag), expectedError); } -TEST_CASE("Unit_hipMalloc3DArray_Negative_InvalidFormat") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_InvalidFormat) { CHECK_IMAGE_SUPPORT hipChannelFormatDesc desc = hipCreateChannelDesc(); @@ -350,7 +337,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_InvalidFormat") { testInvalidDescription(desc); } -TEST_CASE("Unit_hipMalloc3DArray_Negative_BadChannelLayout") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_BadChannelLayout) { CHECK_IMAGE_SUPPORT const int bits = GENERATE(8, 16, 32); @@ -373,7 +360,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_BadChannelLayout") { testInvalidDescription(desc); } -TEST_CASE("Unit_hipMalloc3DArray_Negative_8BitFloat") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_8BitFloat) { CHECK_IMAGE_SUPPORT hipChannelFormatDesc desc = GENERATE(hipCreateChannelDesc(8, 0, 0, 0, hipChannelFormatKindFloat), @@ -383,7 +370,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_8BitFloat") { testInvalidDescription(desc); } -TEST_CASE("Unit_hipMalloc3DArray_Negative_DifferentChannelSizes") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_DifferentChannelSizes) { CHECK_IMAGE_SUPPORT const int bitsX = GENERATE(8, 16, 32); @@ -408,7 +395,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_DifferentChannelSizes") { testInvalidDescription(desc); } -TEST_CASE("Unit_hipMalloc3DArray_Negative_BadChannelSize") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_BadChannelSize) { CHECK_IMAGE_SUPPORT const int badBits = GENERATE(-1, 0, 10, 100); @@ -423,7 +410,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_BadChannelSize") { // hipMalloc3DArray should handle the max numeric value gracefully. -TEST_CASE("Unit_hipMalloc3DArray_Negative_NumericLimit") { +TEST_CASE(Unit_hipMalloc3DArray_Negative_NumericLimit) { CHECK_IMAGE_SUPPORT hipArray_t arrayPtr; @@ -436,7 +423,7 @@ TEST_CASE("Unit_hipMalloc3DArray_Negative_NumericLimit") { } // texture gather arrays are only allowed to be 2D -TEMPLATE_TEST_CASE("Unit_hipMalloc3DArray_Negative_Non2DTextureGather", "", char, uchar2, short4, +TEMPLATE_TEST_CASE(Unit_hipMalloc3DArray_Negative_Non2DTextureGather, char, uchar2, short4, float2, float4) { #if HT_AMD HipTest::HIP_SKIP_TEST("Texture Gather arrays not supported using AMD backend"); diff --git a/catch/unit/memory/hipMallocArray.cc b/catch/unit/memory/hipMallocArray.cc index 142de1d28..d0581d526 100644 --- a/catch/unit/memory/hipMallocArray.cc +++ b/catch/unit/memory/hipMallocArray.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* hipMallocArray API test scenarios @@ -68,7 +55,7 @@ static void MallocArray_DiffSizes(int gpu) { } } -TEST_CASE("Unit_hipMallocArray_DiffSizes") { +TEST_CASE(Unit_hipMallocArray_DiffSizes) { CHECK_IMAGE_SUPPORT MallocArray_DiffSizes(0); @@ -80,7 +67,7 @@ This testcase verifies the hipMallocArray API in multithreaded scenario by launching threads in parallel on multiple GPUs and verifies the hipMallocArray API with small and big chunks data */ -TEST_CASE("Unit_hipMallocArray_MultiThread", "[multigpu]") { +TEST_CASE(Unit_hipMallocArray_MultiThread) { CHECK_IMAGE_SUPPORT std::vector threadlist; @@ -376,7 +363,7 @@ void testArrayAsSurface(hipArray_t arrayPtr, const size_t width, const size_t he // The happy path of a default array and a SurfaceLoadStore array should work // Selection of types chosen to reduce compile times -TEMPLATE_TEST_CASE("Unit_hipMallocArray_happy", "", uint, int, int4, ushort, short2, char, uchar2, +TEMPLATE_TEST_CASE(Unit_hipMallocArray_happy, uint, int, int4, ushort, short2, char, uchar2, char4, float, float2, float4) { CHECK_IMAGE_SUPPORT @@ -431,7 +418,7 @@ TEMPLATE_TEST_CASE("Unit_hipMallocArray_happy", "", uint, int, int4, ushort, sho // Arrays can be up to the size of maxTexture* but no bigger // EXSWCPHIPT-71 - no equivalent value for maxSurface and maxTexture2DGather. -TEMPLATE_TEST_CASE("Unit_hipMallocArray_MaxTexture_Default", "", uint, int4, ushort, short2, char, +TEMPLATE_TEST_CASE(Unit_hipMallocArray_MaxTexture_Default, uint, int4, ushort, short2, char, char4, float2, float4) { CHECK_IMAGE_SUPPORT @@ -491,7 +478,7 @@ TEMPLATE_TEST_CASE("Unit_hipMallocArray_MaxTexture_Default", "", uint, int4, ush // Arrays with channels of different size are not allowed. -TEST_CASE("Unit_hipMallocArray_Negative_DifferentChannelSizes") { +TEST_CASE(Unit_hipMallocArray_Negative_DifferentChannelSizes) { CHECK_IMAGE_SUPPORT const int bitsX = GENERATE(8, 16, 32); @@ -532,7 +519,7 @@ TEST_CASE("Unit_hipMallocArray_Negative_DifferentChannelSizes") { } // Zero-width array is not supported -TEST_CASE("Unit_hipMallocArray_Negative_ZeroWidth") { +TEST_CASE(Unit_hipMallocArray_Negative_ZeroWidth) { CHECK_IMAGE_SUPPORT hipChannelFormatDesc desc = hipCreateChannelDesc(); @@ -548,7 +535,7 @@ TEST_CASE("Unit_hipMallocArray_Negative_ZeroWidth") { } // Providing the array pointer as nullptr should return an error -TEST_CASE("Unit_hipMallocArray_Negative_NullArrayPtr") { +TEST_CASE(Unit_hipMallocArray_Negative_NullArrayPtr) { CHECK_IMAGE_SUPPORT hipChannelFormatDesc desc = hipCreateChannelDesc(); @@ -557,7 +544,7 @@ TEST_CASE("Unit_hipMallocArray_Negative_NullArrayPtr") { } // Providing the desc pointer as nullptr should return an error -TEST_CASE("Unit_hipMallocArray_Negative_NullDescPtr") { +TEST_CASE(Unit_hipMallocArray_Negative_NullDescPtr) { CHECK_IMAGE_SUPPORT hipArray_t arrayPtr; @@ -566,7 +553,7 @@ TEST_CASE("Unit_hipMallocArray_Negative_NullDescPtr") { } // Inappropriate but related flags should still return an error -TEST_CASE("Unit_hipMallocArray_Negative_BadFlags") { +TEST_CASE(Unit_hipMallocArray_Negative_BadFlags) { CHECK_IMAGE_SUPPORT hipChannelFormatDesc desc = hipCreateChannelDesc(); @@ -594,7 +581,7 @@ TEST_CASE("Unit_hipMallocArray_Negative_BadFlags") { } // 8-bit float channels are not supported -TEMPLATE_TEST_CASE("Unit_hipMallocArray_Negative_8bitFloat", "", float, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipMallocArray_Negative_8bitFloat, float, float2, float4) { CHECK_IMAGE_SUPPORT hipChannelFormatDesc desc = GENERATE(hipCreateChannelDesc(8, 0, 0, 0, hipChannelFormatKindFloat), @@ -615,7 +602,7 @@ TEMPLATE_TEST_CASE("Unit_hipMallocArray_Negative_8bitFloat", "", float, float2, } // Only 8, 16, and 32 bit channels are supported -TEST_CASE("Unit_hipMallocArray_Negative_BadNumberOfBits") { +TEST_CASE(Unit_hipMallocArray_Negative_BadNumberOfBits) { CHECK_IMAGE_SUPPORT const int badBits = GENERATE(-1, 0, 10, 100); @@ -644,7 +631,7 @@ TEST_CASE("Unit_hipMallocArray_Negative_BadNumberOfBits") { } // creating elements with 3 channels is not supported. -TEST_CASE("Unit_hipMallocArray_Negative_3ChannelElement") { +TEST_CASE(Unit_hipMallocArray_Negative_3ChannelElement) { CHECK_IMAGE_SUPPORT const int bits = GENERATE(8, 16, 32); @@ -673,7 +660,7 @@ TEST_CASE("Unit_hipMallocArray_Negative_3ChannelElement") { } // The bit channel description should not allow any channels after a zero channel -TEST_CASE("Unit_hipMallocArray_Negative_ChannelAfterZeroChannel") { +TEST_CASE(Unit_hipMallocArray_Negative_ChannelAfterZeroChannel) { CHECK_IMAGE_SUPPORT const int bits = GENERATE(8, 16, 32); @@ -703,7 +690,7 @@ TEST_CASE("Unit_hipMallocArray_Negative_ChannelAfterZeroChannel") { } // The channel format should be one of the defined formats -TEST_CASE("Unit_hipMallocArray_Negative_InvalidChannelFormat") { +TEST_CASE(Unit_hipMallocArray_Negative_InvalidChannelFormat) { CHECK_IMAGE_SUPPORT const int bits = 32; @@ -730,7 +717,7 @@ TEST_CASE("Unit_hipMallocArray_Negative_InvalidChannelFormat") { // hipMallocArray should handle the max numeric value gracefully. -TEST_CASE("Unit_hipMallocArray_Negative_NumericLimit") { +TEST_CASE(Unit_hipMallocArray_Negative_NumericLimit) { CHECK_IMAGE_SUPPORT hipArray_t arrayPtr; diff --git a/catch/unit/memory/hipMallocAsync.cc b/catch/unit/memory/hipMallocAsync.cc index fe6cf9fcb..f4ed78269 100644 --- a/catch/unit/memory/hipMallocAsync.cc +++ b/catch/unit/memory/hipMallocAsync.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include "mempool_common.hh" @@ -47,7 +34,7 @@ static constexpr int streamPerAsic = 2; * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_Basic_OneAlloc") { +TEST_CASE(Unit_hipMallocAsync_Basic_OneAlloc) { MallocMemPoolAsync_OneAlloc( [](void** dev_ptr, size_t size, hipMemPool_t mem_pool, hipStream_t stream) { return hipMallocAsync(dev_ptr, size, stream); @@ -67,7 +54,7 @@ TEST_CASE("Unit_hipMallocAsync_Basic_OneAlloc") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_Basic_TwoAllocs") { +TEST_CASE(Unit_hipMallocAsync_Basic_TwoAllocs) { MallocMemPoolAsync_TwoAllocs( [](void** dev_ptr, size_t size, hipMemPool_t mem_pool, hipStream_t stream) { return hipMallocAsync(dev_ptr, size, stream); @@ -86,7 +73,7 @@ TEST_CASE("Unit_hipMallocAsync_Basic_TwoAllocs") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_Basic_Reuse") { +TEST_CASE(Unit_hipMallocAsync_Basic_Reuse) { MallocMemPoolAsync_Reuse([](void** dev_ptr, size_t size, hipMemPool_t mem_pool, hipStream_t stream) { return hipMallocAsync(dev_ptr, size, stream); }, MemPools::dev_default); @@ -108,7 +95,7 @@ TEST_CASE("Unit_hipMallocAsync_Basic_Reuse") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMallocAsync_Negative_Parameters) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); checkMempoolSupported(0) @@ -165,7 +152,7 @@ static bool checkMallocAsync(hipStream_t stream) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_basic") { +TEST_CASE(Unit_hipMallocAsync_basic) { checkMempoolSupported(0); // create a stream hipStream_t stream; @@ -187,7 +174,7 @@ TEST_CASE("Unit_hipMallocAsync_basic") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_Multistream_Concurrent") { +TEST_CASE(Unit_hipMallocAsync_Multistream_Concurrent) { checkMempoolSupported(0) streamMemAllocTest testObj1(NUM_ELM), testObj2(NUM_ELM); // create multiple streams hipStream_t stream1, stream2; @@ -234,7 +221,7 @@ TEST_CASE("Unit_hipMallocAsync_Multistream_Concurrent") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_StreamEvent_CrissCross") { +TEST_CASE(Unit_hipMallocAsync_StreamEvent_CrissCross) { checkMempoolSupported(0) streamMemAllocTest testObj1(NUM_ELM), testObj2(NUM_ELM); // create two streams. hipStream_t stream1, stream2; @@ -291,7 +278,7 @@ TEST_CASE("Unit_hipMallocAsync_StreamEvent_CrissCross") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_Multidevice", "[multigpu]") { +TEST_CASE(Unit_hipMallocAsync_Multidevice) { int num_devices; HIP_CHECK(hipGetDeviceCount(&num_devices)); for (int i = 0; i < num_devices; i++) { @@ -331,7 +318,7 @@ static void threadQAsyncCommands(streamMemAllocTest* testObj, hipStream_t strm, testObj->freeDevBuf(strm); } -TEST_CASE("Unit_hipMallocAsync_Multidevice_Concurrent", "[multigpu]") { +TEST_CASE(Unit_hipMallocAsync_Multidevice_Concurrent) { int num_devices; HIP_CHECK(hipGetDeviceCount(&num_devices)); checkIfMultiDev(num_devices) hipStream_t* stream_buf = new hipStream_t[num_devices]; @@ -380,7 +367,7 @@ TEST_CASE("Unit_hipMallocAsync_Multidevice_Concurrent", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_Multidevice_MultiStream", "[multigpu]") { +TEST_CASE(Unit_hipMallocAsync_Multidevice_MultiStream) { int num_devices; HIP_CHECK(hipGetDeviceCount(&num_devices)); checkIfMultiDev(num_devices) @@ -438,7 +425,7 @@ TEST_CASE("Unit_hipMallocAsync_Multidevice_MultiStream", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_ByUsinghipMalloc") { +TEST_CASE(Unit_hipMallocAsync_ByUsinghipMalloc) { checkMempoolSupported(0) size_t byte_size = NUM_ELM * sizeof(float); // create a stream hipStream_t stream; @@ -484,7 +471,7 @@ TEST_CASE("Unit_hipMallocAsync_ByUsinghipMalloc") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_ByUsinghipFree") { +TEST_CASE(Unit_hipMallocAsync_ByUsinghipFree) { size_t byte_size = NUM_ELM * sizeof(float); checkMempoolSupported(0) // create a stream @@ -557,7 +544,7 @@ static bool testhipMallocAsyncMThreadLocalStrm() { return status; } -TEST_CASE("Unit_hipMallocAsync_MThread_ThreadLocalStream") { +TEST_CASE(Unit_hipMallocAsync_MThread_ThreadLocalStream) { checkMempoolSupported(0) REQUIRE(true == testhipMallocAsyncMThreadLocalStrm()); } @@ -595,7 +582,7 @@ static bool testhipMallocAsyncMThreadLocalStrm(hipStream_t stream) { return status; } -TEST_CASE("Unit_hipMallocAsync_MThread_ThreadSharedStream") { +TEST_CASE(Unit_hipMallocAsync_MThread_ThreadSharedStream) { checkMempoolSupported(0) hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); REQUIRE(true == testhipMallocAsyncMThreadLocalStrm(stream)); @@ -614,7 +601,7 @@ TEST_CASE("Unit_hipMallocAsync_MThread_ThreadSharedStream") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocAsync_DefaultStreams_Concurrent") { +TEST_CASE(Unit_hipMallocAsync_DefaultStreams_Concurrent) { checkMempoolSupported(0) streamMemAllocTest testObj[3] = { streamMemAllocTest(NUM_ELM), streamMemAllocTest(NUM_ELM), streamMemAllocTest(NUM_ELM)}; // create multiple streams diff --git a/catch/unit/memory/hipMallocFromPoolAsync.cc b/catch/unit/memory/hipMallocFromPoolAsync.cc index b0eca5a6a..5aec81ff4 100644 --- a/catch/unit/memory/hipMallocFromPoolAsync.cc +++ b/catch/unit/memory/hipMallocFromPoolAsync.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include "mempool_common.hh" @@ -46,7 +33,7 @@ static hipMemPool_t mem_pool_common; * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_Basic_OneAlloc") { +TEST_CASE(Unit_hipMallocFromPoolAsync_Basic_OneAlloc) { MallocMemPoolAsync_OneAlloc( [](void** dev_ptr, size_t size, hipMemPool_t mem_pool, hipStream_t stream) { return hipMallocFromPoolAsync(dev_ptr, size, mem_pool, stream); @@ -67,7 +54,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_Basic_OneAlloc") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_Basic_TwoAllocs") { +TEST_CASE(Unit_hipMallocFromPoolAsync_Basic_TwoAllocs) { MallocMemPoolAsync_TwoAllocs( [](void** dev_ptr, size_t size, hipMemPool_t mem_pool, hipStream_t stream) { return hipMallocFromPoolAsync(dev_ptr, size, mem_pool, stream); @@ -86,7 +73,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_Basic_TwoAllocs") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_Basic_Reuse") { +TEST_CASE(Unit_hipMallocFromPoolAsync_Basic_Reuse) { MallocMemPoolAsync_Reuse( [](void** dev_ptr, size_t size, hipMemPool_t mem_pool, hipStream_t stream) { return hipMallocFromPoolAsync(dev_ptr, size, mem_pool, stream); @@ -110,7 +97,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_Basic_Reuse") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMallocFromPoolAsync_Negative_Parameters) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); @@ -287,7 +274,7 @@ static bool checkMaximumAndDefaultThreshold(hipStream_t stream, int N, enum eTes * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_ReleaseThreshold") { +TEST_CASE(Unit_hipMallocFromPoolAsync_ReleaseThreshold) { checkMempoolSupported(0) // create a stream hipStream_t stream; @@ -308,7 +295,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_ReleaseThreshold") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_NullStream") { +TEST_CASE(Unit_hipMallocFromPoolAsync_NullStream) { checkMempoolSupported(0) constexpr int N = 1 << 20; REQUIRE(true == checkMaximumAndDefaultThreshold(0, N, testdefault)); REQUIRE(true == checkMaximumAndDefaultThreshold(0, N, testMaximum)); @@ -324,7 +311,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_NullStream") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_hipStreamPerThread") { +TEST_CASE(Unit_hipMallocFromPoolAsync_hipStreamPerThread) { checkMempoolSupported(0) constexpr int N = 1 << 20; REQUIRE(true == checkMaximumAndDefaultThreshold(hipStreamPerThread, N, testdefault)); REQUIRE(true == checkMaximumAndDefaultThreshold(hipStreamPerThread, N, testMaximum)); @@ -340,7 +327,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_hipStreamPerThread") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_ReleaseThreshold_Mgpu", "[multigpu]") { +TEST_CASE(Unit_hipMallocFromPoolAsync_ReleaseThreshold_Mgpu) { constexpr int N = 1 << 20; int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -575,7 +562,7 @@ static bool checkReuseAllowOtherFlags(int N, hipMemPoolAttr attr, enum eTestValu * - HIP_VERSION >= 6.2 */ #if HT_AMD -TEST_CASE("Unit_hipMallocFromPoolAsync_Multidevice_Concurrent", "[multigpu]") { +TEST_CASE(Unit_hipMallocFromPoolAsync_Multidevice_Concurrent) { auto testType = GENERATE(testdefault, testMaximum); constexpr int N = 1 << 20; int num_devices; @@ -627,7 +614,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_Multidevice_Concurrent", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_Multidevice_MultiStream", "[multigpu]") { +TEST_CASE(Unit_hipMallocFromPoolAsync_Multidevice_MultiStream) { int num_devices; auto testType = GENERATE(testdefault, testMaximum); constexpr int N = 1 << 20; @@ -694,11 +681,11 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_Multidevice_MultiStream", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_MThread_DefaultThresh") { +TEST_CASE(Unit_hipMallocFromPoolAsync_MThread_DefaultThresh) { checkMempoolSupported(0) REQUIRE(true == test_hipMallocFromPoolAsync_MThread(testdefault)); } -TEST_CASE("Unit_hipMallocFromPoolAsync_MThread_MaxThresh") { +TEST_CASE(Unit_hipMallocFromPoolAsync_MThread_MaxThresh) { checkMempoolSupported(0) REQUIRE(true == test_hipMallocFromPoolAsync_MThread(testMaximum)); } @@ -714,12 +701,12 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_MThread_MaxThresh") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_MThread_CommonMpool_DefaultMempool") { +TEST_CASE(Unit_hipMallocFromPoolAsync_MThread_CommonMpool_DefaultMempool) { checkMempoolSupported(0) REQUIRE(true == test_hipMallocFromPoolAsync_MThread_CommonMpool(testdefault, true)); } -TEST_CASE("Unit_hipMallocFromPoolAsync_MThread_CommonMpool_MaxThresh") { +TEST_CASE(Unit_hipMallocFromPoolAsync_MThread_CommonMpool_MaxThresh) { checkMempoolSupported(0) REQUIRE(true == test_hipMallocFromPoolAsync_MThread_CommonMpool(testMaximum, false)); } @@ -737,7 +724,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_MThread_CommonMpool_MaxThresh") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_MultStream_Sync") { +TEST_CASE(Unit_hipMallocFromPoolAsync_MultStream_Sync) { checkMempoolSupported(0) constexpr int N = 1 << 20; REQUIRE(true == checkMempoolMultStreamSync(N)); } @@ -755,7 +742,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_MultStream_Sync") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_MultStream_DefaultStreams") { +TEST_CASE(Unit_hipMallocFromPoolAsync_MultStream_DefaultStreams) { checkMempoolSupported(0) constexpr int N = 1 << 20; REQUIRE(true == checkMempoolMultStreamConcurrentExec(N, true)); } @@ -772,7 +759,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_MultStream_DefaultStreams") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_MultStream_UserStreams") { +TEST_CASE(Unit_hipMallocFromPoolAsync_MultStream_UserStreams) { checkMempoolSupported(0) constexpr int N = 1 << 20; REQUIRE(true == checkMempoolMultStreamConcurrentExec(N, false)); } @@ -788,7 +775,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_MultStream_UserStreams") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_ReuseFollowEventDependencies") { +TEST_CASE(Unit_hipMallocFromPoolAsync_ReuseFollowEventDependencies) { checkMempoolSupported(0) constexpr int N = 1 << 20; REQUIRE(true == checkReuseFollowEventDepFlag(N, testDisabled)); REQUIRE(true == checkReuseFollowEventDepFlag(N, testEnabled)); @@ -805,7 +792,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_ReuseFollowEventDependencies") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_ReuseAllowOpportunistic") { +TEST_CASE(Unit_hipMallocFromPoolAsync_ReuseAllowOpportunistic) { checkMempoolSupported(0) constexpr int N = 1 << 20; REQUIRE(true == checkReuseAllowOtherFlags(N, hipMemPoolReuseAllowOpportunistic, testDisabled)); REQUIRE(true == checkReuseAllowOtherFlags(N, hipMemPoolReuseAllowOpportunistic, testEnabled)); @@ -822,7 +809,7 @@ TEST_CASE("Unit_hipMallocFromPoolAsync_ReuseAllowOpportunistic") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMallocFromPoolAsync_ReuseAllowInternalDependencies") { +TEST_CASE(Unit_hipMallocFromPoolAsync_ReuseAllowInternalDependencies) { checkMempoolSupported(0) constexpr int N = 1 << 20; REQUIRE(true == checkReuseAllowOtherFlags(N, hipMemPoolReuseAllowInternalDependencies, testDisabled)); diff --git a/catch/unit/memory/hipMallocHost.cc b/catch/unit/memory/hipMallocHost.cc index 2423b3a08..86cc88687 100644 --- a/catch/unit/memory/hipMallocHost.cc +++ b/catch/unit/memory/hipMallocHost.cc @@ -1,30 +1,14 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include static __global__ void write_integer(int* memory, int value) { *memory = value; } -TEST_CASE("Unit_hipMallocHost_Positive") { +TEST_CASE(Unit_hipMallocHost_Positive) { int* host_memory = nullptr; HIP_CHECK(hipMallocHost(reinterpret_cast(&host_memory), sizeof(int))); @@ -32,7 +16,7 @@ TEST_CASE("Unit_hipMallocHost_Positive") { HIP_CHECK(hipHostFree(host_memory)); } -TEST_CASE("Unit_hipMallocHost_DataValidation") { +TEST_CASE(Unit_hipMallocHost_DataValidation) { int validation_number = 10; int* host_memory = nullptr; hipEvent_t event = nullptr; @@ -60,7 +44,7 @@ TEST_CASE("Unit_hipMallocHost_DataValidation") { HIP_CHECK(hipHostFree(host_memory)); } -TEST_CASE("Unit_hipMallocHost_Negative") { +TEST_CASE(Unit_hipMallocHost_Negative) { int* host_memory = nullptr; SECTION("host memory is nullptr") { @@ -72,7 +56,7 @@ TEST_CASE("Unit_hipMallocHost_Negative") { } } -TEST_CASE("Unit_hipMallocHost_Capture") { +TEST_CASE(Unit_hipMallocHost_Capture) { int* host_memory = nullptr; hipError_t capture_error = hipSuccess; diff --git a/catch/unit/memory/hipMallocManaged.cc b/catch/unit/memory/hipMallocManaged.cc index 1f25f12df..7678d0c32 100644 --- a/catch/unit/memory/hipMallocManaged.cc +++ b/catch/unit/memory/hipMallocManaged.cc @@ -1,20 +1,7 @@ /* - 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* Test Case Description: @@ -57,7 +44,7 @@ static unsigned threadsPerBlock{256}; /* This testcase verifies the hipMallocManaged basic scenario - supported on all devices */ -TEST_CASE("Unit_hipMallocManaged_Basic") { +TEST_CASE(Unit_hipMallocManaged_Basic) { auto managed = HmmAttrPrint(); if (managed != 1) { WARN( @@ -79,7 +66,7 @@ TEST_CASE("Unit_hipMallocManaged_Basic") { This testcase verifies the hipMallocManaged advanced scenario - supported only on HMM enabled devices */ -TEST_CASE("Unit_hipMallocManaged_Advanced") { +TEST_CASE(Unit_hipMallocManaged_Advanced) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -151,7 +138,7 @@ TEST_CASE("Unit_hipMallocManaged_Advanced") { This testcase verifies that hipMallocManaged returns an OutOfMemory error for allocations much larger than the available memory - supported on all devices */ -TEST_CASE("Unit_hipMallocManaged_Large") { +TEST_CASE(Unit_hipMallocManaged_Large) { auto managed = HmmAttrPrint(); if (managed != 1) { WARN( diff --git a/catch/unit/memory/hipMallocManagedFlagsTst.cc b/catch/unit/memory/hipMallocManagedFlagsTst.cc index 5891de5fb..d9f97d33b 100644 --- a/catch/unit/memory/hipMallocManagedFlagsTst.cc +++ b/catch/unit/memory/hipMallocManagedFlagsTst.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hipMallocManagedCommon.hh" #include @@ -31,7 +15,7 @@ __global__ void MallcMangdFlgTst(int n, float* x, float* y) { } // The following section tests working of hipMallocManaged with flag parameters -TEST_CASE("Unit_hipMallocManaged_FlgParam", "[multigpu]") { +TEST_CASE(Unit_hipMallocManaged_FlgParam) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -119,7 +103,7 @@ TEST_CASE("Unit_hipMallocManaged_FlgParam", "[multigpu]") { // The following function tests Memory access allocated using hipMallocManaged // in multiple streams -TEST_CASE("Unit_hipMallocManaged_AccessMultiStream", "[multigpu]") { +TEST_CASE(Unit_hipMallocManaged_AccessMultiStream) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); diff --git a/catch/unit/memory/hipMallocManaged_MultiScenario.cc b/catch/unit/memory/hipMallocManaged_MultiScenario.cc index 186fdca36..824251513 100644 --- a/catch/unit/memory/hipMallocManaged_MultiScenario.cc +++ b/catch/unit/memory/hipMallocManaged_MultiScenario.cc @@ -1,20 +1,7 @@ /* - 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* @@ -73,7 +60,7 @@ void HostKernelDouble(float* Hmm, float* hPtr, size_t n) { /* This testcase verifies the concurrent access of hipMallocManaged Memory on host and device. */ -TEST_CASE("Unit_hipMallocManaged_HostDeviceConcurrent") { +TEST_CASE(Unit_hipMallocManaged_HostDeviceConcurrent) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -110,7 +97,7 @@ TEST_CASE("Unit_hipMallocManaged_HostDeviceConcurrent") { // Equal parts of Hmm is accessed and // kernel is launched on acessed chunk of hmm memory // and checks if there are any inconsistencies or access issues -TEST_CASE("Unit_hipMallocManaged_MultiChunkSingleDevice") { +TEST_CASE(Unit_hipMallocManaged_MultiChunkSingleDevice) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -162,7 +149,7 @@ TEST_CASE("Unit_hipMallocManaged_MultiChunkSingleDevice") { // Equal parts of Hmm is accessed on available gpus and // kernel is launched on acessed chunk of hmm memory // and checks if there are any inconsistencies or access issues -TEST_CASE("Unit_hipMallocManaged_MultiChunkMultiDevice", "[multigpu]") { +TEST_CASE(Unit_hipMallocManaged_MultiChunkMultiDevice) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -218,7 +205,7 @@ TEST_CASE("Unit_hipMallocManaged_MultiChunkMultiDevice", "[multigpu]") { } // The following tests oversubscription hipMallocManaged() api -TEST_CASE("Unit_hipMallocManaged_OverSubscription") { +TEST_CASE(Unit_hipMallocManaged_OverSubscription) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -245,7 +232,7 @@ TEST_CASE("Unit_hipMallocManaged_OverSubscription") { // The following test does negative testing of hipMallocManaged() api // by passing invalid values and check if the behavior is as expected -TEST_CASE("Unit_hipMallocManaged_Negative") { +TEST_CASE(Unit_hipMallocManaged_Negative) { void* A; size_t total = 0, free = 0; HIP_CHECK(hipMemGetInfo(&free, &total)); @@ -305,7 +292,7 @@ TEST_CASE("Unit_hipMallocManaged_Negative") { // Allocate two pointers using hipMallocManaged(), initialize, // then launch kernel using these pointers directly and // later validate the content without using any Memcpy. -TEMPLATE_TEST_CASE("Unit_hipMallocManaged_TwoPointers", "[multigpu]", int, +TEMPLATE_TEST_CASE(Unit_hipMallocManaged_TwoPointers, int, float, double) { auto managed = HmmAttrPrint(); if (managed != 1) { @@ -346,7 +333,7 @@ TEMPLATE_TEST_CASE("Unit_hipMallocManaged_TwoPointers", "[multigpu]", int, // to all other devices. This include verification and Device two Device // transfers and kernel launch o discover if there any access issues. -TEMPLATE_TEST_CASE("Unit_hipMallocManaged_DeviceContextChange", "[multigpu]", +TEMPLATE_TEST_CASE(Unit_hipMallocManaged_DeviceContextChange, unsigned char, int, float, double) { auto managed = HmmAttrPrint(); if (managed != 1) { diff --git a/catch/unit/memory/hipMallocMipmappedArray.cc b/catch/unit/memory/hipMallocMipmappedArray.cc index 1789142db..0bf46de48 100644 --- a/catch/unit/memory/hipMallocMipmappedArray.cc +++ b/catch/unit/memory/hipMallocMipmappedArray.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* hipMallocMipmappedArray API test scenarios @@ -75,7 +62,7 @@ static void MallocMipmappedArray_DiffSizes(int gpu) { } } -TEST_CASE("Unit_hipMallocMipmappedArray_DiffSizes") { +TEST_CASE(Unit_hipMallocMipmappedArray_DiffSizes) { MallocMipmappedArray_DiffSizes(0); HIP_CHECK_THREAD_FINALIZE(); } @@ -85,7 +72,7 @@ This testcase verifies the hipMallocMipmappedArray API in multithreaded scenario by launching threads in parallel on multiple GPUs and verifies the hipMallocMipmappedArray API with small and big chunks data */ -TEST_CASE("Unit_hipMallocMipmappedArray_MultiThread", "[multigpu]") { +TEST_CASE(Unit_hipMallocMipmappedArray_MultiThread) { std::vector threadlist; int devCnt = 0; devCnt = HipTest::getDeviceCount(); @@ -131,7 +118,7 @@ void checkMipmappedArrayIsExpected(hipArray_t level_array, } } // namespace -TEMPLATE_TEST_CASE("Unit_hipMallocMipmappedArray_happy", "", char, uint2, int4, short4, float) { +TEMPLATE_TEST_CASE(Unit_hipMallocMipmappedArray_happy, char, uint2, int4, short4, float) { hipMipmappedArray_t array; const auto desc = hipCreateChannelDesc(); #if HT_AMD @@ -185,7 +172,7 @@ hipExtent makeMipmappedExtent(unsigned int flag, size_t s) { } // Providing the array pointer as nullptr should return an error -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_NullArrayPtr") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_NullArrayPtr) { hipChannelFormatDesc desc = hipCreateChannelDesc(); unsigned int numLevels = 1; constexpr size_t s = 6; @@ -197,7 +184,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_NullArrayPtr") { } // Providing the description pointer as nullptr should return an error -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_NullDescPtr") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_NullDescPtr) { constexpr size_t s = 6; // 6 to keep cubemap happy unsigned int numLevels = 1; hipMipmappedArray_t array; @@ -210,7 +197,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_NullDescPtr") { } // Zero width arrays are not allowed -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_ZeroWidth") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_ZeroWidth) { constexpr size_t s = 6; // 6 to keep cubemap happy unsigned int numLevels = 1; hipMipmappedArray_t array; @@ -223,7 +210,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_ZeroWidth") { } // Zero height arrays are only allowed for 1D arrays and layered arrays -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_ZeroHeight") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_ZeroHeight) { constexpr size_t s = 6; // 6 to keep cubemap happy unsigned int numLevels = 1; hipMipmappedArray_t array; @@ -241,7 +228,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_ZeroHeight") { } } -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_InvalidFlags") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_InvalidFlags) { constexpr size_t s = 6; // 6 to keep cubemap happy unsigned int numLevels = 1; hipMipmappedArray_t array; @@ -282,13 +269,13 @@ void testInvalidDescriptionMipmapped(hipChannelFormatDesc desc) { expectedError, hipErrorNotSupported); } -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_InvalidFormat") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_InvalidFormat) { hipChannelFormatDesc desc = hipCreateChannelDesc(); desc.f = GENERATE(hipChannelFormatKindNone, 0xBEEF); testInvalidDescriptionMipmapped(desc); } -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_BadChannelLayout") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_BadChannelLayout) { const int bits = GENERATE(8, 16, 32); const hipChannelFormatKind formatKind = GENERATE(hipChannelFormatKindSigned, hipChannelFormatKindUnsigned, hipChannelFormatKindFloat); @@ -309,7 +296,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_BadChannelLayout") { testInvalidDescriptionMipmapped(desc); } -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_8BitFloat") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_8BitFloat) { hipChannelFormatDesc desc = GENERATE(hipCreateChannelDesc(8, 0, 0, 0, hipChannelFormatKindFloat), hipCreateChannelDesc(8, 8, 0, 0, hipChannelFormatKindFloat), hipCreateChannelDesc(8, 8, 8, 8, hipChannelFormatKindFloat)); @@ -317,7 +304,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_8BitFloat") { testInvalidDescriptionMipmapped(desc); } -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_DifferentChannelSizes") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_DifferentChannelSizes) { const int bitsX = GENERATE(8, 16, 32); const int bitsY = GENERATE(8, 16, 32); const int bitsZ = GENERATE(8, 16, 32); @@ -340,7 +327,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_DifferentChannelSizes") { testInvalidDescriptionMipmapped(desc); } -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_BadChannelSize") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_BadChannelSize) { const int badBits = GENERATE(-1, 0, 10, 100); const hipChannelFormatKind formatKind = GENERATE(hipChannelFormatKindSigned, hipChannelFormatKindUnsigned, hipChannelFormatKindFloat); @@ -353,7 +340,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_BadChannelSize") { // hipMallocMipmappedArray should handle the max numeric value gracefully. -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_NumericLimit") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_NumericLimit) { hipMipmappedArray_t arrayPtr; unsigned int numLevels = 1; hipChannelFormatDesc desc = hipCreateChannelDesc(); @@ -366,7 +353,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_NumericLimit") { } // texture gather arrays are only allowed to be 2D -TEMPLATE_TEST_CASE("Unit_hipMallocMipmappedArray_Negative_Non2DTextureGather", "", char, uchar2, +TEMPLATE_TEST_CASE(Unit_hipMallocMipmappedArray_Negative_Non2DTextureGather, char, uchar2, float2) { #if HT_AMD HipTest::HIP_SKIP_TEST("Texture Gather arrays not supported using AMD backend"); @@ -384,7 +371,7 @@ TEMPLATE_TEST_CASE("Unit_hipMallocMipmappedArray_Negative_Non2DTextureGather", " hipErrorInvalidValue); } -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_NumLevels") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_NumLevels) { hipMipmappedArray_t array; constexpr size_t size = 6; unsigned int numLevels = floor(log2(size)) + 2; @@ -401,7 +388,7 @@ TEST_CASE("Unit_hipMallocMipmappedArray_Negative_NumLevels") { #endif } -TEST_CASE("Unit_hipGetMipmappedArrayLevel_Negative") { +TEST_CASE(Unit_hipGetMipmappedArrayLevel_Negative) { constexpr size_t s = 6; unsigned int numLevels = 1; hipMipmappedArray_t array; diff --git a/catch/unit/memory/hipMallocMngdMultiThread.cc b/catch/unit/memory/hipMallocMngdMultiThread.cc index 7ee31832d..32bf38010 100644 --- a/catch/unit/memory/hipMallocMngdMultiThread.cc +++ b/catch/unit/memory/hipMallocMngdMultiThread.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include "hipMallocManagedCommon.hh" #include @@ -297,7 +282,7 @@ static void AllocateHmmMemory(int flag, int device) { } } -TEST_CASE("Unit_hipMallocManaged_MultiThread", "[multigpu]") { +TEST_CASE(Unit_hipMallocManaged_MultiThread) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -351,7 +336,7 @@ TEST_CASE("Unit_hipMallocManaged_MultiThread", "[multigpu]") { // The following test checks what happens when same Hmm memory is used to // launch multiple threads over multiple gpus -TEST_CASE("Unit_hipMallocManaged_MGpuMThread", "[multigpu]") { +TEST_CASE(Unit_hipMallocManaged_MGpuMThread) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -394,7 +379,7 @@ TEST_CASE("Unit_hipMallocManaged_MGpuMThread", "[multigpu]") { // The following test checks what happens when multiple kernels are launched // with same Hmm memory -TEST_CASE("Unit_hipMallocManaged_MultiKrnlComnHmm") { +TEST_CASE(Unit_hipMallocManaged_MultiKrnlComnHmm) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -429,7 +414,7 @@ TEST_CASE("Unit_hipMallocManaged_MultiKrnlComnHmm") { // The following test checks what happens when multiple kernels are launched // with same hipMalloc() memory -TEST_CASE("Unit_hipMallocManaged_MultiKrnlComnMalloc") { +TEST_CASE(Unit_hipMallocManaged_MultiKrnlComnMalloc) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -460,7 +445,7 @@ TEST_CASE("Unit_hipMallocManaged_MultiKrnlComnMalloc") { // The following section tests the scenario wherein multiple threads use their // own stream to launch kernel on common Hmm memory -TEST_CASE("Unit_hipMallocManaged_MultiThrdMultiStrm") { +TEST_CASE(Unit_hipMallocManaged_MultiThrdMultiStrm) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); @@ -494,7 +479,7 @@ TEST_CASE("Unit_hipMallocManaged_MultiThrdMultiStrm") { // The following section tests the scenario wherein two threads each use // different kernel but common HMM memory -TEST_CASE("Unit_hipMallocManaged_TwoKrnlsComnHmmMem") { +TEST_CASE(Unit_hipMallocManaged_TwoKrnlsComnHmmMem) { auto managed = HmmAttrPrint(); if (managed != 1) { HipTest::HIP_SKIP_TEST("GPU doesn't support managed memory so skipping test."); diff --git a/catch/unit/memory/hipMallocPitch.cc b/catch/unit/memory/hipMallocPitch.cc index 28dae095b..49d0474a4 100644 --- a/catch/unit/memory/hipMallocPitch.cc +++ b/catch/unit/memory/hipMallocPitch.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -131,7 +115,7 @@ hipExtent generateExtent(AllocationApi api) { } -TEST_CASE("Unit_hipMalloc3D_ValidatePitch") { +TEST_CASE(Unit_hipMalloc3D_ValidatePitch) { CHECK_IMAGE_SUPPORT hipPitchedPtr hipPitchedPtr; @@ -142,7 +126,7 @@ TEST_CASE("Unit_hipMalloc3D_ValidatePitch") { HIP_CHECK(hipFree(hipPitchedPtr.ptr)); } -TEST_CASE("Unit_hipMemAllocPitch_ValidatePitch") { +TEST_CASE(Unit_hipMemAllocPitch_ValidatePitch) { CHECK_IMAGE_SUPPORT size_t pitch = 0; @@ -163,7 +147,7 @@ TEST_CASE("Unit_hipMemAllocPitch_ValidatePitch") { HIP_CHECK(hipFree(reinterpret_cast(ptr))); } -TEST_CASE("Unit_hipMallocPitch_ValidatePitch") { +TEST_CASE(Unit_hipMallocPitch_ValidatePitch) { CHECK_IMAGE_SUPPORT size_t pitch = 0; @@ -174,7 +158,7 @@ TEST_CASE("Unit_hipMallocPitch_ValidatePitch") { HIP_CHECK(hipFree(ptr)); } -TEST_CASE("Unit_hipMalloc3D_Negative") { +TEST_CASE(Unit_hipMalloc3D_Negative) { CHECK_IMAGE_SUPPORT SECTION("Invalid ptr") { @@ -212,7 +196,7 @@ TEST_CASE("Unit_hipMalloc3D_Negative") { #endif } -TEST_CASE("Unit_hipMallocPitch_Negative") { +TEST_CASE(Unit_hipMallocPitch_Negative) { CHECK_IMAGE_SUPPORT size_t pitch = 0; @@ -239,7 +223,7 @@ TEST_CASE("Unit_hipMallocPitch_Negative") { } } -TEST_CASE("Unit_hipMallocPitch_Zero_Dims") { +TEST_CASE(Unit_hipMallocPitch_Zero_Dims) { CHECK_IMAGE_SUPPORT void* ptr = nullptr; @@ -256,7 +240,7 @@ TEST_CASE("Unit_hipMallocPitch_Zero_Dims") { } } -TEST_CASE("Unit_hipMemAllocPitch_Negative") { +TEST_CASE(Unit_hipMemAllocPitch_Negative) { CHECK_IMAGE_SUPPORT size_t pitch = 0; @@ -389,7 +373,7 @@ static void threadFunc(int gpu) { MemoryAllocDiffSizes(gpu); } * hipMallocPitch API for different datatypes * */ -TEMPLATE_TEST_CASE("Unit_hipMallocPitch_Basic", "[hipMallocPitch]", int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_hipMallocPitch_Basic, int, unsigned int, float) { CHECK_IMAGE_SUPPORT TestType* A_d; @@ -404,7 +388,7 @@ TEMPLATE_TEST_CASE("Unit_hipMallocPitch_Basic", "[hipMallocPitch]", int, unsigne * This testcase verifies hipMallocPitch API for small * and big chunks of data. */ -TEMPLATE_TEST_CASE("Unit_hipMallocPitch_SmallandBigChunks", "[hipMallocPitch]", int, unsigned int, +TEMPLATE_TEST_CASE(Unit_hipMallocPitch_SmallandBigChunks, int, unsigned int, float) { CHECK_IMAGE_SUPPORT @@ -415,7 +399,7 @@ TEMPLATE_TEST_CASE("Unit_hipMallocPitch_SmallandBigChunks", "[hipMallocPitch]", * This testcase verifies the memory allocated by hipMallocPitch API * by performing Memcpy2D on the allocated memory. */ -TEMPLATE_TEST_CASE("Unit_hipMallocPitch_Memcpy2D", "", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMallocPitch_Memcpy2D, int, float, double) { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); @@ -460,7 +444,7 @@ scenario by launching threads in parallel on multiple GPUs and verifies the hipMallocPitch API with small and big chunks data */ -TEST_CASE("Unit_hipMallocPitch_MultiThread", "[multigpu]") { +TEST_CASE(Unit_hipMallocPitch_MultiThread) { CHECK_IMAGE_SUPPORT std::vector threadlist; @@ -483,7 +467,7 @@ TEST_CASE("Unit_hipMallocPitch_MultiThread", "[multigpu]") { * variable to another kernel variable. * 3. Validating the result */ -TEMPLATE_TEST_CASE("Unit_hipMallocPitch_KernelLaunch", "", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMallocPitch_KernelLaunch, int, float, double) { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); diff --git a/catch/unit/memory/hipMemAdvise.cc b/catch/unit/memory/hipMemAdvise.cc index 0d5f5a6b0..e02743842 100644 --- a/catch/unit/memory/hipMemAdvise.cc +++ b/catch/unit/memory/hipMemAdvise.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -65,7 +50,7 @@ std::vector GetDevicesWithAdviseSupport() { return supported_devices; } -TEST_CASE("Unit_hipMemAdvise_Set_Unset_Basic") { +TEST_CASE(Unit_hipMemAdvise_Set_Unset_Basic) { auto supported_devices = GetDevicesWithAdviseSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test needs at least 1 device that supports managed memory"); @@ -95,7 +80,7 @@ TEST_CASE("Unit_hipMemAdvise_Set_Unset_Basic") { SECTION("hipMemAdviseSetPreferredLocation") { SetUnset(hipMemAdviseSetPreferredLocation); } } -TEST_CASE("Unit_hipMemAdvise_No_Flag_Interference") { +TEST_CASE(Unit_hipMemAdvise_No_Flag_Interference) { auto supported_devices = GetDevicesWithAdviseSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test needs at least 1 device that supports managed memory"); @@ -123,7 +108,7 @@ TEST_CASE("Unit_hipMemAdvise_No_Flag_Interference") { } } -TEST_CASE("Unit_hipMemAdvise_Rounding") { +TEST_CASE(Unit_hipMemAdvise_Rounding) { auto supported_devices = GetDevicesWithAdviseSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test needs at least 1 device that supports managed memory"); @@ -155,7 +140,7 @@ TEST_CASE("Unit_hipMemAdvise_Rounding") { static_cast(attribute)); } -TEST_CASE("Unit_hipMemAdvise_Flags_Do_Not_Cause_Prefetch") { +TEST_CASE(Unit_hipMemAdvise_Flags_Do_Not_Cause_Prefetch) { auto supported_devices = GetDevicesWithAdviseSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test needs at least 1 device that supports managed memory"); @@ -182,7 +167,7 @@ TEST_CASE("Unit_hipMemAdvise_Flags_Do_Not_Cause_Prefetch") { #endif } -TEST_CASE("Unit_hipMemAdvise_Read_Write_After_Advise", "[multigpu]") { +TEST_CASE(Unit_hipMemAdvise_Read_Write_After_Advise) { auto supported_devices = GetDevicesWithAdviseSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test needs at least 1 device that supports managed memory"); @@ -227,7 +212,7 @@ TEST_CASE("Unit_hipMemAdvise_Read_Write_After_Advise", "[multigpu]") { #endif } -TEST_CASE("Unit_hipMemAdvise_Prefetch_After_Advise") { +TEST_CASE(Unit_hipMemAdvise_Prefetch_After_Advise) { auto supported_devices = GetDevicesWithAdviseSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test needs at least 1 device that supports managed memory"); @@ -259,7 +244,7 @@ TEST_CASE("Unit_hipMemAdvise_Prefetch_After_Advise") { REQUIRE((advice == hipMemAdviseSetReadMostly ? 1 : device) == attribute); } -TEST_CASE("Unit_hipMemAdvise_AccessedBy_All_Devices") { +TEST_CASE(Unit_hipMemAdvise_AccessedBy_All_Devices) { auto supported_devices = GetDevicesWithAdviseSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test needs at least 1 device that supports managed memory"); @@ -279,7 +264,7 @@ TEST_CASE("Unit_hipMemAdvise_AccessedBy_All_Devices") { REQUIRE_THAT(accessed_by, Catch::Matchers::Equals(supported_devices)); } -TEST_CASE("Unit_hipMemAdvise_Negative_Parameters") { +TEST_CASE(Unit_hipMemAdvise_Negative_Parameters) { auto supported_devices = GetDevicesWithAdviseSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test needs at least 1 device that supports managed memory"); diff --git a/catch/unit/memory/hipMemAdviseMmap.cc b/catch/unit/memory/hipMemAdviseMmap.cc index 25249593c..f44411e24 100644 --- a/catch/unit/memory/hipMemAdviseMmap.cc +++ b/catch/unit/memory/hipMemAdviseMmap.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #ifdef __linux__ @@ -30,7 +17,7 @@ THE SOFTWARE. hipMemAdvise() works with mmap() memory */ -TEST_CASE("Unit_hipMemAdvise_MmapMem") { +TEST_CASE(Unit_hipMemAdvise_MmapMem) { int managed = 0, PageableMem = 0; INFO( "The following are the attribute values related to HMM for" diff --git a/catch/unit/memory/hipMemAdvise_AlignedAllocMem_Exe.cc b/catch/unit/memory/hipMemAdvise_AlignedAllocMem_Exe.cc index 815a64bfb..dec7cba70 100644 --- a/catch/unit/memory/hipMemAdvise_AlignedAllocMem_Exe.cc +++ b/catch/unit/memory/hipMemAdvise_AlignedAllocMem_Exe.cc @@ -1,23 +1,8 @@ -/* Copyright (c) 2024 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #if __linux__ #include diff --git a/catch/unit/memory/hipMemAdvise_old.cc b/catch/unit/memory/hipMemAdvise_old.cc index 4130d64b6..48da6f393 100644 --- a/catch/unit/memory/hipMemAdvise_old.cc +++ b/catch/unit/memory/hipMemAdvise_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021-2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Test Case Description: Scenario-1: The following Function Tests the working of flags which can be @@ -84,32 +71,20 @@ __global__ void MemAdvseKernel(int n, int* x) { // Kernel __global__ void MemAdvise2(int* Hmm, int n) { - int index = blockIdx.x * blockDim.x + threadIdx.x; - int stride = blockDim.x * gridDim.x; - for (int i = index; i < n; i += stride) { + int i = blockIdx.x * blockDim.x + threadIdx.x; + if (i < n) { Hmm[i] = Hmm[i] + 10; } } // Kernel __global__ void MemAdvise3(int* Hmm, int* Hmm1, int n) { - int index = blockIdx.x * blockDim.x + threadIdx.x; - int stride = blockDim.x * gridDim.x; - for (int i = index; i < n; i += stride) { + int i = blockIdx.x * blockDim.x + threadIdx.x; + if (i < n) { Hmm1[i] = Hmm[i] + 10; } } - -static bool CheckError(hipError_t err, int LineNo) { - if (err == hipSuccess) { - WARN("Error expected but received hipSuccess at line no.:" << LineNo); - return false; - } else { - return true; - } -} - static int HmmAttrPrint() { int managed = 0; WARN( @@ -130,306 +105,10 @@ static int HmmAttrPrint() { return managed; } - -// The following Function Tests the working of flags which can be assigned -// to HMM memory using hipMemAdvise() api -TEST_CASE("Unit_hipMemAdvise_TstFlags") { - int MangdMem = HmmAttrPrint(); - if (MangdMem == 1) { - bool IfTestPassed = true; - int NumDevs = 0, *Outpt = nullptr; - int MEM_SIZE = 4 * 1024, A_CONST = 9999; - float* Hmm = nullptr; - int AttrVal = 0; - HIP_CHECK(hipGetDeviceCount(&NumDevs)); - Outpt = new int[NumDevs]; - HIP_CHECK(hipMallocManaged(&Hmm, MEM_SIZE * 2, hipMemAttachGlobal)); - // With the following for loop we iterate through each of the Gpus in the - // system set and unset the flags and check the behavior. - for (int i = 0; i < NumDevs; ++i) { - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE * 2, hipMemAdviseSetReadMostly, i)); - HIP_CHECK(hipMemRangeGetAttribute(&AttrVal, sizeof(AttrVal), hipMemRangeAttributeReadMostly, - Hmm, MEM_SIZE * 2)); - if (AttrVal != 1) { - WARN("Attempt to set hipMemAdviseSetReadMostly flag failed!\n"); - IfTestPassed = false; - } - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE * 2, hipMemAdviseUnsetReadMostly, i)); - - HIP_CHECK(hipMemRangeGetAttribute(&AttrVal, sizeof(AttrVal), hipMemRangeAttributeReadMostly, - Hmm, (MEM_SIZE * 2))); - if (AttrVal != 0) { - WARN("Attempt to Unset hipMemAdviseSetReadMostly flag failed!\n"); - IfTestPassed = false; - } - AttrVal = A_CONST; - // Currently hipMemAdviseSetPreferredLocation and - // hipMemAdviseSetAccessedBy - // flags are resulting in issues: SWDEV-267357 - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE * 2, hipMemAdviseSetPreferredLocation, i)); - HIP_CHECK(hipMemRangeGetAttribute( - &AttrVal, sizeof(AttrVal), hipMemRangeAttributePreferredLocation, Hmm, (MEM_SIZE * 2))); - if (AttrVal != i) { - WARN("Attempt to set hipMemAdviseSetPreferredLocation flag failed!\n"); - IfTestPassed = false; - } - AttrVal = A_CONST; - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE * 2, hipMemAdviseUnsetPreferredLocation, i)); - HIP_CHECK(hipMemRangeGetAttribute( - &AttrVal, sizeof(AttrVal), hipMemRangeAttributePreferredLocation, Hmm, (MEM_SIZE * 2))); - if (AttrVal == i) { - WARN("Attempt to Unset hipMemAdviseUnsetPreferredLocation "); - WARN("flag failed!\n"); - IfTestPassed = false; - } - for (int m = 0; m < NumDevs; ++m) { - Outpt[m] = A_CONST; - } - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE * 2, hipMemAdviseSetAccessedBy, i)); - HIP_CHECK(hipMemRangeGetAttribute(Outpt, sizeof(int) * NumDevs, hipMemRangeAttributeAccessedBy, Hmm, - (MEM_SIZE * 2))); - if ((Outpt[0]) != i) { - WARN("Attempt to set hipMemAdviseSetAccessedBy flag failed!\n"); - IfTestPassed = false; - } - for (int m = 0; m < NumDevs; ++m) { - Outpt[m] = A_CONST; - } - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE * 2, hipMemAdviseUnsetAccessedBy, i)); - HIP_CHECK(hipMemRangeGetAttribute(Outpt, sizeof(int) * NumDevs, hipMemRangeAttributeAccessedBy, Hmm, - (MEM_SIZE * 2))); - if ((Outpt[0]) >= 0) { - WARN("Attempt to Unset hipMemAdviseUnsetAccessedBy flag failed!\n"); - IfTestPassed = false; - } - } - delete[] Outpt; - HIP_CHECK(hipFree(Hmm)); - REQUIRE(IfTestPassed); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - -TEST_CASE("Unit_hipMemAdvise_NegtveTsts") { - int MangdMem = HmmAttrPrint(); - if (MangdMem == 1) { - bool IfTestPassed = true; - int NumDevs = 0, MEM_SIZE = 4 * 1024; - float* Hmm = nullptr; - std::string str; - HIP_CHECK(hipGetDeviceCount(&NumDevs)); - HIP_CHECK(hipMallocManaged(&Hmm, MEM_SIZE * 2, hipMemAttachGlobal)); - // Passing NULL as first parameter instead of valid pointer to a memory - IfTestPassed &= - CheckError(hipMemAdvise(NULL, MEM_SIZE * 2, hipMemAdviseSetReadMostly, 0), __LINE__); - - // Passing 0 for count(2nd param) parameter - IfTestPassed &= CheckError(hipMemAdvise(Hmm, 0, hipMemAdviseSetReadMostly, 0), __LINE__); - - // Passing count much more than actually allocated value - IfTestPassed &= - CheckError(hipMemAdvise(Hmm, MEM_SIZE * 6, hipMemAdviseSetReadMostly, 0), __LINE__); - - REQUIRE(IfTestPassed); - HIP_CHECK(hipFree(Hmm)); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - -// The following function tests various scenarios around the flag -// 'hipMemAdviseSetPreferredLocation' using HMM memory and hipMemAdvise() api -TEST_CASE("Unit_hipMemAdvise_PrefrdLoc", "[multigpu]") { - int MangdMem = HmmAttrPrint(); - if (MangdMem == 1) { - // Check that when a page fault occurs for the memory region set to devPtr, - // the data is migrated to the destn processor - int MEM_SIZE = 4096, A_CONST = 9999; - int *Hmm = nullptr, NumDevs = 0, dev = A_CONST; - bool IfTestPassed = true; - HIP_CHECK(hipGetDeviceCount(&NumDevs)); - HIP_CHECK(hipMallocManaged(&Hmm, MEM_SIZE * 3, hipMemAttachGlobal)); - for (int i = 0; i < ((MEM_SIZE * 3) / 4); ++i) { - Hmm[i] = 4; - } - for (int devId = 0; devId < NumDevs; ++devId) { - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE * 3, hipMemAdviseSetPreferredLocation, devId)); - int NumElms = ((MEM_SIZE * 3) / 4); - MemAdvseKernel<<>>(NumElms, Hmm); - int dev = A_CONST; - HIP_CHECK(hipMemRangeGetAttribute(&dev, sizeof(dev), hipMemRangeAttributePreferredLocation, - Hmm, MEM_SIZE * 3)); - if (dev != devId) { - WARN("Memory observed to be not available on expected location\n"); - WARN("line no: " << __LINE__); - WARN("dev: " << dev); - IfTestPassed = false; - } - } - - // Check that when preferred location is set for a memory region, - // data can still be prefetched using hipMemPrefetchAsync - hipStream_t strm; - dev = A_CONST; - for (int devId = 0; devId < NumDevs; ++devId) { - HIP_CHECK(hipSetDevice(devId)); - HIP_CHECK(hipStreamCreate(&strm)); - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE * 3, hipMemAdviseSetPreferredLocation, devId)); - HIP_CHECK(hipMemPrefetchAsync(Hmm, MEM_SIZE * 3, devId, strm)); - HIP_CHECK(hipStreamSynchronize(strm)); - HIP_CHECK(hipMemRangeGetAttribute(&dev, sizeof(dev), hipMemRangeAttributeLastPrefetchLocation, - Hmm, MEM_SIZE * 3)); - if (dev != devId) { - WARN("Memory reported to be not available at the Prefetched "); - WARN("location with device id: " << devId); - WARN("line no: " << __LINE__); - WARN("dev: " << dev); - IfTestPassed = false; - } - HIP_CHECK(hipStreamDestroy(strm)); - } - HIP_CHECK(hipFree(Hmm)); - REQUIRE(IfTestPassed); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - -// The following function tests various scenarios around the flag -// 'hipMemAdviseSetReadMostly' using HMM memory and hipMemAdvise() api - -TEST_CASE("Unit_hipMemAdvise_ReadMostly") { - int MangdMem = HmmAttrPrint(); - if (MangdMem == 1) { - bool IfTestPassed = true; - int MEM_SIZE = 4096, A_CONST = 9999; - float* Hmm = nullptr; - HIP_CHECK(hipMallocManaged(&Hmm, MEM_SIZE)); - for (uint64_t i = 0; i < (MEM_SIZE / sizeof(float)); ++i) { - Hmm[i] = A_CONST; - } - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetReadMostly, 0)); - // Checking if the data can be read after setting hipMemAdviseSetReadMostly - for (uint64_t i = 0; i < (MEM_SIZE / sizeof(float)); ++i) { - if (Hmm[i] != A_CONST) { - WARN("Didn't find expected value in Hmm memory after setting"); - WARN(" hipMemAdviseSetReadMostly flag line no.: " << __LINE__); - IfTestPassed = false; - } - } - - // Checking if the memory region can be modified - for (uint64_t i = 0; i < (MEM_SIZE / sizeof(float)); ++i) { - Hmm[i] = A_CONST; - } - - for (uint64_t i = 0; i < (MEM_SIZE / sizeof(float)); ++i) { - if (Hmm[i] != A_CONST) { - WARN("Didn't find expected value in Hmm memory after Modification\n"); - WARN("line no.: " << __LINE__); - IfTestPassed = false; - } - } - - int out = A_CONST; - HIP_CHECK(hipMemRangeGetAttribute(&out, 4, hipMemRangeAttributeReadMostly, Hmm, MEM_SIZE)); - if (out != 1) { - WARN("out value: " << out); - IfTestPassed = false; - } - // Checking the advise attribute after prefetch - HIP_CHECK(hipMemPrefetchAsync(Hmm, MEM_SIZE, 0, 0)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK( - hipMemRangeGetAttribute(&out, sizeof(int), hipMemRangeAttributeReadMostly, Hmm, MEM_SIZE)); - if (out != 1) { - WARN("Attribute assigned to memory changed after calling "); - WARN("hipMemPrefetchAsync(). line no.: " << __LINE__); - WARN("out value: " << out); - IfTestPassed = false; - } - // hipMemAdvise should succeed for SetReadMostly and UnsetReadMostly - // irrespective of the device - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetReadMostly, 99)); - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseUnsetReadMostly, -12)); - - HIP_CHECK(hipFree(Hmm)); - REQUIRE(IfTestPassed); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - -// The following function verifies if assigning of a flag invalidates the -// earlier flag which was assigned to the same memory region using -// hipMemAdvise() -TEST_CASE("Unit_hipMemAdvise_TstFlgOverrideEffect") { - int MangdMem = HmmAttrPrint(); - if (MangdMem == 1) { - bool IfTestPassed = true; - int MEM_SIZE = 4 * 4096, A_CONST = 9999; - float* Hmm = nullptr; - int NumDevs = 0, dev = A_CONST; - - HIP_CHECK(hipGetDeviceCount(&NumDevs)); - HIP_CHECK(hipMallocManaged(&Hmm, MEM_SIZE, hipMemAttachGlobal)); - for (int i = 0; i < NumDevs; ++i) { - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetReadMostly, i)); - HIP_CHECK(hipMemRangeGetAttribute(&dev, sizeof(int), hipMemRangeAttributeReadMostly, Hmm, - MEM_SIZE)); - if (dev != 1) { - WARN("hipMemAdviseSetReadMostly flag did not take affect despite "); - WARN("setting it using hipMemAdvise(). line no.: " << __LINE__); - IfTestPassed = false; - break; - } - dev = A_CONST; - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetPreferredLocation, i)); - HIP_CHECK(hipMemRangeGetAttribute(&dev, sizeof(int), hipMemRangeAttributePreferredLocation, - Hmm, MEM_SIZE)); - if (dev != i) { - WARN("hipMemAdviseSetPreferredLocation flag did not take affect "); - WARN("despite setting it using hipMemAdvise()\n"); - WARN("line no.: " << __LINE__); - IfTestPassed = false; - break; - } - - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetAccessedBy, i)); - dev = A_CONST; - HIP_CHECK(hipMemRangeGetAttribute(&dev, sizeof(int), hipMemRangeAttributeAccessedBy, Hmm, - MEM_SIZE)); - if (dev != i) { - WARN("hipMemAdviseSetAccessedBy flag did not take affect despite "); - WARN("setting it using hipMemAdvise(). line no.: " << __LINE__); - IfTestPassed = false; - break; - } - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseUnsetAccessedBy, i)); - } - HIP_CHECK(hipFree(Hmm)); - REQUIRE(IfTestPassed); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - - // The following function tests if peers can set hipMemAdviseSetAccessedBy flag // on HMM memory prefetched on each of the other gpus #if HT_AMD -TEST_CASE("Unit_hipMemAdvise_TstAccessedByPeer", "[multigpu]") { +TEST_CASE(Unit_hipMemAdvise_TstAccessedByPeer) { int MangdMem = HmmAttrPrint(); if (MangdMem == 1) { bool IfTestPassed = true; @@ -483,33 +162,10 @@ TEST_CASE("Unit_hipMemAdvise_TstAccessedByPeer", "[multigpu]") { } #endif - -/* Set AccessedBy flag and check value returned by hipMemRangeGetAttribute() - It should be -2(same is observed on cuda)*/ -TEST_CASE("Unit_hipMemAdvise_TstAccessedByFlg") { - int managed = HmmAttrPrint(); - if (managed == 1) { - int *Hmm = NULL, data = 999; - HIP_CHECK(hipMallocManaged(&Hmm, 2 * 4096)); - HIP_CHECK(hipMemAdvise(Hmm, 2 * 4096, hipMemAdviseSetAccessedBy, 0)); - HIP_CHECK(hipMemRangeGetAttribute(&data, sizeof(int), hipMemRangeAttributeLastPrefetchLocation, - Hmm, 2 * 4096)); - HIP_CHECK(hipFree(Hmm)); - if (data != -2) { - WARN("Didnt get expected value!!\n"); - REQUIRE(false); - } - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - /* Set AccessedBy flag to device 0 on Hmm memory and prefetch the memory to device 1, then probe for AccessedBy flag using hipMemRangeGetAttribute() we should still see the said flag is set for device 0*/ -TEST_CASE("Unit_hipMemAdvise_TstAccessedByFlg2") { +TEST_CASE(Unit_hipMemAdvise_TstAccessedByFlg2) { int managed = HmmAttrPrint(); if (managed == 1) { int *Hmm = NULL, data = 999, Ngpus = 0; @@ -545,7 +201,7 @@ TEST_CASE("Unit_hipMemAdvise_TstAccessedByFlg2") { PreferredLocation to device 1, check for AccessedBy flag using hipMemRangeGetAttribute() it should return 1*/ -TEST_CASE("Unit_hipMemAdvise_TstAccessedByFlg3") { +TEST_CASE(Unit_hipMemAdvise_TstAccessedByFlg3) { int managed = HmmAttrPrint(); if (managed == 1) { int *Hmm = NULL, data = 999, Ngpus = 0; @@ -582,51 +238,40 @@ TEST_CASE("Unit_hipMemAdvise_TstAccessedByFlg3") { /* Set AccessedBy flag to HMM memory launch a kernel and then unset AccessedBy, launch kernel. We should not have any access issues*/ -TEST_CASE("Unit_hipMemAdvise_TstAccessedByFlg4") { +TEST_CASE(Unit_hipMemAdvise_TstAccessedByFlg4) { int managed = HmmAttrPrint(); if (managed == 1) { - int *Hmm = NULL, NumElms = (1024 * 1024), InitVal = 123, blockSize = 64; - int DataMismatch = 0; + int *Hmm = NULL, NumElms = (1024 * 1024), InitVal = 123, blockSize = 1024; hipStream_t strm; HIP_CHECK(hipStreamCreate(&strm)); HIP_CHECK(hipMallocManaged(&Hmm, (NumElms * sizeof(int)))); - HIP_CHECK(hipMemAdvise(Hmm, (NumElms * sizeof(int)), hipMemAdviseSetAccessedBy, 0)); // Initializing memory for (int i = 0; i < NumElms; ++i) { Hmm[i] = InitVal; } - dim3 dimBlock(blockSize, 1, 1); - dim3 dimGrid((NumElms + blockSize - 1) / blockSize, 1, 1); + HIP_CHECK(hipMemAdvise(Hmm, (NumElms * sizeof(int)), hipMemAdviseSetAccessedBy, 0)); + HIP_CHECK(hipMemPrefetchAsync(Hmm, (NumElms * sizeof(int)), 0, strm)); + HIP_CHECK(hipDeviceSynchronize()); // launching kernel from each one of the gpus - MemAdvise2<<>>(Hmm, NumElms); - HIP_CHECK(hipStreamSynchronize(strm)); + MemAdvise2<<<1024, 1024, 0, strm>>>(Hmm, NumElms); + HIP_CHECK(hipDeviceSynchronize()); // verifying the final result for (int i = 0; i < NumElms; ++i) { - if (Hmm[i] != (InitVal + 10)) { - DataMismatch++; - } - } - - if (DataMismatch != 0) { - WARN("DataMismatch is observed at line: " << __LINE__); - REQUIRE(false); + INFO("index: " << i << " Hmm[i]: " << Hmm[i] << " Expected: " << (InitVal + 10)); + REQUIRE(Hmm[i] == (InitVal + 10)); } HIP_CHECK(hipMemAdvise(Hmm, (NumElms * sizeof(int)), hipMemAdviseUnsetAccessedBy, 0)); - MemAdvise2<<>>(Hmm, NumElms); - HIP_CHECK(hipStreamSynchronize(strm)); + HIP_CHECK(hipDeviceSynchronize()); + MemAdvise2<<<1024, 1024, 0, strm>>>(Hmm, NumElms); + HIP_CHECK(hipDeviceSynchronize()); // verifying the final result for (int i = 0; i < NumElms; ++i) { - if (Hmm[i] != (InitVal + (2 * 10))) { - DataMismatch++; - } + INFO("index: " << i << " Hmm[i]: " << Hmm[i] << " Expected: " << (InitVal + 20)); + REQUIRE(Hmm[i] == (InitVal + 20)); } - if (DataMismatch != 0) { - WARN("DataMismatch is observed at line: " << __LINE__); - REQUIRE(false); - } HIP_CHECK(hipFree(Hmm)); HIP_CHECK(hipStreamDestroy(strm)); } else { @@ -640,7 +285,7 @@ TEST_CASE("Unit_hipMemAdvise_TstAccessedByFlg4") { the allocated memory and launch a kernel. Kernel should get executed successfully without hang or segfault*/ #if __linux__ && HT_AMD -TEST_CASE("Unit_hipMemAdvise_TstAlignedAllocMem") { +TEST_CASE(Unit_hipMemAdvise_TstAlignedAllocMem) { // The following code block checks for xnack+ // so as to skip if the device is not xnack+ hipDeviceProp_t prop; @@ -670,7 +315,7 @@ TEST_CASE("Unit_hipMemAdvise_TstAlignedAllocMem") { HIP_CHECK(hipMemAdvise(Mllc, MemSz, hipMemAdviseSetPreferredLocation, 0)); HIP_CHECK(hipMemPrefetchAsync(Mllc, MemSz, 0, strm)); HIP_CHECK(hipStreamSynchronize(strm)); - MemAdvise2<<<(NumElms / 32), 32, 0, strm>>>(Mllc, NumElms); + MemAdvise2<<<4, 1024, 0, strm>>>(Mllc, NumElms); HIP_CHECK(hipStreamSynchronize(strm)); for (int i = 0; i < NumElms; ++i) { if (Mllc[i] != (InitVal + 10)) { @@ -686,7 +331,7 @@ TEST_CASE("Unit_hipMemAdvise_TstAlignedAllocMem") { } } -TEST_CASE("Unit_hipMemAdvise_TstAlignedAllocMem_XNACK") { +TEST_CASE(Unit_hipMemAdvise_TstAlignedAllocMem_XNACK) { if (setenv("HSA_XNACK", "1", 1) != 0) { HipTest::HIP_SKIP_TEST("Unable to set xnack on environment variable."); return; @@ -707,108 +352,13 @@ TEST_CASE("Unit_hipMemAdvise_TstAlignedAllocMem_XNACK") { } #endif -/* Allocate Hmm memory, set advise to PreferredLocation and then get - attribute using the api hipMemRangeGetAttribute() for - hipMemRangeAttributeLastPrefetchLocation the value returned should be -2*/ - -TEST_CASE("Unit_hipMemAdvise_TstMemAdvisePrefrdLoc") { - int managed = HmmAttrPrint(); - if (managed == 1) { - int *Hmm = NULL, data = 999; - HIP_CHECK(hipMallocManaged(&Hmm, 4096)); - HIP_CHECK(hipMemAdvise(Hmm, 4096, hipMemAdviseSetPreferredLocation, 0)); - HIP_CHECK(hipMemRangeGetAttribute(&data, sizeof(int), hipMemRangeAttributeLastPrefetchLocation, - Hmm, 4096)); - if (data != -2) { - WARN("Didnt receive expected value."); - REQUIRE(false); - } - HIP_CHECK(hipFree(Hmm)); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - - -/* Allocate HMM memory, set PreferredLocation to device 0, Prfetch the mem - to device1, probe for hipMemRangeAttributeLastPrefetchLocation using - hipMemRangeGetAttribute(), we should get 1*/ - -TEST_CASE("Unit_hipMemAdvise_TstMemAdviseLstPreftchLoc", "[multigpu]") { - int NumDevs = 0; - HIP_CHECK(hipGetDeviceCount(&NumDevs)); - if (NumDevs >= 2) { - int managed = HmmAttrPrint(); - if (managed == 1) { - int *Hmm = NULL, data = 999; - hipStream_t strm; - HIP_CHECK(hipSetDevice(1)); - HIP_CHECK(hipStreamCreate(&strm)); - HIP_CHECK(hipMallocManaged(&Hmm, 4096)); - HIP_CHECK(hipMemAdvise(Hmm, 4096, hipMemAdviseSetPreferredLocation, 0)); - HIP_CHECK(hipMemPrefetchAsync(Hmm, 4096, 1, strm)); - HIP_CHECK(hipStreamSynchronize(strm)); - HIP_CHECK(hipMemRangeGetAttribute(&data, sizeof(int), - hipMemRangeAttributeLastPrefetchLocation, Hmm, 4096)); - if (data != 1) { - WARN("Didnt receive expected value!!"); - REQUIRE(false); - } - HIP_CHECK(hipStreamDestroy(strm)); - HIP_CHECK(hipFree(Hmm)); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } - } else { - SUCCEED("This system has less than 2 gpus hence skipping the test.\n"); - } -} - - -/* Allocate HMM memory, set ReadMostly followed by PreferredLocation, probe - for hipMemRangeAttributeReadMostly and hipMemRangeAttributePreferredLocation - using hipMemRangeGetAttribute() we should observe 1 and 0 correspondingly. - In other words setting of hipMemRangeAttributePreferredLocation should not - impact hipMemRangeAttributeReadMostly advise to the memory*/ - -TEST_CASE("Unit_hipMemAdvise_TstMemAdviseMultiFlag") { - int managed = HmmAttrPrint(); - if (managed == 1) { - int *Hmm = NULL, data = 999; - HIP_CHECK(hipMallocManaged(&Hmm, 4096)); - HIP_CHECK(hipMemAdvise(Hmm, 4096, hipMemAdviseSetReadMostly, 0)); - HIP_CHECK(hipMemAdvise(Hmm, 4096, hipMemAdviseSetPreferredLocation, 0)); - HIP_CHECK( - hipMemRangeGetAttribute(&data, sizeof(int), hipMemRangeAttributeReadMostly, Hmm, 4096)); - if (data != 1) { - WARN("Didnt receive expected value at line: " << data); - REQUIRE(false); - } - HIP_CHECK(hipMemRangeGetAttribute(&data, sizeof(int), hipMemRangeAttributePreferredLocation, - Hmm, 4096)); - if (data != 0) { - WARN("Didnt receive expected value at line: " << data); - REQUIRE(false); - } - HIP_CHECK(hipFree(Hmm)); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - /*Allocate Hmm memory, advise it to ReadMostly for gpu: 0 and launch kernel on all other gpus except 0. This test case may discover any effect or access denial case arising due to setting ReadMostly only to a particular gpu*/ -TEST_CASE("Unit_hipMemAdvise_ReadMosltyMgpuTst", "[multigpu]") { +TEST_CASE(Unit_hipMemAdvise_ReadMosltyMgpuTst) { int managed = HmmAttrPrint(); if (managed == 1) { int Ngpus = 0; @@ -818,7 +368,7 @@ TEST_CASE("Unit_hipMemAdvise_ReadMosltyMgpuTst", "[multigpu]") { "This test needs atleast two gpus to run." "Hence skipping the test.\n"); } - int *Hmm = NULL, NumElms = (1024 * 1024), InitVal = 123, blockSize = 64; + int *Hmm = NULL, NumElms = (1024 * 1024), InitVal = 123; int *Hmm1 = NULL, DataMismatch = 0; hipStream_t strm; HIP_CHECK(hipMallocManaged(&Hmm, (NumElms * sizeof(int)))); @@ -827,8 +377,6 @@ TEST_CASE("Unit_hipMemAdvise_ReadMosltyMgpuTst", "[multigpu]") { Hmm[i] = InitVal; } HIP_CHECK(hipMemAdvise(Hmm, (NumElms * sizeof(int)), hipMemAdviseSetReadMostly, 0)); - dim3 dimBlock(blockSize, 1, 1); - dim3 dimGrid((NumElms + blockSize - 1) / blockSize, 1, 1); #if HT_AMD SECTION("Launch Kernel on all other gpus") { // launching kernel from each one of the gpus @@ -837,7 +385,7 @@ TEST_CASE("Unit_hipMemAdvise_ReadMosltyMgpuTst", "[multigpu]") { HIP_CHECK(hipSetDevice(i)); HIP_CHECK(hipStreamCreate(&strm)); HIP_CHECK(hipMallocManaged(&Hmm1, (NumElms * sizeof(int)))); - MemAdvise3<<>>(Hmm, Hmm1, NumElms); + MemAdvise3<<<1024, 1024, 0, strm>>>(Hmm, Hmm1, NumElms); HIP_CHECK(hipStreamSynchronize(strm)); // verifying the results for (int j = 0; j < NumElms; ++j) { @@ -860,7 +408,7 @@ TEST_CASE("Unit_hipMemAdvise_ReadMosltyMgpuTst", "[multigpu]") { HIP_CHECK(hipSetDevice(i)); HIP_CHECK(hipStreamCreate(&strm)); HIP_CHECK(hipMemAdvise(Hmm, (NumElms * sizeof(int)), hipMemAdviseSetReadMostly, i)); - MemAdvise2<<>>(Hmm, NumElms); + MemAdvise2<<<1024, 1024, 0, strm>>>(Hmm, NumElms); HIP_CHECK(hipStreamSynchronize(strm)); HIP_CHECK(hipStreamDestroy(strm)); } @@ -885,32 +433,3 @@ TEST_CASE("Unit_hipMemAdvise_ReadMosltyMgpuTst", "[multigpu]") { "attribute. Hence skipping the testing with Pass result.\n"); } } - - -TEST_CASE("Unit_hipMemAdvise_TstSetUnsetPrfrdLoc") { - int managed = HmmAttrPrint(); - if (managed == 1) { - int *Hmm = NULL, data = 999; - HIP_CHECK(hipMallocManaged(&Hmm, 2 * 4096)); - HIP_CHECK(hipMemAdvise(Hmm, 2 * 4096, hipMemAdviseSetPreferredLocation, 0)); - HIP_CHECK(hipMemRangeGetAttribute(&data, sizeof(int), hipMemRangeAttributePreferredLocation, - Hmm, 2 * 4096)); - if (data != 0) { - WARN("Didnt receive expected value!!"); - REQUIRE(false); - } - HIP_CHECK(hipMemAdvise(Hmm, 2 * 4096, hipMemAdviseUnsetPreferredLocation, 0)); - HIP_CHECK(hipMemRangeGetAttribute(&data, sizeof(int), hipMemRangeAttributePreferredLocation, - Hmm, 2 * 4096)); - if (data != -2) { - WARN("Didnt receive expected value!!"); - REQUIRE(false); - } - - HIP_CHECK(hipFree(Hmm)); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} diff --git a/catch/unit/memory/hipMemAdvise_v2.cc b/catch/unit/memory/hipMemAdvise_v2.cc index ae3d1b779..0fdb9280b 100644 --- a/catch/unit/memory/hipMemAdvise_v2.cc +++ b/catch/unit/memory/hipMemAdvise_v2.cc @@ -1,23 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -70,11 +55,12 @@ static std::vector getSupportedDevices() { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemAdvise_v2_Device_Host", "[multigpu]") { +TEST_CASE(Unit_hipMemAdvise_v2_Device_Host) { auto supportedDevices = getSupportedDevices(); if (supportedDevices.empty()) { HipTest::HIP_SKIP_TEST( "Test need at least one device with managed memory support"); + return; } HIP_CHECK(hipSetDevice(supportedDevices[0])); @@ -157,7 +143,7 @@ TEST_CASE("Unit_hipMemAdvise_v2_Device_Host", "[multigpu]") { * - HIP_VERSION >= 7.1 */ #if __linux__ -TEST_CASE("Unit_hipMemAdvise_v2_HostNuma_HostNumaCurrent") { +TEST_CASE(Unit_hipMemAdvise_v2_HostNuma_HostNumaCurrent) { auto supportedDevices = getSupportedDevices(); if (supportedDevices.empty() || numa_available() < 0) { HipTest::HIP_SKIP_TEST("Skipping as System does not have managed memory " @@ -234,11 +220,12 @@ TEST_CASE("Unit_hipMemAdvise_v2_HostNuma_HostNumaCurrent") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemAdvise_v2_Negative") { +TEST_CASE(Unit_hipMemAdvise_v2_Negative) { auto supportedDevices = getSupportedDevices(); if (supportedDevices.empty()) { HipTest::HIP_SKIP_TEST( "Test need at least one device with managed memory support"); + return; } HIP_CHECK(hipSetDevice(supportedDevices[0])); diff --git a/catch/unit/memory/hipMemAllocHost.cc b/catch/unit/memory/hipMemAllocHost.cc index e2abcff3e..60dfd4fa4 100644 --- a/catch/unit/memory/hipMemAllocHost.cc +++ b/catch/unit/memory/hipMemAllocHost.cc @@ -1,30 +1,14 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include static __global__ void write_integer(int* memory, int value) { *memory = value; } -TEST_CASE("Unit_hipMemAllocHost_Positive") { +TEST_CASE(Unit_hipMemAllocHost_Positive) { int* host_memory = nullptr; hipCtx_t ctx; hipDevice_t device; @@ -37,7 +21,7 @@ TEST_CASE("Unit_hipMemAllocHost_Positive") { HIP_CHECK(hipCtxDestroy(ctx)); } -TEST_CASE("Unit_hipMemAllocHost_DataValidation") { +TEST_CASE(Unit_hipMemAllocHost_DataValidation) { int validation_number = 10; int* host_memory = nullptr; hipEvent_t event = nullptr; @@ -70,7 +54,7 @@ TEST_CASE("Unit_hipMemAllocHost_DataValidation") { HIP_CHECK(hipCtxDestroy(ctx)); } -TEST_CASE("Unit_hipMemAllocHost_Negative") { +TEST_CASE(Unit_hipMemAllocHost_Negative) { int* host_memory = nullptr; hipCtx_t ctx; hipDevice_t device; @@ -93,7 +77,7 @@ TEST_CASE("Unit_hipMemAllocHost_Negative") { /* * Verify that a device can read/write to the memory of another device */ -TEST_CASE("Unit_hipMemAllocHost_VerifyAccess", "[multigpu]") { +TEST_CASE(Unit_hipMemAllocHost_VerifyAccess) { int devices_number = 0; HIP_CHECK(hipGetDeviceCount(&devices_number)); std::vector devices_memories(devices_number); @@ -137,7 +121,7 @@ TEST_CASE("Unit_hipMemAllocHost_VerifyAccess", "[multigpu]") { } } -TEST_CASE("Unit_hipMemAllocHost_Capture") { +TEST_CASE(Unit_hipMemAllocHost_Capture) { int* host_memory = nullptr; hipError_t capture_error = hipSuccess; diff --git a/catch/unit/memory/hipMemCoherencyTst.cc b/catch/unit/memory/hipMemCoherencyTst.cc index d719845ea..930d492e2 100644 --- a/catch/unit/memory/hipMemCoherencyTst.cc +++ b/catch/unit/memory/hipMemCoherencyTst.cc @@ -1,20 +1,7 @@ /* - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* Test Case Description: @@ -104,7 +91,7 @@ static void TstCoherency(int* ptr, MemoryType type) { /* Test case description: The following test validates if fine grain behavior is observed or not with memory allocated using hipHostMalloc()*/ -TEST_CASE("Unit_hipHostMalloc_CoherentTst") { +TEST_CASE(Unit_hipHostMalloc_CoherentTst) { HIP_CHECK(hipSetDevice(0)); CHECK_PCIE_ATOMIC_SUPPORT; @@ -130,7 +117,7 @@ TEST_CASE("Unit_hipHostMalloc_CoherentTst") { // The following tests are disabled for Nvidia as they are not consistently // passing #if HT_AMD -TEST_CASE("Unit_hipMallocManaged_CoherentTst") { +TEST_CASE(Unit_hipMallocManaged_CoherentTst) { HIP_CHECK(hipSetDevice(0)); CHECK_PCIE_ATOMIC_SUPPORT; @@ -160,7 +147,7 @@ TEST_CASE("Unit_hipMallocManaged_CoherentTst") { /* Test case description: The following test validates if memory access is fine with memory allocated using hipMallocManaged() and CoarseGrain Advise*/ -TEST_CASE("Unit_hipMallocManaged_CoherentTstWthAdvise") { +TEST_CASE(Unit_hipMallocManaged_CoherentTstWthAdvise) { HIP_CHECK(hipSetDevice(0)); int *Ptr = nullptr, SIZE = sizeof(int), managed = 0; YES_COHERENT = false; @@ -203,7 +190,7 @@ TEST_CASE("Unit_hipMallocManaged_CoherentTstWthAdvise") { using hipMalloc() are of type Coarse Grain*/ // The following tests are disabled for Nvidia as they are not applicable #if HT_AMD -TEST_CASE("Unit_hipMalloc_CoherentTst") { +TEST_CASE(Unit_hipMalloc_CoherentTst) { HIP_CHECK(hipSetDevice(0)); int *Ptr = nullptr, SIZE = sizeof(int); uint32_t svm_attrib = 0; @@ -223,7 +210,7 @@ TEST_CASE("Unit_hipMalloc_CoherentTst") { behavior is observed or not with memory allocated using hipExtMallocWithFlags()*/ #if HT_AMD -TEST_CASE("Unit_hipExtMallocWithFlags_CoherentTst") { +TEST_CASE(Unit_hipExtMallocWithFlags_CoherentTst) { HIP_CHECK(hipSetDevice(0)); int *Ptr = nullptr, SIZE = sizeof(int), InitVal = 9, Pageable = 0, managed = 0, finegrain = 0; bool FineGrain = true; diff --git a/catch/unit/memory/hipMemGetAddressRange.cc b/catch/unit/memory/hipMemGetAddressRange.cc index d848470d8..8aec56da6 100644 --- a/catch/unit/memory/hipMemGetAddressRange.cc +++ b/catch/unit/memory/hipMemGetAddressRange.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -45,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemGetAddressRange_Positive") { +TEST_CASE(Unit_hipMemGetAddressRange_Positive) { hipDeviceptr_t base_ptr; size_t mem_size = 0; const auto allocation_size = GENERATE(kPageSize / 2, kPageSize, kPageSize * 2); @@ -100,7 +87,7 @@ TEST_CASE("Unit_hipMemGetAddressRange_Positive") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemGetAddressRange_Negative") { +TEST_CASE(Unit_hipMemGetAddressRange_Negative) { hipDeviceptr_t base_ptr; size_t mem_size = 0; const auto allocation_size = kPageSize / 2; diff --git a/catch/unit/memory/hipMemGetInfo.cc b/catch/unit/memory/hipMemGetInfo.cc index 1b4f73a19..e13aa0d27 100644 --- a/catch/unit/memory/hipMemGetInfo.cc +++ b/catch/unit/memory/hipMemGetInfo.cc @@ -1,25 +1,12 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include -TEST_CASE("Unit_hipMemGetInfo_FreeLessThanTotal") { +TEST_CASE(Unit_hipMemGetInfo_FreeLessThanTotal) { unsigned int* A_mem{nullptr}; size_t freeMemInit, totalMemInit; size_t freeMem, totalMem; diff --git a/catch/unit/memory/hipMemGetMemPool.cc b/catch/unit/memory/hipMemGetMemPool.cc index 3e2003aea..383f24695 100644 --- a/catch/unit/memory/hipMemGetMemPool.cc +++ b/catch/unit/memory/hipMemGetMemPool.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include diff --git a/catch/unit/memory/hipMemPoolApi.cc b/catch/unit/memory/hipMemPoolApi.cc index 288d4bc7c..817d593f1 100644 --- a/catch/unit/memory/hipMemPoolApi.cc +++ b/catch/unit/memory/hipMemPoolApi.cc @@ -1,20 +1,7 @@ /* - 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* Test Case Description: @@ -43,7 +30,7 @@ void initMemPoolProps() { This testcase verifies HIP Mem Pool API basic scenario - supported on all devices */ -TEST_CASE("Unit_hipMemPoolApi_Basic") { +TEST_CASE(Unit_hipMemPoolApi_Basic) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -98,7 +85,7 @@ TEST_CASE("Unit_hipMemPoolApi_Basic") { HIP_CHECK(hipStreamDestroy(stream)); } -TEST_CASE("Unit_hipMemPoolApi_BasicAlloc") { +TEST_CASE(Unit_hipMemPoolApi_BasicAlloc) { int mem_pool_support = 0; HIP_CHECK(hipSetDevice(0)); @@ -189,7 +176,7 @@ TEST_CASE("Unit_hipMemPoolApi_BasicAlloc") { HIP_CHECK(hipHostFree(notified)); } -TEST_CASE("Unit_hipMemPoolApi_BasicTrim") { +TEST_CASE(Unit_hipMemPoolApi_BasicTrim) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -277,7 +264,7 @@ TEST_CASE("Unit_hipMemPoolApi_BasicTrim") { HIP_CHECK(hipHostFree(notified)); } -TEST_CASE("Unit_hipMemPoolApi_BasicReuse") { +TEST_CASE(Unit_hipMemPoolApi_BasicReuse) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -352,7 +339,7 @@ TEST_CASE("Unit_hipMemPoolApi_BasicReuse") { HIP_CHECK(hipHostFree(notified)); } -TEST_CASE("Unit_hipMemPoolApi_Opportunistic") { +TEST_CASE(Unit_hipMemPoolApi_Opportunistic) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { @@ -509,7 +496,7 @@ TEST_CASE("Unit_hipMemPoolApi_Opportunistic") { HIP_CHECK(hipHostFree(notified2)); } -TEST_CASE("Unit_hipMemPoolApi_Default") { +TEST_CASE(Unit_hipMemPoolApi_Default) { int mem_pool_support = 0; HIP_CHECK(hipDeviceGetAttribute(&mem_pool_support, hipDeviceAttributeMemoryPoolsSupported, 0)); if (!mem_pool_support) { diff --git a/catch/unit/memory/hipMemPoolCreate.cc b/catch/unit/memory/hipMemPoolCreate.cc index 69d7eb2cd..6bfc18c67 100644 --- a/catch/unit/memory/hipMemPoolCreate.cc +++ b/catch/unit/memory/hipMemPoolCreate.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include @@ -45,7 +32,7 @@ * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolCreate_Negative_Parameter") { +TEST_CASE(Unit_hipMemPoolCreate_Negative_Parameter) { checkMempoolSupported(0) int num_dev = 0; @@ -88,7 +75,7 @@ TEST_CASE("Unit_hipMemPoolCreate_Negative_Parameter") { } } -TEST_CASE("Unit_hipMemPoolCreate_With_maxSize") { +TEST_CASE(Unit_hipMemPoolCreate_With_maxSize) { checkMempoolSupported(0) hipMemPoolProps pool_props; memset(&pool_props, 0, sizeof(pool_props)); pool_props.allocType = hipMemAllocationTypePinned; @@ -119,7 +106,7 @@ TEST_CASE("Unit_hipMemPoolCreate_With_maxSize") { HIP_CHECK(hipStreamDestroy(stream)); } -TEST_CASE("Unit_hipMemPoolCreate_Without_maxSize") { +TEST_CASE(Unit_hipMemPoolCreate_Without_maxSize) { checkMempoolSupported(0) hipMemPoolProps pool_props; memset(&pool_props, 0, sizeof(pool_props)); pool_props.allocType = hipMemAllocationTypePinned; @@ -159,7 +146,7 @@ static __global__ void setKer(int* devptr) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolCreate_DeviceTest", "[multigpu]") { +TEST_CASE(Unit_hipMemPoolCreate_DeviceTest) { checkMempoolSupported(0) int num_devices = 0; HIP_CHECK(hipGetDeviceCount(&num_devices)); checkIfMultiDev(num_devices) diff --git a/catch/unit/memory/hipMemPoolDestroy.cc b/catch/unit/memory/hipMemPoolDestroy.cc index 94ab5769c..cf4566c2d 100644 --- a/catch/unit/memory/hipMemPoolDestroy.cc +++ b/catch/unit/memory/hipMemPoolDestroy.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include "mempool_common.hh" @@ -42,7 +29,7 @@ * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolDestroy_Negative_Parameter") { +TEST_CASE(Unit_hipMemPoolDestroy_Negative_Parameter) { checkMempoolSupported(0) hipMemPool_t mem_pool = nullptr; diff --git a/catch/unit/memory/hipMemPoolExportPointer.cc b/catch/unit/memory/hipMemPoolExportPointer.cc index e7907c564..c34d6f1e0 100644 --- a/catch/unit/memory/hipMemPoolExportPointer.cc +++ b/catch/unit/memory/hipMemPoolExportPointer.cc @@ -1,24 +1,8 @@ -/** -Copyright (c) 2024 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemPoolExportPointer hipMemPoolExportPointer @@ -44,7 +28,7 @@ constexpr size_t byte_size = DATA_SIZE * sizeof(int); * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolExportPointer_Negative") { +TEST_CASE(Unit_hipMemPoolExportPointer_Negative) { hipMemPoolPtrExportData ptrExp; hipShareableHdl sharedHandle; hipMemPoolProps pool_props{}; diff --git a/catch/unit/memory/hipMemPoolExportToShareableHandle.cc b/catch/unit/memory/hipMemPoolExportToShareableHandle.cc index 142b62bf8..7fb28a989 100644 --- a/catch/unit/memory/hipMemPoolExportToShareableHandle.cc +++ b/catch/unit/memory/hipMemPoolExportToShareableHandle.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemPoolExportToShareableHandle hipMemPoolExportToShareableHandle @@ -70,7 +54,7 @@ static void fill_data(std::vector& A_h, std::vector& B_h, std::vector< * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolExportToShareableHandle_SameProc") { +TEST_CASE(Unit_hipMemPoolExportToShareableHandle_SameProc) { hipMemPoolPtrExportData ptrExp; hipShareableHdl sharedHandle; std::vector A_h(DATA_SIZE), B_h(DATA_SIZE), C_h(DATA_SIZE); @@ -130,7 +114,7 @@ TEST_CASE("Unit_hipMemPoolExportToShareableHandle_SameProc") { * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolExportToShareableHandle_ChldUseHdl") { +TEST_CASE(Unit_hipMemPoolExportToShareableHandle_ChldUseHdl) { std::vector A_h(DATA_SIZE), B_h(DATA_SIZE), C_h(DATA_SIZE); fill_data(A_h, B_h, C_h); int fd[2], fdSig[2]; @@ -237,7 +221,7 @@ TEST_CASE("Unit_hipMemPoolExportToShareableHandle_ChldUseHdl") { * - HIP_VERSION >= 6.2 */ #if HT_AMD -TEST_CASE("Unit_hipMemPoolExportToShareableHandle_ChldCheckAccess") { +TEST_CASE(Unit_hipMemPoolExportToShareableHandle_ChldCheckAccess) { int fd[2], fdSig[2]; REQUIRE(pipe(fd) == 0); REQUIRE(pipe(fdSig) == 0); @@ -340,7 +324,7 @@ TEST_CASE("Unit_hipMemPoolExportToShareableHandle_ChldCheckAccess") { * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolExportToShareableHandle_GrndChldUseHdl") { +TEST_CASE(Unit_hipMemPoolExportToShareableHandle_GrndChldUseHdl) { std::vector A_h(DATA_SIZE), B_h(DATA_SIZE), C_h(DATA_SIZE); fill_data(A_h, B_h, C_h); int fd[2], fdSig[2], fdpid[2]; @@ -457,7 +441,7 @@ TEST_CASE("Unit_hipMemPoolExportToShareableHandle_GrndChldUseHdl") { * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolExportToShareableHandle_Negative") { +TEST_CASE(Unit_hipMemPoolExportToShareableHandle_Negative) { hipShareableHdl sharedHandle; hipMemPoolProps pool_props{}; hipMemPool_t mempoolPfd, mempoolwoPfd; diff --git a/catch/unit/memory/hipMemPoolImportFromShareableHandle.cc b/catch/unit/memory/hipMemPoolImportFromShareableHandle.cc index 8b4b3c4cf..1ab751210 100644 --- a/catch/unit/memory/hipMemPoolImportFromShareableHandle.cc +++ b/catch/unit/memory/hipMemPoolImportFromShareableHandle.cc @@ -1,24 +1,8 @@ -/** -Copyright (c) 2024 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemPoolImportFromShareableHandle hipMemPoolImportFromShareableHandle @@ -45,7 +29,7 @@ THE SOFTWARE. * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolImportFromShareableHandle_Negative") { +TEST_CASE(Unit_hipMemPoolImportFromShareableHandle_Negative) { hipShareableHdl sharedHandle; hipMemPoolProps pool_props{}; hipMemPool_t mempoolPfd; diff --git a/catch/unit/memory/hipMemPoolImportPointer.cc b/catch/unit/memory/hipMemPoolImportPointer.cc index 2ad37c727..94c4e9abf 100644 --- a/catch/unit/memory/hipMemPoolImportPointer.cc +++ b/catch/unit/memory/hipMemPoolImportPointer.cc @@ -1,24 +1,8 @@ -/** -Copyright (c) 2024 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemPoolImportPointer hipMemPoolImportPointer @@ -47,7 +31,7 @@ constexpr size_t byte_size = DATA_SIZE * sizeof(int); * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolImportPointer_Negative") { +TEST_CASE(Unit_hipMemPoolImportPointer_Negative) { hipMemPoolPtrExportData ptrExp; hipShareableHdl sharedHandle; hipMemPoolProps pool_props{}; diff --git a/catch/unit/memory/hipMemPoolMaxAlloc.cc b/catch/unit/memory/hipMemPoolMaxAlloc.cc index 680e05788..8074bd143 100644 --- a/catch/unit/memory/hipMemPoolMaxAlloc.cc +++ b/catch/unit/memory/hipMemPoolMaxAlloc.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* Test Case Description: @@ -7400,4 +7387,4 @@ hipError_t Test() { } -TEST_CASE("Unit_hipMemPoolMaxAlloc") { HIP_CHECK(Test()); } +TEST_CASE(Unit_hipMemPoolMaxAlloc) { HIP_CHECK(Test()); } diff --git a/catch/unit/memory/hipMemPoolSetGetAccess.cc b/catch/unit/memory/hipMemPoolSetGetAccess.cc index 200f15a48..1871d1cab 100644 --- a/catch/unit/memory/hipMemPoolSetGetAccess.cc +++ b/catch/unit/memory/hipMemPoolSetGetAccess.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include @@ -66,7 +53,7 @@ static void MemPoolSetGetAccess(const MemPools mempool_type, int src_device, int * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetGetAccess_Positive_Basic") { +TEST_CASE(Unit_hipMemPoolSetGetAccess_Positive_Basic) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); checkMempoolSupported(device) @@ -98,7 +85,7 @@ int CheckP2PMemPoolSupport(int src_device, int dst_device) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetGetAccess_Positive_MultipleGPU", "[multigpu]") { +TEST_CASE(Unit_hipMemPoolSetGetAccess_Positive_MultipleGPU) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -213,7 +200,7 @@ void MemPoolSetGetAccess_P2P(const MemPools mempool_type) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetGetAccess_Positive_P2P", "[multigpu]") { +TEST_CASE(Unit_hipMemPoolSetGetAccess_Positive_P2P) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -243,7 +230,7 @@ TEST_CASE("Unit_hipMemPoolSetGetAccess_Positive_P2P", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetAccess_Negative_Parameters") { +TEST_CASE(Unit_hipMemPoolSetAccess_Negative_Parameters) { CHECK_IMAGE_SUPPORT int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); @@ -409,7 +396,7 @@ static void getDevicePairs(std::vector>* p2p_pairs, int numD * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetAccess_SetAccess", "[multigpu]") { +TEST_CASE(Unit_hipMemPoolSetAccess_SetAccess) { constexpr int N = 1 << 14; int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -438,7 +425,7 @@ TEST_CASE("Unit_hipMemPoolSetAccess_SetAccess", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetAccess_NegTst") { +TEST_CASE(Unit_hipMemPoolSetAccess_NegTst) { checkMempoolSupported(0) hipMemPool_t mem_pool; hipMemPoolProps pool_props{}; pool_props.allocType = hipMemAllocationTypePinned; @@ -518,7 +505,7 @@ TEST_CASE("Unit_hipMemPoolSetAccess_NegTst") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAccess_Negative_Parameters") { +TEST_CASE(Unit_hipMemPoolGetAccess_Negative_Parameters) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); checkMempoolSupported(device_id) MemPoolGuard mempool(MemPools::dev_default, device_id); @@ -628,7 +615,7 @@ static bool checkMempoolSetAccessWithGetUsingArray(int dev0, int dev1) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAccess_SetGet") { +TEST_CASE(Unit_hipMemPoolGetAccess_SetGet) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); checkIfMultiDev(numDevices) for (int dev = 0; dev < numDevices; dev++){ @@ -658,7 +645,7 @@ TEST_CASE("Unit_hipMemPoolGetAccess_SetGet") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAccess_GetDefMempoolOfEachDevice") { +TEST_CASE(Unit_hipMemPoolGetAccess_GetDefMempoolOfEachDevice) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); for (int dev = 0; dev < numDevices; dev++) { diff --git a/catch/unit/memory/hipMemPoolSetGetAttribute.cc b/catch/unit/memory/hipMemPoolSetGetAttribute.cc index 93667cabb..b607e4f9d 100644 --- a/catch/unit/memory/hipMemPoolSetGetAttribute.cc +++ b/catch/unit/memory/hipMemPoolSetGetAttribute.cc @@ -1,21 +1,9 @@ /* - Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + #include "mempool_common.hh" #include #include @@ -47,7 +35,7 @@ template static void MemPoolSetGetAttribute(const hipMemPool_t memp * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetGetAttribute_Positive_Default") { +TEST_CASE(Unit_hipMemPoolSetGetAttribute_Positive_Default) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); checkMempoolSupported(device) @@ -80,7 +68,7 @@ TEST_CASE("Unit_hipMemPoolSetGetAttribute_Positive_Default") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetGetAttribute_Positive_MemBasic") { +TEST_CASE(Unit_hipMemPoolSetGetAttribute_Positive_MemBasic) { const auto device = GENERATE(range(0, HipTest::getDeviceCount())); checkMempoolSupported(device) @@ -115,7 +103,7 @@ TEST_CASE("Unit_hipMemPoolSetGetAttribute_Positive_MemBasic") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetAttribute_Opportunistic") { +TEST_CASE(Unit_hipMemPoolSetAttribute_Opportunistic) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); checkMempoolSupported(device_id) @@ -310,7 +298,7 @@ TEST_CASE("Unit_hipMemPoolSetAttribute_Opportunistic") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetAttribute_EventDependencies") { +TEST_CASE(Unit_hipMemPoolSetAttribute_EventDependencies) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); @@ -437,7 +425,7 @@ TEST_CASE("Unit_hipMemPoolSetAttribute_EventDependencies") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipMemPoolSetAttribute_Negative_Parameters) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); checkMempoolSupported(device_id) MemPoolGuard mempool(MemPools::dev_default, device_id); @@ -496,7 +484,7 @@ static void resetHighValue(hipMemPool_t& memPool) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolSetAttribute_ResetMemHighAttr") { +TEST_CASE(Unit_hipMemPoolSetAttribute_ResetMemHighAttr) { checkMempoolSupported(0) // Create mempool hipMemPool_t mem_pool; @@ -556,7 +544,7 @@ TEST_CASE("Unit_hipMemPoolSetAttribute_ResetMemHighAttr") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipMemPoolGetAttribute_Negative_Parameters) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); checkMempoolSupported(device_id) MemPoolGuard mempool(MemPools::dev_default, device_id); @@ -666,7 +654,7 @@ static bool checkhipMemPoolSetAttribute(hipMemPoolAttr attr, int dev) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAttribute_SetGet") { +TEST_CASE(Unit_hipMemPoolGetAttribute_SetGet) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); for (int dev = 0; dev < numDevices; dev++) { @@ -688,7 +676,7 @@ TEST_CASE("Unit_hipMemPoolGetAttribute_SetGet") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAttribute_UsedMem") { +TEST_CASE(Unit_hipMemPoolGetAttribute_UsedMem) { checkMempoolSupported(0) constexpr int N = 1 << 14; hipMemPool_t mem_pool; hipMemPoolProps pool_props{}; @@ -776,7 +764,7 @@ TEST_CASE("Unit_hipMemPoolGetAttribute_UsedMem") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAttribute_ReservedMem") { +TEST_CASE(Unit_hipMemPoolGetAttribute_ReservedMem) { checkMempoolSupported(0) constexpr int N = 1 << 14; hipMemPool_t mem_pool; hipMemPoolProps pool_props{}; @@ -819,7 +807,7 @@ TEST_CASE("Unit_hipMemPoolGetAttribute_ReservedMem") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAttribute_UsageStatistics") { +TEST_CASE(Unit_hipMemPoolGetAttribute_UsageStatistics) { checkMempoolSupported(0) struct mempoolUsgStat stats; // Create mempool hipMemPool_t mem_pool; @@ -891,7 +879,7 @@ TEST_CASE("Unit_hipMemPoolGetAttribute_UsageStatistics") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAttribute_hipMalloc_DefMempool") { +TEST_CASE(Unit_hipMemPoolGetAttribute_hipMalloc_DefMempool) { checkMempoolSupported(0) struct mempoolUsgStat stats; // Create mempool hipMemPool_t mem_pool; @@ -927,7 +915,7 @@ TEST_CASE("Unit_hipMemPoolGetAttribute_hipMalloc_DefMempool") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolGetAttribute_CheckDefaultValues") { +TEST_CASE(Unit_hipMemPoolGetAttribute_CheckDefaultValues) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); for (int dev = 0; dev < numDevices; dev++) { diff --git a/catch/unit/memory/hipMemPoolTrimTo.cc b/catch/unit/memory/hipMemPoolTrimTo.cc index 08a9df1ab..de9df0b53 100644 --- a/catch/unit/memory/hipMemPoolTrimTo.cc +++ b/catch/unit/memory/hipMemPoolTrimTo.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ @@ -44,7 +31,7 @@ * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolTrimTo_Negative_Parameter") { +TEST_CASE(Unit_hipMemPoolTrimTo_Negative_Parameter) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); checkMempoolSupported(device_id) size_t trim_size = 1024; @@ -66,7 +53,7 @@ TEST_CASE("Unit_hipMemPoolTrimTo_Negative_Parameter") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolTrimTo_Positive_Basic") { +TEST_CASE(Unit_hipMemPoolTrimTo_Positive_Basic) { int device_id = 0; HIP_CHECK(hipSetDevice(device_id)); checkMempoolSupported(device_id) unsigned int* notified = nullptr; @@ -198,7 +185,7 @@ static bool checkhipMemPoolTrimTo(hipStream_t stream, int N, int dev = 0) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolTrimTo_VaryingMinBytesToHold") { +TEST_CASE(Unit_hipMemPoolTrimTo_VaryingMinBytesToHold) { checkMempoolSupported(0) // create a stream hipStream_t stream; @@ -218,7 +205,7 @@ TEST_CASE("Unit_hipMemPoolTrimTo_VaryingMinBytesToHold") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemPoolTrimTo_MGpuVaryingMinBytesToHold") { +TEST_CASE(Unit_hipMemPoolTrimTo_MGpuVaryingMinBytesToHold) { constexpr int N = 1 << 20; int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); diff --git a/catch/unit/memory/hipMemPrefetchAsync.cc b/catch/unit/memory/hipMemPrefetchAsync.cc index 3a1014b77..421a9e53d 100644 --- a/catch/unit/memory/hipMemPrefetchAsync.cc +++ b/catch/unit/memory/hipMemPrefetchAsync.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -47,7 +32,7 @@ __global__ void MemPrefetchAsyncKernel(int* C_d, const int* A_d, size_t N) { } } -TEST_CASE("Unit_hipMemPrefetchAsync_Basic", "[multigpu]") { +TEST_CASE(Unit_hipMemPrefetchAsync_Basic_AllDevices) { const auto supported_devices = GetDevicesWithPrefetchSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test need at least one device with managed memory support"); @@ -77,7 +62,7 @@ TEST_CASE("Unit_hipMemPrefetchAsync_Basic", "[multigpu]") { ArrayFindIfNot(alloc1.ptr(), fill_value, count); } -TEST_CASE("Unit_hipMemPrefetchAsync_Sync_Behavior") { +TEST_CASE(Unit_hipMemPrefetchAsync_Sync_Behavior) { const auto supported_devices = GetDevicesWithPrefetchSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test need at least one device with managed memory support"); @@ -94,7 +79,7 @@ TEST_CASE("Unit_hipMemPrefetchAsync_Sync_Behavior") { HIP_CHECK(hipStreamSynchronize(sg.stream())); } -TEST_CASE("Unit_hipMemPrefetchAsync_Rounding_Behavior") { +TEST_CASE(Unit_hipMemPrefetchAsync_Rounding_Behavior) { auto supported_devices = GetDevicesWithPrefetchSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test need at least one device with managed memory support"); @@ -127,7 +112,7 @@ TEST_CASE("Unit_hipMemPrefetchAsync_Rounding_Behavior") { static_cast(attribute)); } -TEST_CASE("Unit_hipMemPrefetchAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemPrefetchAsync_Negative_Parameters) { auto supported_devices = GetDevicesWithPrefetchSupport(); if (supported_devices.empty()) { HipTest::HIP_SKIP_TEST("Test need at least one device with managed memory support"); diff --git a/catch/unit/memory/hipMemPrefetchAsyncExtTsts.cc b/catch/unit/memory/hipMemPrefetchAsyncExtTsts.cc index 5dd76cc64..67f9532e4 100644 --- a/catch/unit/memory/hipMemPrefetchAsyncExtTsts.cc +++ b/catch/unit/memory/hipMemPrefetchAsyncExtTsts.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Test Case Description: 1) Allocate managed memory --> prefetch to gpu 0 @@ -68,7 +55,7 @@ static int HmmAttrPrint() { call hipMemAdvise() on the memory and apply the flags ReadMostly, AccessedBy, and PreferredLocation for gpus other than gpu 0 and verify the flags using hipMemGetAttribute()*/ -TEST_CASE("Unit_hipMemPrefetchAsyncAdviseFlgTst") { +TEST_CASE(Unit_hipMemPrefetchAsyncAdviseFlgTst) { int NGpus = 0; HIP_CHECK(hipGetDeviceCount(&NGpus)); if (NGpus >= 2) { @@ -133,7 +120,7 @@ TEST_CASE("Unit_hipMemPrefetchAsyncAdviseFlgTst") { AccessedBy using hipMemGetAttribute() and validate if AccessedBy is still set to gpu1. Similar tests are done with ReadMostly and PreferredLocation flags */ -TEST_CASE("Unit_hipMemPrefetchAsyncAccsdByTst") { +TEST_CASE(Unit_hipMemPrefetchAsyncAccsdByTst) { int NGpus = 0; HIP_CHECK(hipGetDeviceCount(&NGpus)); if (NGpus >= 2) { @@ -224,7 +211,7 @@ TEST_CASE("Unit_hipMemPrefetchAsyncAccsdByTst") { } /*Test Case description: Negative testing with hipMemPrefetchAsync() api*/ -TEST_CASE("Unit_hipMemPrefetchAsyncNegativeTst") { +TEST_CASE(Unit_hipMemPrefetchAsyncNegativeTst) { int MangdMem = HmmAttrPrint(); if (MangdMem == 1) { int *Hmm = nullptr, MemSz = 4096 * 4, NumElms = MemSz / 4, InitVal = 123; @@ -325,7 +312,7 @@ TEST_CASE("Unit_hipMemPrefetchAsyncNegativeTst") { /* Test Case description: In this test case I am trying to allocate HMM memory which is not multiple of page Size, but still trying to launch kernel and see if we are getting values as expected.*/ -TEST_CASE("Unit_hipMemPrefetchAsync_NonPageSz") { +TEST_CASE(Unit_hipMemPrefetchAsync_NonPageSz) { int *Hmm = nullptr, NumElms = 4096 * 2, InitVal = 123; hipStream_t strm; bool IfTestPassed = true; diff --git a/catch/unit/memory/hipMemPrefetchAsync_v2.cc b/catch/unit/memory/hipMemPrefetchAsync_v2.cc index 867be5be6..05a075480 100644 --- a/catch/unit/memory/hipMemPrefetchAsync_v2.cc +++ b/catch/unit/memory/hipMemPrefetchAsync_v2.cc @@ -1,23 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -70,7 +55,7 @@ static std::vector getSupportedDevices() { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemPrefetchAsync_v2_Device_Host", "[multigpu]") { +TEST_CASE(Unit_hipMemPrefetchAsync_v2_Device_Host) { auto supportedDevices = getSupportedDevices(); if (supportedDevices.empty()) { HipTest::HIP_SKIP_TEST( @@ -183,7 +168,7 @@ TEST_CASE("Unit_hipMemPrefetchAsync_v2_Device_Host", "[multigpu]") { * - HIP_VERSION >= 7.1 */ #if __linux__ -TEST_CASE("Unit_hipMemPrefetchAsync_v2_HostNuma_HostNumaCurrent") { +TEST_CASE(Unit_hipMemPrefetchAsync_v2_HostNuma_HostNumaCurrent) { auto supportedDevices = getSupportedDevices(); if (supportedDevices.empty() || numa_available() < 0) { HipTest::HIP_SKIP_TEST("Skipping as System does not have managed memory " @@ -303,7 +288,7 @@ TEST_CASE("Unit_hipMemPrefetchAsync_v2_HostNuma_HostNumaCurrent") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemPrefetchAsync_v2_Negative") { +TEST_CASE(Unit_hipMemPrefetchAsync_v2_Negative) { auto supportedDevices = getSupportedDevices(); if (supportedDevices.empty()) { HipTest::HIP_SKIP_TEST( diff --git a/catch/unit/memory/hipMemPtrGetInfo.cc b/catch/unit/memory/hipMemPtrGetInfo.cc index 5f9a574b3..77dd538df 100644 --- a/catch/unit/memory/hipMemPtrGetInfo.cc +++ b/catch/unit/memory/hipMemPtrGetInfo.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 - 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This testfile verifies the basic scenario of hipMemPtrGetInfo API @@ -37,7 +21,7 @@ hipMemPtrGetInfo API 2. Gets the allocated size of that variable using hipMemPtrGetInfo API 3. Validates the initial size and allocated size */ -TEST_CASE("Unit_hipMemPtrGetInfo_Basic") { +TEST_CASE(Unit_hipMemPtrGetInfo_Basic) { int* iPtr; float* fPtr; MemInfo* sPtr; @@ -61,7 +45,7 @@ TEST_CASE("Unit_hipMemPtrGetInfo_Basic") { This testcase verifies the scenario of hipMemPtrGetInfo API being called on a zero-sized allocation. */ -TEST_CASE("Unit_hipMemPtrGetInfo_SizeZeroAllocation") { +TEST_CASE(Unit_hipMemPtrGetInfo_SizeZeroAllocation) { int* iPtr; size_t sSetSize = 0, sGetSize; HIP_CHECK(hipMalloc(&iPtr, sSetSize)); diff --git a/catch/unit/memory/hipMemRangeGetAttribute.cc b/catch/unit/memory/hipMemRangeGetAttribute.cc index d642f787b..7776dc33b 100644 --- a/catch/unit/memory/hipMemRangeGetAttribute.cc +++ b/catch/unit/memory/hipMemRangeGetAttribute.cc @@ -1,31 +1,15 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include #include #include -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_ReadMostly_Basic") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_ReadMostly_Basic) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -46,7 +30,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_ReadMostly_Basic") { REQUIRE(data == 1); } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_ReadMostly_Partial_Range") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_ReadMostly_Partial_Range) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -68,7 +52,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_ReadMostly_Partial_Range") { REQUIRE(data == 1); } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_PreferredLocation_Basic") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_PreferredLocation_Basic) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -89,7 +73,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_PreferredLocation_Basic") { REQUIRE(data == 0); } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_PreferredLocation_CPU") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_PreferredLocation_CPU) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -107,7 +91,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_PreferredLocation_CPU") { REQUIRE(data == hipCpuDeviceId); } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_PreferredLocation_Partial_Range") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_PreferredLocation_Partial_Range) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -129,7 +113,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_PreferredLocation_Partial_Range REQUIRE(data == 0); } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_LastPrefetchLocation_Basic") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_LastPrefetchLocation_Basic) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -150,7 +134,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_LastPrefetchLocation_Basic") { REQUIRE(data == 0); } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_LastPrefetchLocation_CPU") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_LastPrefetchLocation_CPU) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -167,7 +151,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_LastPrefetchLocation_CPU") { REQUIRE(data == hipCpuDeviceId); } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_LastPrefetchLocation_Partial_Range") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_LastPrefetchLocation_Partial_Range) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -189,7 +173,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_LastPrefetchLocation_Partial_Ra REQUIRE(data == 0); } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_AccessedBy_Basic") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_AccessedBy_Basic) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -220,7 +204,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_AccessedBy_Basic") { } } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_AccessedBy_Partial_Range") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_AccessedBy_Partial_Range) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -252,7 +236,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_AccessedBy_Partial_Range") { } } -TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_AccessedBy_MultiDevice") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Positive_AccessedBy_MultiDevice) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -287,7 +271,7 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Positive_AccessedBy_MultiDevice") { } } -TEST_CASE("Unit_hipMemRangeGetAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipMemRangeGetAttribute_Negative_Parameters) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -351,6 +335,13 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_Negative_Parameters") { hipErrorInvalidValue); } + SECTION("dev_ptr is host pinned memory") { + LinearAllocGuard host_pinned(LinearAllocs::hipHostMalloc, kPageSize); + HIP_CHECK_ERROR(hipMemRangeGetAttribute(&data, 4, hipMemRangeAttributeReadMostly, + host_pinned.ptr(), kPageSize), + hipErrorInvalidValue); + } + SECTION("count == 0") { HIP_CHECK_ERROR( hipMemRangeGetAttribute(&data, 4, hipMemRangeAttributeReadMostly, managed.ptr(), 0), diff --git a/catch/unit/memory/hipMemRangeGetAttribute_old.cc b/catch/unit/memory/hipMemRangeGetAttribute_old.cc index f2d29e041..2d49666e7 100644 --- a/catch/unit/memory/hipMemRangeGetAttribute_old.cc +++ b/catch/unit/memory/hipMemRangeGetAttribute_old.cc @@ -1,63 +1,21 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Test Case Description: Scenario-1: The following function tests the count parameter(last param) to hipMemRangeGetAttribute api by passing possible extreme values. - Curently the only way to test if count param working properly is to verify - the first parameter of hipMemRangeGetAttribute() api has value 1 stored - - Scenario-2: This test case checks the behavior of hipMemRangeGetAttribute() with - AccessedBy flag is consistent with cuda's counter part - - Scenario-3: Allocate 4 * page size of memory with the flag hipMemAttachGloal. Advise - AccessedBy, ReadMostly and PreferredLocation to first half(2*pageSz) of the - memory and probe the for the flags which are set earlier using - hipMemRangeGetAttribute() api for the full size(4*PageSz). - - - Scenario-4: The following scenarios tests that probing the attributes which are not set - by hipMemAdvise() but being probed using hipMemRangeGetAttribute() should - not result in a crash - Scenario-5: The following scenario is a simple test which does the following: - Allocate Hmm memory --> hipMemPrefetchAsync() to device 0 and then - probe LastPrefetchLocation attribute using hipMemRangeGetAttribute - - Scenario-6: The following Test Case does negative tests on hipMemRangeGetAttribute()*/ + Scenario-2: This test case checks behavior of hipMemRangeGetAttribute() with + AccessedBy when the output buffer size is smaller than the number of devices + potentially returned (should not crash). +*/ #include -#include -#ifdef __linux__ -#include -#include -#endif - -static bool CheckError(hipError_t err, int LineNo) { - if (err == hipSuccess) { - WARN("Error expected but received hipSuccess at line no.:" << LineNo); - return false; - } else { - return true; - } -} +#include static int HmmAttrPrint() { int managed = 0; @@ -83,7 +41,7 @@ static int HmmAttrPrint() { // hipMemRangeGetAttribute api by passing possible extreme values. // Curently the only way to test if count param working properly is to verify // the first parameter of hipMemRangeGetAttribute() api has value 1 stored -TEST_CASE("Unit_hipMemRangeGetAttribute_TstCountParam") { +TEST_CASE(Unit_hipMemRangeGetAttribute_TstCountParam) { int MangdMem = HmmAttrPrint(); if (MangdMem == 1) { #if HT_AMD @@ -143,85 +101,9 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_TstCountParam") { } } -/* The following Test Case does negative tests on hipMemRangeGetAttribute()*/ - -TEST_CASE("Unit_hipMemRangeGetAttribute_NegativeTests") { - int MangdMem = HmmAttrPrint(); - if (MangdMem == 1) { - int MEM_SIZE = 4096, RND_NUM = 9999; - float* devPtr = nullptr; - int NumDevs; - HIP_CHECK(hipGetDeviceCount(&NumDevs)); - int data = RND_NUM; - - auto out_data = std::make_unique(NumDevs); - for (int i = 0; i < NumDevs; ++i) { - out_data[i] = RND_NUM; - } - - HIP_CHECK(hipMallocManaged(&devPtr, MEM_SIZE, hipMemAttachGlobal)); - HIP_CHECK(hipMemAdvise(devPtr, MEM_SIZE, hipMemAdviseSetReadMostly, 0)); - - // checking the behavior with dataSize 0 - SECTION("checking the behavior with dataSize 0") { - REQUIRE(CheckError( - hipMemRangeGetAttribute(&data, 0, hipMemRangeAttributeReadMostly, devPtr, MEM_SIZE), - __LINE__)); - } - // checking the behavior with dataSize > 4 and even - SECTION("checking the behavior with dataSize > 4 and even") { - REQUIRE(CheckError(hipMemRangeGetAttribute(out_data.get(), 6, hipMemRangeAttributeReadMostly, - devPtr, MEM_SIZE), - __LINE__)); - } - // checking the behavior with dataSize > 4 and odd - SECTION("checking the behavior with dataSize > 4 and odd") { - REQUIRE(CheckError(hipMemRangeGetAttribute(out_data.get(), 7, hipMemRangeAttributeReadMostly, - devPtr, MEM_SIZE), - __LINE__)); - } - // checking the behavior with dataSize which is not multiple of 4 - SECTION("checking the behavior with dataSize which is not multiple of 4") { - REQUIRE(CheckError(hipMemRangeGetAttribute(out_data.get(), 27, hipMemRangeAttributeReadMostly, - devPtr, MEM_SIZE), - __LINE__)); - } - // checking the behaviour with devPtr(4th param) as NULL - SECTION("checking the behaviour with devPtr(4th param) as NULL") { - REQUIRE(CheckError(hipMemRangeGetAttribute(&data, sizeof(int), hipMemRangeAttributeReadMostly, - NULL, MEM_SIZE), - __LINE__)); - } - // checking the behaviour with count(5th param) as 0 - SECTION("checking the behaviour with count(5th param) as 0") { - REQUIRE(CheckError( - hipMemRangeGetAttribute(&data, sizeof(int), hipMemRangeAttributeReadMostly, devPtr, 0), - __LINE__)); - } - // checking the behavior with invalid attribute (3rd param) as 0 - // as it is attribute hence avoiding the negative tests with 3rd param - - // checking the behaviour of the api with ptr allocated using - // hipHostMalloc - void* ptr = nullptr; - SECTION("Checking behavior with hipHostMalloc ptr") { - HIP_CHECK(hipHostMalloc(&ptr, MEM_SIZE, 0)); - REQUIRE(CheckError(hipMemRangeGetAttribute(&data, sizeof(int), hipMemRangeAttributeReadMostly, - ptr, MEM_SIZE), - __LINE__)); - HIP_CHECK(hipHostFree(ptr)); - } - HIP_CHECK(hipFree(devPtr)); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - -/* This test case checks the behavior of hipMemRangeGetAttribute() with +/* This test case checks the behavior of hipMemRangeGetAttribute() with AccessedBy flag is consistent with cuda's counter part*/ -TEST_CASE("Unit_hipMemRangeGetAttribute_AccessedBy1") { +TEST_CASE(Unit_hipMemRangeGetAttribute_AccessedBy1) { int managed = HmmAttrPrint(); if (managed == 1) { int Ngpus = 0, *Hmm = NULL, MEM_SZ = 4096, RND_NUM = 999; @@ -274,50 +156,11 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_AccessedBy1") { } } - -/* Allocate 4 * page size of memory with the flag hipMemAttachGloal. Advise - AccessedBy, ReadMostly and PreferredLocation to first half(2*pageSz) of the - memory and probe the for the flags which are set earlier using - hipMemRangeGetAttribute() api for the full size(4*PageSz).*/ -/* Need to discuss the difference in behavior w.r.t cuda*/ - -TEST_CASE("Unit_hipMemRangeGetAttribte_3") { - int managed = HmmAttrPrint(); - if (managed == 1) { - int Ngpus = 0, *Hmm = NULL, MEM_SZ = 4096 * 4, RND_NUM = 999; - HIP_CHECK(hipGetDeviceCount(&Ngpus)); - std::vector OutData; - for (int i = 0; i < Ngpus; ++i) { - OutData.push_back(RND_NUM); - } - HIP_CHECK(hipMallocManaged(&Hmm, MEM_SZ)); - HIP_CHECK(hipMemAdvise(Hmm, MEM_SZ / 2, hipMemAdviseSetAccessedBy, 0)); - HIP_CHECK(hipMemRangeGetAttribute(OutData.data(), sizeof(int) * OutData.size(), - hipMemRangeAttributeAccessedBy, (Hmm), MEM_SZ)); - - HIP_CHECK(hipMemAdvise(Hmm, MEM_SZ / 2, hipMemAdviseSetReadMostly, 0)); - // The Api called below should not fail - HIP_CHECK(hipMemRangeGetAttribute(OutData.data(), sizeof(int), hipMemRangeAttributeReadMostly, - (Hmm), MEM_SZ)); - - HIP_CHECK(hipMemAdvise(Hmm, MEM_SZ / 2, hipMemAdviseSetPreferredLocation, 0)); - // The api called below should not fail - HIP_CHECK(hipMemRangeGetAttribute(OutData.data(), sizeof(int), - hipMemRangeAttributePreferredLocation, (Hmm), MEM_SZ)); - HIP_CHECK(hipFree(Hmm)); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - - /* The following scenarios tests that probing the attributes which are not set by hipMemAdvise() but being probed using hipMemRangeGetAttribute() should not result in a crash*/ -TEST_CASE("Unit_hipMemRangeGetAttribute_4") { +TEST_CASE(Unit_hipMemRangeGetAttribute_4) { int managed = HmmAttrPrint(); if (managed == 1) { int *Hmm = NULL, PageSz = 4096, Ngpus, RND_NUM = 999; @@ -359,39 +202,3 @@ TEST_CASE("Unit_hipMemRangeGetAttribute_4") { "attribute. Hence skipping the testing with Pass result.\n"); } } - - -/* The following scenario is a simple test which does the following: - Allocate Hmm memory --> hipMemPrefetchAsync() to device 0 and then - probe LastPrefetchLocation attribute using hipMemRangeGetAttribute*/ - -TEST_CASE("Unit_hipMemRangeGetAttribute_PrefetchAndGtAttr") { - int managed = HmmAttrPrint(); - if (managed == 1) { - int Ngpus = 0, *Hmm = NULL, RND_NUM = 999; - size_t PageSz = 4096; - HIP_CHECK(hipGetDeviceCount(&Ngpus)); - - std::vector OutData; - for (int i = 0; i < Ngpus; ++i) { - OutData.push_back(RND_NUM); - } - HIP_CHECK(hipMallocManaged(&Hmm, PageSz * 4)); - hipStream_t strm; - HIP_CHECK(hipStreamCreate(&strm)); - HIP_CHECK(hipMemPrefetchAsync(Hmm, PageSz * 4, 0, strm)); - HIP_CHECK(hipStreamSynchronize(strm)); - HIP_CHECK(hipMemRangeGetAttribute(OutData.data(), sizeof(int), - hipMemRangeAttributeLastPrefetchLocation, Hmm, PageSz * 4)); - HIP_CHECK(hipStreamDestroy(strm)); - HIP_CHECK(hipFree(Hmm)); - if (OutData[0] != 0) { - WARN("Didnt receive expected value at line: " << __LINE__); - REQUIRE(false); - } - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} diff --git a/catch/unit/memory/hipMemRangeGetAttributes.cc b/catch/unit/memory/hipMemRangeGetAttributes.cc index a3a9a5bf2..0f1c123e5 100644 --- a/catch/unit/memory/hipMemRangeGetAttributes.cc +++ b/catch/unit/memory/hipMemRangeGetAttributes.cc @@ -1,31 +1,15 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include #include #include -TEST_CASE("Unit_hipMemRangeGetAttributes_Positive_Basic") { +TEST_CASE(Unit_hipMemRangeGetAttributes_Positive_Basic) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; @@ -63,7 +47,7 @@ TEST_CASE("Unit_hipMemRangeGetAttributes_Positive_Basic") { } } -TEST_CASE("Unit_hipMemRangeGetAttributes_Negative_Parameters") { +TEST_CASE(Unit_hipMemRangeGetAttributes_Negative_Parameters) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory not supported"); return; diff --git a/catch/unit/memory/hipMemRangeGetAttributes_old.cc b/catch/unit/memory/hipMemRangeGetAttributes_old.cc deleted file mode 100644 index 72872f01e..000000000 --- a/catch/unit/memory/hipMemRangeGetAttributes_old.cc +++ /dev/null @@ -1,303 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/* Test Case Description: - Scenario-1: Testing basic working of hipMemRangeGetAttributes() - api with different flags - Scenario-2: Negative testing with hipMemRangeGetAttributes() api -*/ - -#include -#define MEM_SIZE 8192 - -#ifdef __linux__ -static bool CheckError(hipError_t err, int LineNo) { - if (err == hipSuccess) { - WARN("Error expected but received hipSuccess at line no.:" << LineNo); - return false; - } else { - return true; - } -} - -static int HmmAttrPrint() { - int managed = 0; - WARN( - "The following are the attribute values related to HMM for" - " device 0:\n"); - HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeDirectManagedMemAccessFromHost, 0)); - WARN("hipDeviceAttributeDirectManagedMemAccessFromHost: " << managed); - HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeConcurrentManagedAccess, 0)); - WARN("hipDeviceAttributeConcurrentManagedAccess: " << managed); - HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributePageableMemoryAccess, 0)); - WARN("hipDeviceAttributePageableMemoryAccess: " << managed); - HIP_CHECK( - hipDeviceGetAttribute(&managed, hipDeviceAttributePageableMemoryAccessUsesHostPageTables, 0)); - WARN("hipDeviceAttributePageableMemoryAccessUsesHostPageTables:" << managed); - HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, 0)); - WARN("hipDeviceAttributeManagedMemory: " << managed); - return managed; -} - -/* Test Scenario: Testing basic working of hipMemRangeGetAttributes() - api with different flags */ - -TEST_CASE("Unit_hipMemRangeGetAttributes_TstFlgs") { - int MangdMem = HmmAttrPrint(); - if (MangdMem == 1) { - bool IfTestPassed = true; - int NumDevs = 0; - int *Outpt[4]; - float* Hmm = nullptr; - hipStream_t strm; - hipMemRangeAttribute AttrArr[4] = { - hipMemRangeAttributeReadMostly, hipMemRangeAttributePreferredLocation, - hipMemRangeAttributeAccessedBy, hipMemRangeAttributeLastPrefetchLocation}; - HIP_CHECK(hipGetDeviceCount(&NumDevs)); - size_t dataSizes[4] = {sizeof(int), sizeof(int), (NumDevs * sizeof(int)), sizeof(int)}; - Outpt[0] = new int; - Outpt[1] = new int; - Outpt[2] = new int[NumDevs]; - Outpt[3] = new int; - HIP_CHECK(hipMallocManaged(&Hmm, MEM_SIZE, hipMemAttachGlobal)); - for (int i = 0; i < NumDevs; ++i) { - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetReadMostly, i)); - HIP_CHECK(hipMemRangeGetAttributes(reinterpret_cast(Outpt), dataSizes, AttrArr, 4, - Hmm, MEM_SIZE)); - if (*(Outpt[0]) != 1) { - WARN("Attempt to set hipMemAdviseSetReadMostly flag failed!\n"); - IfTestPassed = false; - } - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseUnsetReadMostly, i)); - HIP_CHECK(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, Hmm, - MEM_SIZE)); - - if (*(Outpt[0]) != 0) { - WARN("Attempt to set hipMemAdviseUnsetReadMostly flag failed!\n"); - IfTestPassed = false; - } - - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetPreferredLocation, i)); - HIP_CHECK(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, Hmm, - MEM_SIZE)); - if (*(Outpt[1]) != i) { - WARN("Attempt to set hipMemAdviseSetPreferredLocation flag"); - WARN(" failed!\n"); - IfTestPassed = false; - } - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetAccessedBy, i)); - HIP_CHECK(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, Hmm, - MEM_SIZE)); - if ((Outpt[2][0]) != i) { - WARN("Attempt to set hipMemAdviseSetAccessedBy flag"); - WARN(" failed!\n"); - IfTestPassed = false; - } - - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseUnsetAccessedBy, i)); - HIP_CHECK(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, Hmm, - MEM_SIZE)); - if (!((Outpt[2][i]) < 0)) { - WARN("Attempt to set hipMemAdviseUnsetAccessedBy flag failed!\n"); - IfTestPassed = false; - } - HIP_CHECK(hipStreamCreate(&strm)); - HIP_CHECK(hipMemPrefetchAsync(Hmm, MEM_SIZE, i, strm)); - HIP_CHECK(hipStreamSynchronize(strm)); - HIP_CHECK(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, Hmm, - MEM_SIZE)); - if (*(Outpt[3]) != i) { - WARN("Attempt to prefetch memory to device: " << i); - WARN("failed!\n"); - IfTestPassed = false; - } - // Prefetching back to Host - HIP_CHECK(hipMemPrefetchAsync(Hmm, MEM_SIZE, -1, strm)); - HIP_CHECK(hipStreamSynchronize(strm)); - HIP_CHECK(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, Hmm, - MEM_SIZE)); - if (*(Outpt[3]) != -1) { - WARN("Attempt to prefetch memory to Host failed!\n"); - IfTestPassed = false; - } - HIP_CHECK(hipStreamDestroy(strm)); - } - - HIP_CHECK(hipFree(Hmm)); - - delete Outpt[0]; - delete Outpt[1]; - delete[] Outpt[2]; - delete Outpt[3]; - - REQUIRE(IfTestPassed); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} - -/* Test Scenario: Negative testing with hipMemRangeGetAttributes() api*/ -TEST_CASE("Unit_hipMemRangeGetAttributes_NegativeTst") { - int MangdMem = HmmAttrPrint(); - if (MangdMem == 1) { - bool IfTestPassed = true; - int NumDevs = 0, *Outpt[4]; - float* Hmm = nullptr; - hipMemRangeAttribute AttrArr[4] = { - hipMemRangeAttributeReadMostly, hipMemRangeAttributePreferredLocation, - hipMemRangeAttributeAccessedBy, hipMemRangeAttributeLastPrefetchLocation}; - HIP_CHECK(hipGetDeviceCount(&NumDevs)); - size_t dataSizes[4] = {sizeof(int), sizeof(int), (NumDevs * sizeof(int)), sizeof(int)}; - Outpt[0] = new int; - Outpt[1] = new int; - Outpt[2] = new int[NumDevs]; - Outpt[3] = new int; - HIP_CHECK(hipMallocManaged(&Hmm, MEM_SIZE, hipMemAttachGlobal)); - HIP_CHECK(hipMemAdvise(Hmm, MEM_SIZE, hipMemAdviseSetReadMostly, 0)); - // passing zero for num of attributes param(4th) - SECTION("passing zero for num of attributes param(4th)") { - if (!CheckError(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 0, - Hmm, MEM_SIZE), - __LINE__)) { - IfTestPassed = false; - } - } - - // the first dataSize element passed as 0 - dataSizes[0] = 0; - dataSizes[1] = sizeof(int); - dataSizes[2] = NumDevs * sizeof(int); - dataSizes[3] = sizeof(int); - SECTION("the first dataSize element passed as 0") { - if (!CheckError(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, - Hmm, MEM_SIZE), - __LINE__)) { - IfTestPassed = false; - } - } - // passing datasize as 2 while the requirement is multiple of 4 - dataSizes[0] = 2; - dataSizes[1] = sizeof(int); - dataSizes[2] = NumDevs * sizeof(int); - dataSizes[3] = sizeof(int); - SECTION("datasize as 2 while the requirement is multiple of 4") { - if (!CheckError(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, - Hmm, MEM_SIZE), - __LINE__)) { - IfTestPassed = false; - } - } - // passing datasize as 6 while the requirement is multiple of 4 - dataSizes[0] = 6; - dataSizes[1] = sizeof(int); - dataSizes[2] = NumDevs * sizeof(int); - dataSizes[3] = sizeof(int); - SECTION("datasize as 6 while the requirement is multiple of 4") { - if (!CheckError(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, - Hmm, MEM_SIZE), - __LINE__)) { - IfTestPassed = false; - } - } - // passing datasize as 7 while the requirement is multiple of 4 - dataSizes[0] = 7; - dataSizes[1] = sizeof(int); - dataSizes[2] = NumDevs * sizeof(int); - dataSizes[3] = sizeof(int); - SECTION("datasize as 7 while the requirement is multiple of 4") { - if (!CheckError(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, - Hmm, MEM_SIZE), - __LINE__)) { - IfTestPassed = false; - } - } - // passing dataSize as 7 for attribute hipMemRangeAttributeAccessedBy - hipMemRangeAttribute AttrArr1[1] = {hipMemRangeAttributeAccessedBy}; - dataSizes[2] = {7}; - SECTION("passing dataSize as 7 for attribute hipMemRangeAttrAccessedBy") { - if (!CheckError(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr1, 1, - Hmm, MEM_SIZE), - __LINE__)) { - IfTestPassed = false; - } - } - // Passing NULL as first parameter - SECTION("Passing NULL as first parameter") { - if (!CheckError(hipMemRangeGetAttributes(reinterpret_cast(NULL), - reinterpret_cast(dataSizes), AttrArr, 4, - Hmm, MEM_SIZE), - __LINE__)) { - IfTestPassed = false; - } - } - // Passing count parameter as zero - SECTION("Passing count parameter as zero") { - if (!CheckError( - hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), AttrArr, 4, Hmm, 0), - __LINE__)) { - IfTestPassed = false; - } - } - // Passing NULL for Attribute array(3rd param) - SECTION("Passing NULL for Attribute array(3rd param)") { - if (!CheckError(hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), NULL, 4, Hmm, - MEM_SIZE), - __LINE__)) { - IfTestPassed = false; - } - } - // Passing 0 for Attribute array(3rd param) - SECTION("Passing 0 for Attribute array(3rd param)") { - if (!CheckError( - hipMemRangeGetAttributes(reinterpret_cast(Outpt), - reinterpret_cast(dataSizes), 0, 4, Hmm, MEM_SIZE), - __LINE__)) { - IfTestPassed = false; - } - } - delete Outpt[0]; - delete Outpt[1]; - delete[] Outpt[2]; - delete Outpt[3]; - REQUIRE(IfTestPassed); - - HIP_CHECK(hipFree(Hmm)); - } else { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeManagedMemory " - "attribute. Hence skipping the testing with Pass result.\n"); - } -} -#endif diff --git a/catch/unit/memory/hipMemSetMemPool.cc b/catch/unit/memory/hipMemSetMemPool.cc index 0c4d309d2..1fd8dc4bc 100644 --- a/catch/unit/memory/hipMemSetMemPool.cc +++ b/catch/unit/memory/hipMemSetMemPool.cc @@ -1,20 +1,7 @@ /* - Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include diff --git a/catch/unit/memory/hipMemVmm.cc b/catch/unit/memory/hipMemVmm.cc index ba77b3236..eeaab7b34 100644 --- a/catch/unit/memory/hipMemVmm.cc +++ b/catch/unit/memory/hipMemVmm.cc @@ -1,20 +1,7 @@ /* - 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* Test Case Description: @@ -36,7 +23,7 @@ This testcase verifies HIP Mem VMM API basic scenario - supported on all devices */ -TEST_CASE("Unit_hipMemVmm_Basic") { +TEST_CASE(Unit_hipMemVmm_Basic) { int vmm = 0; HIP_CHECK(hipDeviceGetAttribute(&vmm, hipDeviceAttributeVirtualMemoryManagementSupported, 0)); INFO("hipDeviceAttributeVirtualMemoryManagementSupported: " << vmm); @@ -58,9 +45,9 @@ TEST_CASE("Unit_hipMemVmm_Basic") { HIP_CHECK(hipMemGetAllocationGranularity(&granularity, &memAllocationProp, hipMemAllocationGranularityRecommended)); - size_t size = 4 * 1024; + size_t size = granularity * 4; void* reservedAddress{nullptr}; - HIP_CHECK(hipMemAddressReserve(&reservedAddress, size, granularity, nullptr, 0)); + HIP_CHECK(hipMemAddressReserve(&reservedAddress, size, 0, nullptr, 0)); hipMemGenericAllocationHandle_t gaHandle{nullptr}; HIP_CHECK(hipMemCreate(&gaHandle, size, &memAllocationProp, 0)); @@ -96,7 +83,7 @@ TEST_CASE("Unit_hipMemVmm_Basic") { */ #if HT_AMD -TEST_CASE("Unit_hipMemVmm_Uncached") { +TEST_CASE(Unit_hipMemVmm_Uncached) { int vmm = 0; HIP_CHECK(hipDeviceGetAttribute(&vmm, hipDeviceAttributeVirtualMemoryManagementSupported, 0)); INFO("hipDeviceAttributeVirtualMemoryManagementSupported: " << vmm); diff --git a/catch/unit/memory/hipMemcpy2D.cc b/catch/unit/memory/hipMemcpy2D.cc index 6ef94e0b8..993195888 100644 --- a/catch/unit/memory/hipMemcpy2D.cc +++ b/catch/unit/memory/hipMemcpy2D.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy2d_tests_common.hh" @@ -27,7 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipMemcpy2D_Positive_Basic", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2D_Positive_Basic) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -42,7 +26,7 @@ TEST_CASE("Unit_hipMemcpy2D_Positive_Basic", "[multigpu]") { SECTION("Host to Host") { Memcpy2DHostToHostShell(hipMemcpy2D); } } -TEST_CASE("Unit_hipMemcpy2D_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy2D_Positive_Synchronization_Behavior) { HIP_CHECK(hipDeviceSynchronize()); SECTION("Host to Device") { Memcpy2DHtoDSyncBehavior(hipMemcpy2D, true); } @@ -65,13 +49,13 @@ TEST_CASE("Unit_hipMemcpy2D_Positive_Synchronization_Behavior") { #endif } -TEST_CASE("Unit_hipMemcpy2D_Positive_Parameters") { +TEST_CASE(Unit_hipMemcpy2D_Positive_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = false; Memcpy2DZeroWidthHeight(hipMemcpy2D); } -TEST_CASE("Unit_hipMemcpy2D_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpy2D_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr size_t cols = 128; constexpr size_t rows = 128; @@ -152,7 +136,7 @@ TEST_CASE("Unit_hipMemcpy2D_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpy2D_Capture") { +TEST_CASE(Unit_hipMemcpy2D_Capture) { CHECK_IMAGE_SUPPORT constexpr size_t width = 16; diff --git a/catch/unit/memory/hipMemcpy2DArrayToArray.cc b/catch/unit/memory/hipMemcpy2DArrayToArray.cc index e0eb18ea2..dd61b1b00 100644 --- a/catch/unit/memory/hipMemcpy2DArrayToArray.cc +++ b/catch/unit/memory/hipMemcpy2DArrayToArray.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -32,7 +19,7 @@ bool compare_arrays(int* arr1, int* arr2, int width, int height) { return true; } -TEST_CASE("Unit_hipMemcpy2DArrayToArray_Negative") { +TEST_CASE(Unit_hipMemcpy2DArrayToArray_Negative) { CHECK_IMAGE_SUPPORT constexpr int width = 256; @@ -112,7 +99,7 @@ TEST_CASE("Unit_hipMemcpy2DArrayToArray_Negative") { HIP_CHECK(hipFreeArray(d_dst_arr)); } -TEST_CASE("Unit_hipMemcpy2DArrayToArray_Positive") { +TEST_CASE(Unit_hipMemcpy2DArrayToArray_Positive) { CHECK_IMAGE_SUPPORT constexpr int width = 4; @@ -167,7 +154,7 @@ TEST_CASE("Unit_hipMemcpy2DArrayToArray_Positive") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemcpy2DArrayToArray_BasicPositive") { +TEST_CASE(Unit_hipMemcpy2DArrayToArray_BasicPositive) { CHECK_IMAGE_SUPPORT const size_t width = 1024; diff --git a/catch/unit/memory/hipMemcpy2DAsync.cc b/catch/unit/memory/hipMemcpy2DAsync.cc index ef6af19c1..888b97e83 100644 --- a/catch/unit/memory/hipMemcpy2DAsync.cc +++ b/catch/unit/memory/hipMemcpy2DAsync.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy2d_tests_common.hh" @@ -27,7 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipMemcpy2DAsync_Positive_Basic", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DAsync_Positive_Basic) { using namespace std::placeholders; constexpr bool async = true; @@ -63,7 +47,7 @@ TEST_CASE("Unit_hipMemcpy2DAsync_Positive_Basic", "[multigpu]") { } } -TEST_CASE("Unit_hipMemcpy2DAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy2DAsync_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -99,14 +83,14 @@ TEST_CASE("Unit_hipMemcpy2DAsync_Positive_Synchronization_Behavior") { #endif } -TEST_CASE("Unit_hipMemcpy2DAsync_Positive_Parameters") { +TEST_CASE(Unit_hipMemcpy2DAsync_Positive_Parameters) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; constexpr bool async = true; Memcpy2DZeroWidthHeight(std::bind(hipMemcpy2DAsync, _1, _2, _3, _4, _5, _6, _7, nullptr)); } -TEST_CASE("Unit_hipMemcpy2DAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpy2DAsync_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr size_t cols = 128; constexpr size_t rows = 128; @@ -193,7 +177,7 @@ TEST_CASE("Unit_hipMemcpy2DAsync_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy2DAsync_Capture", "", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpy2DAsync_Capture, int, float, double) { using ValueType = TestType; constexpr int kNumRowsOptions[] = {3, 4, 100}; constexpr int kNumColsOptions[] = {3, 4, 100}; diff --git a/catch/unit/memory/hipMemcpy2DAsync_old.cc b/catch/unit/memory/hipMemcpy2DAsync_old.cc index f5a5c5116..e66719deb 100644 --- a/catch/unit/memory/hipMemcpy2DAsync_old.cc +++ b/catch/unit/memory/hipMemcpy2DAsync_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021-2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpy2DAsync hipMemcpy2DAsync @@ -27,24 +14,6 @@ THE SOFTWARE. * Copies data between host and device. */ -// Testcase Description: -// 1) Verifies the working of Memcpy2DAsync API negative scenarios by -// Pass NULL to destination pointer -// Pass NULL to Source pointer -// Pass width greater than spitch/dpitch -// 2) Verifies hipMemcpy2DAsync API by -// pass 0 to destionation pitch -// pass 0 to source pitch -// pass 0 to width -// pass 0 to height -// 3) Verifies working of Memcpy2DAsync API on host memory -// and pinned host memory by -// performing D2H, D2D and H2D memory kind copies on same GPU -// 4) Verifies working of Memcpy2DAsync API on host memory -// and pinned host memory by -// performing D2H, D2D and H2D memory kind copies on peer GPU -// 5) Verifies working of Memcpy2DAsync API where memory is allocated -// in GPU-0 and stream is created on GPU-1 #include #include @@ -75,7 +44,7 @@ static constexpr auto ROWS{6}; * - HIP_VERSION >= 6.1 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy2DAsync_Host&PinnedMem", "", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpy2DAsync_Host_N_PinnedMem, int, float, double) { CHECK_IMAGE_SUPPORT // 1 refers to pinned host memory auto mem_type = GENERATE(0, 1); @@ -151,121 +120,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy2DAsync_Host&PinnedMem", "", int, float, doubl HIP_CHECK(hipStreamDestroy(stream)); } -/** - * Test Description - * ------------------------ - * - This testcases performs the following scenarios of hipMemcpy2DAsync API on Peer GPU - 1. H2D-D2D-D2H for Host Memory<-->Device Memory - 2. H2D-D2D-D2H for Pinned Host Memory<-->Device Memory - - Input : "A_h" initialized based on data type - "A_h" --> "A_d" using H2D copy - "A_d" --> "X_d" using D2D copy - "X_d" --> "B_h" using D2H copy - Output: Validating A_h with B_h both should be equal for - the number of COLUMNS and ROWS copied - * Test source - * ------------------------ - * - unit/memory/hipMemcpy2DAsync.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ - -TEMPLATE_TEST_CASE("Unit_hipMemcpy2DAsync_multiDevice-Host&PinnedMem", - "[multigpu]", int, float, double) { - CHECK_IMAGE_SUPPORT - auto mem_type = GENERATE(0, 1); - int numDevices = 0; - int canAccessPeer = 0; - TestType *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(TestType)}; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - hipStream_t stream; - - if (numDevices > 1) { - HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); - if (canAccessPeer) { - HIP_CHECK(hipSetDevice(0)); - HIP_CHECK(hipStreamCreate(&stream)); - - // Allocating memory - if (mem_type) { - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &B_h, &C_h, NUM_W * NUM_H, - true); - } else { - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &B_h, &C_h, NUM_W * NUM_H, - false); - } - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - - // Initialize the data - HipTest::setDefaultData(NUM_W * NUM_H, A_h, B_h, C_h); - - // Host to Device - HIP_CHECK(hipMemcpy2DAsync(A_d, pitch_A, A_h, COLUMNS * sizeof(TestType), - COLUMNS * sizeof(TestType), ROWS, hipMemcpyHostToDevice, stream)); - - // Change device - HIP_CHECK(hipSetDevice(1)); - - char* X_d{nullptr}; - size_t pitch_X; - HIP_CHECK(hipMallocPitch(reinterpret_cast(&X_d), &pitch_X, width, NUM_H)); - - // Device to Device - HIP_CHECK(hipMemcpy2DAsync(X_d, pitch_X, A_d, pitch_A, COLUMNS * sizeof(TestType), ROWS, - hipMemcpyDeviceToDevice, stream)); - - // Device to Host - HIP_CHECK(hipMemcpy2DAsync(B_h, COLUMNS * sizeof(TestType), X_d, pitch_X, - COLUMNS * sizeof(TestType), ROWS, hipMemcpyDeviceToHost, stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - - // Validating the result - REQUIRE(HipTest::checkArray(A_h, B_h, COLUMNS, ROWS) == true); - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - if (mem_type) { - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, B_h, C_h, true); - } else { - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, B_h, C_h, false); - } - HIP_CHECK(hipFree(X_d)); - HIP_CHECK(hipStreamDestroy(stream)); - } else { - SUCCEED("Machine does not seem to have P2P"); - } - } else { - SUCCEED("skipped the testcase as no of devices is less than 2"); - } -} - -/** - * Test Description - * ------------------------ - * - This testcases performs the following scenarios of hipMemcpy2DAsync API on Peer GPU - 1. H2D-D2D-D2H for Host Memory<-->Device Memory - 2. H2D-D2D-D2H for Pinned Host Memory<-->Device Memory - Memory is allocated in GPU-0 and Stream is created in GPU-1 - - Input : "A_h" initialized based on data type - "A_h" --> "A_d" using H2D copy - "A_d" --> "X_d" using D2D copy - "X_d" --> "B_h" using D2H copy - Output: Validating A_h with B_h both should be equal for - the number of COLUMNS and ROWS copied - * Test source - * ------------------------ - * - unit/memory/hipMemcpy2DAsync.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ - -TEMPLATE_TEST_CASE("Unit_hipMemcpy2DAsync_multiDevice-StreamOnDiffDevice", +TEMPLATE_TEST_CASE("Unit_hipMemcpy2DAsync_multiDevice_StreamOnDiffDevice", "[multigpu]", int, float, double) { CHECK_IMAGE_SUPPORT auto mem_type = GENERATE(0, 1); @@ -335,116 +190,6 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy2DAsync_multiDevice-StreamOnDiffDevice", } } -/** - * Test Description - * ------------------------ - * - This testcase verifies the null checks of hipMemcpy2DAsync API - 1. hipMemcpy2DAsync API where Source Pitch is zero - 2. hipMemcpy2DAsync API where Destination Pitch is zero - 3. hipMemcpy2DAsync API where height is zero - 4. hipMemcpy2DAsync API where width is zero - * Test source - * ------------------------ - * - unit/memory/hipMemcpy2DAsync.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ - -TEST_CASE("Unit_hipMemcpy2DAsync_SizeCheck") { - CHECK_IMAGE_SUPPORT - HIP_CHECK(hipSetDevice(0)); - int *A_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(int)}; - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - - // Allocating memory - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, nullptr, NUM_W * NUM_H); - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - - // Initialize the data - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, nullptr); - - SECTION("hipMemcpy2DAsync API where Source Pitch is zero") { - REQUIRE(hipMemcpy2DAsync(A_h, 0, A_d, pitch_A, NUM_W, NUM_H, hipMemcpyDeviceToHost, stream) != - hipSuccess); - } - - SECTION("hipMemcpy2DAsync API where Destination Pitch is zero") { - REQUIRE(hipMemcpy2DAsync(A_h, width, A_d, 0, NUM_W, NUM_H, hipMemcpyDeviceToHost, stream) != - hipSuccess); - } - - SECTION("hipMemcpy2DAsync API where height is zero") { - REQUIRE(hipMemcpy2DAsync(A_h, width, A_d, pitch_A, NUM_W, 0, hipMemcpyDeviceToHost, stream) == - hipSuccess); - } - - SECTION("hipMemcpy2DAsync API where width is zero") { - REQUIRE(hipMemcpy2DAsync(A_h, width, A_d, pitch_A, 0, NUM_H, hipMemcpyDeviceToHost, stream) == - hipSuccess); - } - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - free(A_h); -} - -/** - * Test Description - * ------------------------ - * - This testcase performs the negative scenarios of hipMemcpy2DAsync API - 1. hipMemcpy2DAsync API by Passing nullptr to destination - 2. hipMemcpy2DAsync API by Passing nullptr to source - 3. hipMemcpy2DAsync API where width is > destination pitch - * Test source - * ------------------------ - * - unit/memory/hipMemcpy2DAsync.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ - -TEST_CASE("Unit_hipMemcpy2DAsync_Negative") { - CHECK_IMAGE_SUPPORT - HIP_CHECK(hipSetDevice(0)); - int *A_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(int)}; - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - - // Allocating memory - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, nullptr, NUM_W * NUM_H); - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - - // Initialize the data - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, nullptr); - - SECTION("hipMemcpy2DAsync API by Passing nullptr to destination") { - REQUIRE(hipMemcpy2DAsync(nullptr, width, A_d, pitch_A, COLUMNS * sizeof(int), ROWS, - hipMemcpyDeviceToHost, stream) != hipSuccess); - } - - SECTION("hipMemcpy2DAsync API by Passing nullptr to source") { - REQUIRE(hipMemcpy2DAsync(A_h, width, nullptr, pitch_A, COLUMNS * sizeof(int), ROWS, - hipMemcpyDeviceToHost, stream) != hipSuccess); - } - - SECTION("hipMemcpy2DAsync API where width is > destination pitch") { - REQUIRE(hipMemcpy2DAsync(A_h, 10, A_d, pitch_A, COLUMNS * sizeof(int), ROWS, - hipMemcpyDeviceToHost, stream) != hipSuccess); - } - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - free(A_h); -} - static void hipMemcpy2DAsync_Basic_Size_Test(size_t inc) { constexpr int defaultProgramSize = 256 * 1024 * 1024; constexpr int N = 2; @@ -508,7 +253,7 @@ static void hipMemcpy2DAsync_Basic_Size_Test(size_t inc) { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemcpy2DAsync_multiDevice_Basic_Size_Test", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DAsync_multiDevice_Basic_Size_Test) { CHECK_IMAGE_SUPPORT size_t input = 1 << 20; int numDevices = 0; diff --git a/catch/unit/memory/hipMemcpy2DFromArray.cc b/catch/unit/memory/hipMemcpy2DFromArray.cc index 7e4cfffa9..9e1c842b9 100644 --- a/catch/unit/memory/hipMemcpy2DFromArray.cc +++ b/catch/unit/memory/hipMemcpy2DFromArray.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipMemcpy2DFromArray_Positive_Default - Test basic memcpy between 2D array @@ -34,7 +22,7 @@ invalid #include #include -TEST_CASE("Unit_hipMemcpy2DFromArray_Positive_Default", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DFromArray_Positive_Default) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -87,7 +75,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_Positive_Default", "[multigpu]") { #endif } -TEST_CASE("Unit_hipMemcpy2DFromArray_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy2DFromArray_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -116,7 +104,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_Positive_Synchronization_Behavior") { #endif } -TEST_CASE("Unit_hipMemcpy2DFromArray_Positive_ZeroWidthHeight") { +TEST_CASE(Unit_hipMemcpy2DFromArray_Positive_ZeroWidthHeight) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -151,7 +139,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_Positive_ZeroWidthHeight") { } } -TEST_CASE("Unit_hipMemcpy2DFromArray_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpy2DFromArray_Negative_Parameters) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -260,7 +248,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpy2DFromArray_Capture") { +TEST_CASE(Unit_hipMemcpy2DFromArray_Capture) { CHECK_IMAGE_SUPPORT const auto width = 16; diff --git a/catch/unit/memory/hipMemcpy2DFromArrayAsync.cc b/catch/unit/memory/hipMemcpy2DFromArrayAsync.cc index 14a92eece..f30478d58 100644 --- a/catch/unit/memory/hipMemcpy2DFromArrayAsync.cc +++ b/catch/unit/memory/hipMemcpy2DFromArrayAsync.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipMemcpy2DFromArrayAsync_Positive_Default - Test basic async memcpy @@ -34,7 +22,7 @@ of hipMemcpy2DFromArrayAsync api when parameters are invalid #include #include -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Positive_Default", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DFromArrayAsync_Positive_Default) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -92,7 +80,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Positive_Default", "[multigpu]") { #endif } -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy2DFromArrayAsync_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -122,7 +110,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Positive_Synchronization_Behavior") { } } -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Positive_ZeroWidthHeight") { +TEST_CASE(Unit_hipMemcpy2DFromArrayAsync_Positive_ZeroWidthHeight) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -162,7 +150,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Positive_ZeroWidthHeight") { } } -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpy2DFromArrayAsync_Negative_Parameters) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; diff --git a/catch/unit/memory/hipMemcpy2DFromArrayAsync_old.cc b/catch/unit/memory/hipMemcpy2DFromArrayAsync_old.cc index 1591f807a..09ef05c80 100644 --- a/catch/unit/memory/hipMemcpy2DFromArrayAsync_old.cc +++ b/catch/unit/memory/hipMemcpy2DFromArrayAsync_old.cc @@ -1,191 +1,15 @@ /* -Copyright (c) 2021 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. -*/ - -/* -This file verifies the following scenarios of hipMemcpy2DFromArrayAsync API -1. Negative Scenarios -2. Extent Validation Scenarios -3. hipMemcpy2DFromArrayAsync Basic Scenario -4. Pinned Memory scenarios on same and peer GPU -5. Device Context change scenario where memory is allocated in - one GPU and stream is created in peer GPU. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include - static constexpr auto NUM_W{10}; static constexpr auto NUM_H{10}; -/* - * This testcase copies the data from host to device of - hipMemcpy2DFromArrayAsync API - * INPUT: Copying Host variable hData(Initialized with value Phi(1.618)) - * --> A_d device variable - * OUTPUT: For validating the result,Copying A_d device variable - * --> A_h host variable - * and verifying A_h with Phi - */ -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Basic") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - hipStream_t stream; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HipTest::setDefaultData(width * NUM_H, A_h, hData, nullptr); - HIP_CHECK(hipStreamCreate(&stream)); - - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice)); - SECTION("Calling hipMemcpy2DFromArrayAsync() with user declared stream obj") { - HIP_CHECK(hipMemcpy2DFromArrayAsync(A_h, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost, - stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - } - SECTION("Calling hipMemcpy2DFromArrayAsync() with hipStreamPerThread") { - HIP_CHECK(hipMemcpy2DFromArrayAsync(A_h, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost, - hipStreamPerThread)); - HIP_CHECK(hipStreamSynchronize(hipStreamPerThread)); - } - REQUIRE(HipTest::checkArray(A_h, hData, NUM_W, NUM_H) == true); - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} - -/* - * This testcase verifies the extent validation scenarios - * of hipMemcpy2DFromArrayAsync API - */ -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_ExtentValidation") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}, *valData{nullptr}; - hipStream_t stream; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - HipTest::initArrays(nullptr, nullptr, nullptr, nullptr, &valData, nullptr, width * NUM_H, - false); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HIP_CHECK(hipStreamCreate(&stream)); - - SECTION("Destination width is 0") { - REQUIRE(hipMemcpy2DFromArrayAsync(A_h, 0, A_d, 0, 0, NUM_W * sizeof(float), NUM_H, - hipMemcpyDeviceToHost, stream) != hipSuccess); - } - // hipMemcpy2DFromArrayAsync API would return success for - // width and height as 0 - // and does not perform any copy - // Validating the result with the initialized value - // 1.Initializing A_d with Pi value - // 2.copying A_d-->hData variable - // with height 0(copy will not be performed) - // 3 validating hData<-->A_h which will not be equal as copy is not done. - SECTION("Height is 0") { - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, A_h, width, width, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DFromArrayAsync(hData, width, A_d, 0, 0, NUM_W * sizeof(float), 0, - hipMemcpyDeviceToHost, stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - REQUIRE(HipTest::checkArray(hData, valData, NUM_W, NUM_H) == true); - } - // hipMemcpy2DFromArrayAsync API would return success for - // width and height as 0 - // and does not perform any copy - // Validating the result with the initialized value - // 1.Initializing A_d with Pi value - // 2.copying A_d-->hData variable - // with width 0(copy will not be performed) - // 3 validating hData<-->A_h which will not be equal as copy is not done. - - SECTION("Width is 0") { - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, A_h, width, width, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DFromArrayAsync(hData, width, A_d, 0, 0, 0, NUM_H, hipMemcpyDeviceToHost, - stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - REQUIRE(HipTest::checkArray(hData, valData, NUM_W, NUM_H) == true); - } - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); - HipTest::freeArrays(nullptr, nullptr, nullptr, nullptr, valData, nullptr, false); -} -/* - * This Scenario Verifies hipMemcpy2DFromArrayAsync API by copying the - * data from pinned host memory to device on same GPU - * INPUT: Copying Host variable PinnMem(Initialized with value "10" ) - * --> A_d device variable - * OUTPUT: For validating the result,Copying A_d device variable - * --> A_h host variable - * and verifying A_h with PinnedMem[0](i.e., 10) - */ -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_PinnedHostMemSameGpu") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - constexpr auto def_val{10}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *PinnMem{nullptr}; - hipStream_t stream; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, nullptr, width * NUM_H, - false); - HIP_CHECK(hipHostMalloc(reinterpret_cast(&PinnMem), width * NUM_H)); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HipTest::setDefaultData(width * NUM_H, A_h, nullptr, nullptr); - for (int i = 0; i < NUM_W * NUM_H; i++) { - PinnMem[i] = def_val + i; - } - HIP_CHECK(hipStreamCreate(&stream)); - - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, PinnMem, width, width, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DFromArrayAsync(A_h, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost, - stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - REQUIRE(HipTest::checkArray(A_h, PinnMem, NUM_W, NUM_H) == true); - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipHostFree(PinnMem)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, nullptr, false); -} /* * This Scenario Verifies hipMemcpy2DFromArrayAsync API by copying the * data from pinned host memory to device from Peer GPU. @@ -195,8 +19,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_PinnedHostMemSameGpu") { then A_d-->E_h in GPU1 * OUTPUT: validating the result by comparing A_h and E_h */ -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_multiDevicePinnedHostMem", - "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DFromArrayAsync_multiDevicePinnedHostMem) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -255,8 +78,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_multiDevicePinnedHostMem", * --> A_h host variable * and verifying A_h with Phi * */ -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_multiDeviceContextChange", - "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DFromArrayAsync_multiDeviceContextChange) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -298,51 +120,6 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_multiDeviceContextChange", SUCCEED("Number of devices are < 2"); } } -/* This testcase verifies the negative scenarios - * of hipMemcpy2DFromArrayAsync API - */ -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Negative") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - HipTest::setDefaultData(width * NUM_H, A_h, hData, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - - SECTION("Nullptr to destination") { - REQUIRE(hipMemcpy2DFromArrayAsync(nullptr, width, A_d, 0, 0, width, NUM_H, - hipMemcpyDeviceToHost, stream) != hipSuccess); - } - - SECTION("Nullptr to source") { - REQUIRE(hipMemcpy2DFromArrayAsync(A_h, width, nullptr, 0, 0, width, NUM_H, - hipMemcpyDeviceToHost, stream) != hipSuccess); - } - - SECTION("Passing offset more than 0") { - REQUIRE(hipMemcpy2DFromArrayAsync(A_h, width, A_d, 1, 1, width, NUM_H, hipMemcpyDeviceToHost, - stream) != hipSuccess); - } - - SECTION("Passing array more than allocated") { - REQUIRE(hipMemcpy2DFromArrayAsync(A_h, width, A_d, 0, 0, width + 2, NUM_H + 2, - hipMemcpyDeviceToHost, stream) != hipSuccess); - } - - // Cleaning of Memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} /** * Test Description @@ -357,7 +134,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Negative") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Capture") { +TEST_CASE(Unit_hipMemcpy2DFromArrayAsync_Capture) { CHECK_IMAGE_SUPPORT constexpr int kTestSizes[] = {3, 4, 100}; @@ -400,3 +177,4 @@ TEST_CASE("Unit_hipMemcpy2DFromArrayAsync_Capture") { HIP_CHECK(hipStreamDestroy(stream)); HIP_CHECK(hipFreeArray(device_array)); } + diff --git a/catch/unit/memory/hipMemcpy2DFromArray_old.cc b/catch/unit/memory/hipMemcpy2DFromArray_old.cc index 4e10f3b43..da1ce4413 100644 --- a/catch/unit/memory/hipMemcpy2DFromArray_old.cc +++ b/catch/unit/memory/hipMemcpy2DFromArray_old.cc @@ -1,160 +1,14 @@ /* -Copyright (c) 2021 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. -*/ - -/* -This file verifies the following scenarios of hipMemcpy2DFromArray API -1. Negative Scenarios -2. Extent Validation Scenarios -3. hipMemcpy2DFromArray Basic Scenario -4. Pinned Memory scenarios on same and peer GPU -5. Device Context change scenario where memory is allocated in - one GPU and API is triggered from peer GPU. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include static constexpr auto NUM_W{10}; static constexpr auto NUM_H{10}; -/* - * This testcase verifies device to host copy for hipMemcpy2DFromArray API - * INPUT: Copying Host variable hData(Initialized with value Phi(1.618)) - * --> A_d device variable - * OUTPUT: For validating the result,Copying A_d device variable - * --> A_h host variable - * and verifying A_h with Phi - */ -TEST_CASE("Unit_hipMemcpy2DFromArray_Basic") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HipTest::setDefaultData(width * NUM_H, A_h, hData, nullptr); - - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice)); - - HIP_CHECK(hipMemcpy2DFromArray(A_h, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(A_h, hData, NUM_W, NUM_H) == true); - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} - -/* - * This testcase verifies the extent validation scenarios - * of hipMemcpy2DFromArray API - */ -TEST_CASE("Unit_hipMemcpy2DFromArray_ExtentValidation") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}, *valData{nullptr}; - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - HipTest::initArrays(nullptr, nullptr, nullptr, nullptr, &valData, nullptr, width * NUM_H, - false); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - - SECTION("Destination width is 0") { - REQUIRE(hipMemcpy2DFromArray(A_h, 0, A_d, 0, 0, NUM_W * sizeof(float), NUM_H, - hipMemcpyDeviceToHost) != hipSuccess); - } - // hipMemcpy2DFromArray API would return success for width and height as 0 - // and does not perform any copy - // Validating the result with the initialized value - // 1.Initializing A_d with Pi value - // 2.copying A_d-->hData variable - // with height 0(copy will not be performed) - // 3 validating hData<-->A_h which will not be equal as copy is not done. - SECTION("Height is 0") { - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, A_h, width, width, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DFromArray(hData, width, A_d, 0, 0, width, 0, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(hData, valData, NUM_W, NUM_H) == true); - } - // hipMemcpy2DFromArray API would return success for width and height as 0 - // and does not perform any copy - // Validating the result with the initialized value - // 1.Initializing A_d with Pi value - // 2.copying A_d-->hData variable - // with width 0(copy will not be performed) - // 3 validating hData<-->A_h which will not be equal as copy is not done. - - SECTION("Width is 0") { - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, A_h, width, width, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DFromArray(hData, width, A_d, 0, 0, 0, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(hData, valData, NUM_W, NUM_H) == true); - } - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); - HipTest::freeArrays(nullptr, nullptr, nullptr, nullptr, valData, nullptr, false); -} -/* - * This Scenario Verifies hipMemcpy2DFromArray API by copying the - * data from pinned host memory to device on same GPU - * INPUT: Copying Host variable PinnMem(Initialized with value "10" ) - * --> A_d device variable - * OUTPUT: For validating the result,Copying A_d device variable - * --> A_h host variable - * and verifying A_h with PinnedMem[0](i.e., 10) - */ -TEST_CASE("Unit_hipMemcpy2DFromArray_PinnedMemSameGPU") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - constexpr auto def_val{10}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *PinnMem{nullptr}; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, nullptr, width * NUM_H, - false); - HIP_CHECK(hipHostMalloc(reinterpret_cast(&PinnMem), width * NUM_H)); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HipTest::setDefaultData(width * NUM_H, A_h, nullptr, nullptr); - for (int i = 0; i < NUM_W * NUM_H; i++) { - PinnMem[i] = def_val + i; - } - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, PinnMem, width, width, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DFromArray(A_h, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(A_h, PinnMem, NUM_W, NUM_H) == true); - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipHostFree(PinnMem)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, nullptr, false); -} /* * This Scenario Verifies hipMemcpy2DFromArray API by copying the * data from pinned host memory to device from Peer GPU. @@ -165,8 +19,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_PinnedMemSameGPU") { * --> E_h host variable * and verifying A_h with E_h */ -TEST_CASE("Unit_hipMemcpy2DFromArray_multiDevicePinnedMemPeerGpu", - "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DFromArray_multiDevicePinnedMemPeerGpu) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -219,7 +72,7 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_multiDevicePinnedMemPeerGpu", * --> A_h host variable * and verifying A_h with Phi * */ -TEST_CASE("Unit_hipMemcpy2DFromArray_multiDeviceContextChange", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DFromArray_multiDeviceContextChange) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -256,45 +109,3 @@ TEST_CASE("Unit_hipMemcpy2DFromArray_multiDeviceContextChange", "[multigpu]") { SUCCEED("Number of devices are < 2"); } } -/* This testcase verifies the negative scenarios of - * hipMemcpy2DFromArray API - */ -TEST_CASE("Unit_hipMemcpy2DFromArray_Negative") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - HipTest::setDefaultData(width * NUM_H, A_h, hData, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - - SECTION("Nullptr to destination") { - REQUIRE(hipMemcpy2DFromArray(nullptr, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost) != - hipSuccess); - } - - SECTION("Nullptr to source") { - REQUIRE(hipMemcpy2DFromArray(A_h, width, nullptr, 0, 0, width, NUM_H, hipMemcpyDeviceToHost) != - hipSuccess); - } - - SECTION("Passing offset more than 0") { - REQUIRE(hipMemcpy2DFromArray(A_h, width, A_d, 1, 1, width, NUM_H, hipMemcpyDeviceToHost) != - hipSuccess); - } - - SECTION("Passing array more than allocated") { - REQUIRE(hipMemcpy2DFromArray(A_h, width, A_d, 0, 0, width + 2, NUM_H + 2, - hipMemcpyDeviceToHost) != hipSuccess); - } - - // Cleaning of memory - HIP_CHECK(hipFreeArray(A_d)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} diff --git a/catch/unit/memory/hipMemcpy2DToArray.cc b/catch/unit/memory/hipMemcpy2DToArray.cc index c5ad58601..74e820b89 100644 --- a/catch/unit/memory/hipMemcpy2DToArray.cc +++ b/catch/unit/memory/hipMemcpy2DToArray.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipMemcpy2DToArray_Positive_Default - Test basic memcpy between host/device @@ -33,7 +21,7 @@ unsuccessful execution of hipMemcpy2DToArray api when parameters are invalid #include #include -TEST_CASE("Unit_hipMemcpy2DToArray_Positive_Default", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DToArray_Positive_Default) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -85,7 +73,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_Positive_Default", "[multigpu]") { #endif } -TEST_CASE("Unit_hipMemcpy2DToArray_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy2DToArray_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -111,7 +99,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_Positive_Synchronization_Behavior") { #endif } -TEST_CASE("Unit_hipMemcpy2DToArray_Positive_ZeroWidthHeight") { +TEST_CASE(Unit_hipMemcpy2DToArray_Positive_ZeroWidthHeight) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -146,7 +134,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_Positive_ZeroWidthHeight") { } } -TEST_CASE("Unit_hipMemcpy2DToArray_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpy2DToArray_Negative_Parameters) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -255,7 +243,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpy2DToArray_Capture") { +TEST_CASE(Unit_hipMemcpy2DToArray_Capture) { CHECK_IMAGE_SUPPORT const auto width = 16; diff --git a/catch/unit/memory/hipMemcpy2DToArrayAsync.cc b/catch/unit/memory/hipMemcpy2DToArrayAsync.cc index c90ab755b..050a729fe 100644 --- a/catch/unit/memory/hipMemcpy2DToArrayAsync.cc +++ b/catch/unit/memory/hipMemcpy2DToArrayAsync.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipMemcpy2DToArrayAsync_Positive_Default - Test basic async memcpy between @@ -34,7 +22,7 @@ of hipMemcpy2DToArrayAsync api when parameters are invalid #include #include -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Positive_Default", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DToArrayAsync_Positive_Default) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -92,7 +80,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Positive_Default", "[multigpu]") { #endif } -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy2DToArrayAsync_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -117,7 +105,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Positive_Synchronization_Behavior") { } } -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Positive_ZeroWidthHeight") { +TEST_CASE(Unit_hipMemcpy2DToArrayAsync_Positive_ZeroWidthHeight) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -156,7 +144,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Positive_ZeroWidthHeight") { } } -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpy2DToArrayAsync_Negative_Parameters) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -279,7 +267,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Negative_Parameters") { static constexpr int kNumWidth = 10; static constexpr int kNumHeight = 10; -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Capture") { +TEST_CASE(Unit_hipMemcpy2DToArrayAsync_Capture) { CHECK_IMAGE_SUPPORT constexpr size_t kHostRowBytes = sizeof(float) * kNumWidth; diff --git a/catch/unit/memory/hipMemcpy2DToArrayAsync_old.cc b/catch/unit/memory/hipMemcpy2DToArrayAsync_old.cc index cd2e55613..4f462d4c4 100644 --- a/catch/unit/memory/hipMemcpy2DToArrayAsync_old.cc +++ b/catch/unit/memory/hipMemcpy2DToArrayAsync_old.cc @@ -1,188 +1,15 @@ /* -Copyright (c) 2021 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. -*/ - -/* -This file verifies the following scenarios of hipMemcpy2DToArrayAsync API -1. Negative Scenarios -2. Extent Validation Scenarios -3. hipMemcpy2DToArrayAsync Basic Scenario -4. Pinned Memory scenarios on same and peer GPU -5. Device Context change scenario where memory is allocated in - one GPU and stream is created in peer GPU. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include -#include - static constexpr auto NUM_W{10}; static constexpr auto NUM_H{10}; -/* - * This Scenario copies the data from host to device - * INPUT: Copying Host variable hData(Initialized with value Phi(1.618)) - * --> A_d device variable - * OUTPUT: For validating the result,Copying A_d device variable - * --> A_h host variable - * and verifying A_h with Phi - */ -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Basic") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - hipStream_t stream; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HipTest::setDefaultData(width * NUM_H, A_h, hData, nullptr); - HIP_CHECK(hipStreamCreate(&stream)); - SECTION("Calling hipMemcpy2DToArrayAsync() with user declared stream obj") { - HIP_CHECK(hipMemcpy2DToArrayAsync(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice, - stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - } - SECTION("Calling hipMemcpy2DToArrayAsync() with hipStreamPerThread") { - HIP_CHECK(hipMemcpy2DToArrayAsync(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice, - hipStreamPerThread)); - HIP_CHECK(hipStreamSynchronize(hipStreamPerThread)); - } - HIP_CHECK(hipMemcpy2DFromArray(A_h, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(A_h, hData, NUM_W, NUM_H) == true); - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} - -/* - * This testcase verifies the extent validation scenarios - */ -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_ExtentValidation") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - hipStream_t stream; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HIP_CHECK(hipStreamCreate(&stream)); - - SECTION("Source width is 0") { - REQUIRE(hipMemcpy2DToArrayAsync(A_d, 0, 0, hData, 0, width, NUM_H, hipMemcpyHostToDevice, - stream) != hipSuccess); - HIP_CHECK(hipStreamSynchronize(stream)); - } - // hipMemcpy2DToArray API would return success for width and height as 0 - // and does not perform any copy - // Validating the result with the initialized value - // 1.Initializing A_d with Pi value - // 2.copying hData(Phi)-->A_d device variable - // with height 0(copy will not be performed) - // 3.copying A_d-->hData and validating it with A_h data - SECTION("Height is 0") { - HIP_CHECK(hipMemcpy2DToArrayAsync(A_d, 0, 0, A_h, width, width, NUM_H, hipMemcpyHostToDevice, - stream)); - HIP_CHECK( - hipMemcpy2DToArrayAsync(A_d, 0, 0, hData, width, width, 0, hipMemcpyHostToDevice, stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - HIP_CHECK(hipMemcpy2DFromArray(hData, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(hData, A_h, NUM_W, NUM_H) == true); - } - // hipMemcpy2DToArray API would return success for width and height as 0 - // and does not perform any copy - // Validating the result with the initialized value - // 1.Initializing A_d with Pi value - // 2.copying hData(Phi)-->A_d device variable - // with width 0(copy will not be performed) - // 3.copying A_d-->hData and validating it with A_h data - SECTION("Width is 0") { - HIP_CHECK(hipMemcpy2DToArrayAsync(A_d, 0, 0, A_h, width, width, NUM_H, hipMemcpyHostToDevice, - stream)); - HIP_CHECK( - hipMemcpy2DToArrayAsync(A_d, 0, 0, hData, width, 0, NUM_H, hipMemcpyHostToDevice, stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - HIP_CHECK(hipMemcpy2DFromArray(hData, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(hData, A_h, NUM_W, NUM_H) == true); - } - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} -/* - * This Scenario Verifies hipMemcpy2DToArray API by copying the - * data from pinned host memory to device on same GPU - * INPUT: Copying Host variable PinnMem(Initialized with value "10" ) - * --> A_d device variable - * OUTPUT: For validating the result,Copying A_d device variable - * --> A_h host variable - * and verifying A_h with PinnedMem[0](i.e., 10) - */ -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_PinnedHostMemSameGpu") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - constexpr auto def_val{10}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *PinnMem{nullptr}; - hipStream_t stream; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, nullptr, width * NUM_H, - false); - HIP_CHECK(hipHostMalloc(reinterpret_cast(&PinnMem), width * NUM_H)); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HipTest::setDefaultData(width * NUM_H, A_h, nullptr, nullptr); - for (int i = 0; i < NUM_W * NUM_H; i++) { - PinnMem[i] = def_val + i; - } - HIP_CHECK(hipStreamCreate(&stream)); - - HIP_CHECK(hipMemcpy2DToArrayAsync(A_d, 0, 0, PinnMem, width, width, NUM_H, hipMemcpyHostToDevice, - stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - HIP_CHECK(hipMemcpy2DFromArray(A_h, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(A_h, PinnMem, NUM_W, NUM_H) == true); - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipHostFree(PinnMem)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, nullptr, false); -} /* * This Scenario Verifies hipMemcpy2DToArray API by copying the * data from pinned host memory to device from Peer GPU. @@ -194,8 +21,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_PinnedHostMemSameGpu") { * --> A_h host variable * and verifying A_h with E_h[0]+i(i.e., 10+i) */ -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_multiDevicePinnedHostMem", - "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DToArrayAsync_multiDevicePinnedHostMem) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -255,8 +81,7 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_multiDevicePinnedHostMem", * --> A_h host variable * and verifying A_h with Phi * */ -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_multiDeviceDeviceContextChange", - "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DToArrayAsync_multiDeviceDeviceContextChange) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -298,47 +123,3 @@ TEST_CASE("Unit_hipMemcpy2DToArrayAsync_multiDeviceDeviceContextChange", SUCCEED("Number of devices are < 2"); } } -/* This testcase verifies the negative scenarios - */ -TEST_CASE("Unit_hipMemcpy2DToArrayAsync_Negative") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - HipTest::setDefaultData(width * NUM_H, A_h, hData, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - - SECTION("Nullptr to destination") { - REQUIRE(hipMemcpy2DToArrayAsync(nullptr, 0, 0, hData, width, width, NUM_H, - hipMemcpyHostToDevice, stream) != hipSuccess); - } - - SECTION("Nullptr to source") { - REQUIRE(hipMemcpy2DToArrayAsync(A_d, 0, 0, nullptr, width, width, NUM_H, hipMemcpyHostToDevice, - stream) != hipSuccess); - } - - SECTION("Passing offset more than 0") { - REQUIRE(hipMemcpy2DToArrayAsync(A_d, 1, 1, hData, width, width, NUM_H, hipMemcpyHostToDevice, - stream) != hipSuccess); - } - - SECTION("Passing array more than allocated") { - REQUIRE(hipMemcpy2DToArrayAsync(A_d, 0, 0, hData, width, width + 2, NUM_H + 2, - hipMemcpyHostToDevice, stream) != hipSuccess); - } - - // Cleaning of Memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} diff --git a/catch/unit/memory/hipMemcpy2DToArray_old.cc b/catch/unit/memory/hipMemcpy2DToArray_old.cc index e302d606b..40da40897 100644 --- a/catch/unit/memory/hipMemcpy2DToArray_old.cc +++ b/catch/unit/memory/hipMemcpy2DToArray_old.cc @@ -1,158 +1,14 @@ /* -Copyright (c) 2021 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. -*/ - -/* -This file verifies the following scenarios of hipMemcpy2DToArray API -1. Negative Scenarios -2. Extent Validation Scenarios -3. hipMemcpy2DToArray Basic Scenario -4. Pinned Memory scenarios on same and peer GPU -5. Device Context change scenario where memory is allocated in - one GPU and API is triggered from peer GPU. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include -#include static constexpr auto NUM_W{10}; static constexpr auto NUM_H{10}; -/* - * This Scenario copies the data from host to device - * INPUT: Copying Host variable hData(Initialized with value Phi(1.618)) - * --> A_d device variable - * OUTPUT: For validating the result,Copying A_d device variable - * --> A_h host variable - * and verifying A_h with Phi - */ -TEST_CASE("Unit_hipMemcpy2DToArray_Basic") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HipTest::setDefaultData(width * NUM_H, A_h, hData, nullptr); - - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice)); - - HIP_CHECK(hipMemcpy2DFromArray(A_h, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(A_h, hData, NUM_W, NUM_H) == true); - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} - -/* - * This testcase verifies the extent validation scenarios - */ -TEST_CASE("Unit_hipMemcpy2DToArray_ExtentValidation") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - - SECTION("Source width is 0") { - REQUIRE(hipMemcpy2DToArray(A_d, 0, 0, hData, 0, width, NUM_H, hipMemcpyHostToDevice) != - hipSuccess); - } - // hipMemcpy2DToArray API would return success for width and height as 0 - // and does not perform any copy - // Validating the result with the initialized value - // 1.Initializing A_d with Pi value - // 2.copying hData(Phi)-->A_d device variable - // with height 0(copy will not be performed) - // 3.copying A_d-->hData and validating it with A_h data - SECTION("Height is 0") { - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, A_h, width, width, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, 0, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DFromArray(hData, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(hData, A_h, NUM_W, NUM_H) == true); - } - // hipMemcpy2DToArray API would return success for width and height as 0 - // and does not perform any copy - // Validating the result with the initialized value - // 1.Initializing A_d with Pi value - // 2.copying hData(Phi)-->A_d device variable - // with width 0(copy will not be performed) - // 3.copying A_d-->hData and validating it with A_h data - SECTION("Width is 0") { - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, A_h, width, width, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, 0, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DFromArray(hData, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(hData, A_h, NUM_W, NUM_H) == true); - } - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} -/* - * This Scenario Verifies hipMemcpy2DToArray API by copying the - * data from pinned host memory to device on same GPU - * INPUT: Copying Host variable PinnMem(Initialized with value "10" ) - * --> A_d device variable - * OUTPUT: For validating the result,Copying A_d device variable - * --> A_h host variable - * and verifying A_h with PinnedMem[0](i.e., 10) - */ -TEST_CASE("Unit_hipMemcpy2DToArray_PinnedMemSameGPU") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - constexpr auto def_val{10}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *PinnMem{nullptr}; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, nullptr, width * NUM_H, - false); - HIP_CHECK(hipHostMalloc(reinterpret_cast(&PinnMem), width * NUM_H)); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HipTest::setDefaultData(width * NUM_H, A_h, nullptr, nullptr); - for (int i = 0; i < NUM_W * NUM_H; i++) { - PinnMem[i] = def_val + i; - } - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, PinnMem, width, width, NUM_H, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy2DFromArray(A_h, width, A_d, 0, 0, width, NUM_H, hipMemcpyDeviceToHost)); - REQUIRE(HipTest::checkArray(A_h, PinnMem, NUM_W, NUM_H) == true); - - // Cleaning the memory - HIP_CHECK(hipFreeArray(A_d)); - HIP_CHECK(hipHostFree(PinnMem)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, nullptr, false); -} /* * This Scenario Verifies hipMemcpy2DToArray API by copying the * data from pinned host memory to device from Peer GPU. @@ -164,7 +20,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_PinnedMemSameGPU") { * --> A_h host variable * and verifying A_h with E_h[0]+i(i.e., 10+i) */ -TEST_CASE("Unit_hipMemcpy2DToArray_multiDevicePinnedMemPeerGpu", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DToArray_multiDevicePinnedMemPeerGpu) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -218,8 +74,7 @@ TEST_CASE("Unit_hipMemcpy2DToArray_multiDevicePinnedMemPeerGpu", "[multigpu]") { * --> A_h host variable * and verifying A_h with Phi * */ -TEST_CASE("Unit_hipMemcpy2DToArray_multiDeviceDeviceContextChange", - "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2DToArray_multiDeviceDeviceContextChange) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -256,44 +111,3 @@ TEST_CASE("Unit_hipMemcpy2DToArray_multiDeviceDeviceContextChange", SUCCEED("Number of devices are < 2"); } } -/* This testcase verifies the negative scenarios - */ -TEST_CASE("Unit_hipMemcpy2DToArray_Negative") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d{nullptr}; - size_t width{sizeof(float) * NUM_W}; - float *A_h{nullptr}, *hData{nullptr}; - - // Initialization of variables - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &hData, nullptr, width * NUM_H, - false); - HipTest::setDefaultData(width * NUM_H, A_h, hData, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - - SECTION("Nullptr to destination") { - REQUIRE(hipMemcpy2DToArray(nullptr, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice) != - hipSuccess); - } - - SECTION("Nullptr to source") { - REQUIRE(hipMemcpy2DToArray(A_d, 0, 0, nullptr, width, width, NUM_H, hipMemcpyHostToDevice) != - hipSuccess); - } - - SECTION("Passing offset more than 0") { - REQUIRE(hipMemcpy2DToArray(A_d, 1, 1, hData, width, width, NUM_H, hipMemcpyHostToDevice) != - hipSuccess); - } - - SECTION("Passing array more than allocated") { - REQUIRE(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width + 2, NUM_H + 2, - hipMemcpyHostToDevice) != hipSuccess); - } - - // Cleaning of memory - HIP_CHECK(hipFreeArray(A_d)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, hData, nullptr, false); -} diff --git a/catch/unit/memory/hipMemcpy2D_old.cc b/catch/unit/memory/hipMemcpy2D_old.cc index d0afaa1df..dc5633767 100644 --- a/catch/unit/memory/hipMemcpy2D_old.cc +++ b/catch/unit/memory/hipMemcpy2D_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021-2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpy2D hipMemcpy2D @@ -27,23 +14,6 @@ THE SOFTWARE. * Copies data between host and device. */ -// Testcase Description: -// 1) Verifies the working of Memcpy2D API negative scenarios by -// Pass NULL to destination pointer -// Pass NULL to Source pointer -// Pass width greater than spitch/dpitch -// 2) Verifies hipMemcpy2D API by -// pass 0 to destionation pitch -// pass 0 to source pitch -// pass 0 to width -// pass 0 to height -// 3) Verifies working of Memcpy2D API on host memory and pinned host memory by -// performing D2H, D2D and H2D memory kind copies on same GPU -// 4) Verifies working of Memcpy2D API for the following scenarios -// H2D-D2D-D2H on host and device memory -// H2D-D2D-D2H on pinned host and device memory -// H2D-D2D-D2H functionalities where memory is allocated in GPU-0 -// and API is triggered from GPU-1 #include #include @@ -74,7 +44,7 @@ static constexpr auto ROWS{8}; * - HIP_VERSION >= 6.1 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy2D_H2D-D2D-D2H", "", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpy2D_H2D_D2D_D2H, int, float, double) { CHECK_IMAGE_SUPPORT // 1 refers to pinned host memory auto mem_type = GENERATE(0, 1); @@ -150,7 +120,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy2D_H2D-D2D-D2H", "", int, float, double) { * - HIP_VERSION >= 6.1 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy2D_H2D-D2D-D2H_WithOffset", "", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpy2D_H2D_D2D_D2H_WithOffset, int, float, double) { CHECK_IMAGE_SUPPORT // 1 refers to pinned host memory auto mem_type = GENERATE(0, 1); @@ -230,7 +200,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy2D_H2D-D2D-D2H_WithOffset", "", int, float, do * ------------------------ * - HIP_VERSION >= 6.0 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy2D_H2D-D2D-D2H_Managed_WithOffset", "", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpy2D_H2D_D2D_D2H_Managed_WithOffset, int, float, double) { CHECK_IMAGE_SUPPORT // 1 refers to pinned host memory auto mem_type = GENERATE(0, 1); @@ -286,188 +256,6 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy2D_H2D-D2D-D2H_Managed_WithOffset", "", int, f } } -/** - * Test Description - * ------------------------ - * - This testcases performs the following scenarios of hipMemcpy2D API on Peer GPU - 1. H2D-D2D-D2H for Host Memory<-->Device Memory - 2. H2D-D2D-D2H for Pinned Host Memory<-->Device Memory - 3. Device context change where memory is allocated in GPU-0 - and API is trigerred from GPU-1 - - Input : "A_h" initialized based on data type - "A_h" --> "A_d" using H2D copy - "A_d" --> "X_d" using D2D copy - "X_d" --> "B_h" using D2H copy - Output: Validating A_h with B_h both should be equal for - the number of COLUMNS and ROWS copied - * Test source - * ------------------------ - * - unit/memory/hipMemcpy2D.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEMPLATE_TEST_CASE("Unit_hipMemcpy2D_multiDevice-D2D", "[multigpu]", int, float, - double) { - CHECK_IMAGE_SUPPORT - auto mem_type = GENERATE(0, 1); - int numDevices = 0; - int canAccessPeer = 0; - TestType *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(TestType)}; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); - if (canAccessPeer) { - HIP_CHECK(hipSetDevice(0)); - - // Allocating memory - if (mem_type) { - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &B_h, &C_h, NUM_W * NUM_H, - true); - } else { - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &B_h, &C_h, NUM_W * NUM_H, - false); - } - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - - // Initialize the data - HipTest::setDefaultData(NUM_W * NUM_H, A_h, B_h, C_h); - - char* X_d{nullptr}; - size_t pitch_X; - HIP_CHECK(hipMallocPitch(reinterpret_cast(&X_d), &pitch_X, width, NUM_H)); - - // Change device - HIP_CHECK(hipSetDevice(1)); - - // Host to Device - HIP_CHECK(hipMemcpy2D(A_d, pitch_A, A_h, COLUMNS * sizeof(TestType), - COLUMNS * sizeof(TestType), ROWS, hipMemcpyHostToDevice)); - - // Device to Device - HIP_CHECK(hipMemcpy2D(X_d, pitch_X, A_d, pitch_A, COLUMNS * sizeof(TestType), ROWS, - hipMemcpyDeviceToDevice)); - - // Device to Host - HIP_CHECK(hipMemcpy2D(B_h, COLUMNS * sizeof(TestType), X_d, pitch_X, - COLUMNS * sizeof(TestType), ROWS, hipMemcpyDeviceToHost)); - - // Validating the result - REQUIRE(HipTest::checkArray(A_h, B_h, COLUMNS, ROWS) == true); - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - if (mem_type) { - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, B_h, C_h, true); - } else { - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, B_h, C_h, false); - } - HIP_CHECK(hipFree(X_d)); - } else { - SUCCEED("Machine does not seem to have P2P"); - } - } else { - SUCCEED("skipped the testcase as no of devices is less than 2"); - } -} - -/** - * Test Description - * ------------------------ - * - This Testcase verifies the null size checks of hipMemcpy2D API - * Test source - * ------------------------ - * - unit/memory/hipMemcpy2D.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEST_CASE("Unit_hipMemcpy2D_SizeCheck") { - CHECK_IMAGE_SUPPORT - HIP_CHECK(hipSetDevice(0)); - int *A_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(int)}; - - // Allocating memory - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, nullptr, NUM_W * NUM_H); - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - - // Initialize the data - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, nullptr); - - SECTION("hipMemcpy2D API where Source Pitch is zero") { - REQUIRE(hipMemcpy2D(A_h, 0, A_d, pitch_A, NUM_W, NUM_H, hipMemcpyDeviceToHost) != hipSuccess); - } - - SECTION("hipMemcpy2D API where Destination Pitch is zero") { - REQUIRE(hipMemcpy2D(A_h, width, A_d, 0, NUM_W, NUM_H, hipMemcpyDeviceToHost) != hipSuccess); - } - - SECTION("hipMemcpy2D API where height is zero") { - REQUIRE(hipMemcpy2D(A_h, width, A_d, pitch_A, NUM_W, 0, hipMemcpyDeviceToHost) == hipSuccess); - } - - SECTION("hipMemcpy2D API where width is zero") { - REQUIRE(hipMemcpy2D(A_h, width, A_d, pitch_A, 0, NUM_H, hipMemcpyDeviceToHost) == hipSuccess); - } - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - free(A_h); -} - -/** - * Test Description - * ------------------------ - * - This Testcase verifies all the negative scenarios of hipMemcpy2D API - * Test source - * ------------------------ - * - unit/memory/hipMemcpy2D.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEST_CASE("Unit_hipMemcpy2D_Negative") { - CHECK_IMAGE_SUPPORT - HIP_CHECK(hipSetDevice(0)); - int *A_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(int)}; - - // Allocating memory - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, nullptr, NUM_W * NUM_H); - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - - // Initialize the data - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, nullptr); - - SECTION("hipMemcpy2D API by Passing nullptr to destination") { - REQUIRE(hipMemcpy2D(nullptr, width, A_d, pitch_A, COLUMNS * sizeof(int), ROWS, - hipMemcpyDeviceToHost) != hipSuccess); - } - - SECTION("hipMemcpy2D API by Passing nullptr to destination") { - REQUIRE(hipMemcpy2D(nullptr, width, nullptr, pitch_A, COLUMNS * sizeof(int), ROWS, - hipMemcpyDeviceToHost) != hipSuccess); - } - - SECTION("hipMemcpy2D API where width is greater than destination pitch") { - REQUIRE(hipMemcpy2D(A_h, 10, A_d, pitch_A, COLUMNS * sizeof(int), ROWS, - hipMemcpyDeviceToHost) != hipSuccess); - } - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - free(A_h); -} - static void hipMemcpy2D_Basic_Size_Test(size_t inc) { constexpr int defaultProgramSize = 256 * 1024 * 1024; constexpr int N = 2; @@ -525,7 +313,7 @@ static void hipMemcpy2D_Basic_Size_Test(size_t inc) { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemcpy2D_multiDevice_Basic_Size_Test", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy2D_multiDevice_Basic_Size_Test) { CHECK_IMAGE_SUPPORT size_t input = 1 << 20; int numDevices = 0; @@ -546,3 +334,4 @@ TEST_CASE("Unit_hipMemcpy2D_multiDevice_Basic_Size_Test", "[multigpu]") { * End doxygen group MemcpyTest. * @} */ + diff --git a/catch/unit/memory/hipMemcpy3D.cc b/catch/unit/memory/hipMemcpy3D.cc index 6d78bdca7..beec11c0c 100644 --- a/catch/unit/memory/hipMemcpy3D.cc +++ b/catch/unit/memory/hipMemcpy3D.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -30,7 +14,7 @@ THE SOFTWARE. #pragma clang diagnostic ignored "-Wunused-variable" -TEST_CASE("Unit_hipMemcpy3D_Positive_Basic") { +TEST_CASE(Unit_hipMemcpy3D_Positive_Basic) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -49,7 +33,7 @@ TEST_CASE("Unit_hipMemcpy3D_Positive_Basic") { SECTION("Host to Host") { Memcpy3DHostToHostShell(Memcpy3DWrapper<>); } } -TEST_CASE("Unit_hipMemcpy3D_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy3D_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT HIP_CHECK(hipDeviceSynchronize()); @@ -63,7 +47,7 @@ TEST_CASE("Unit_hipMemcpy3D_Positive_Synchronization_Behavior") { SECTION("Host to Host") { Memcpy3DHtoHSyncBehavior(Memcpy3DWrapper<>, true); } } -TEST_CASE("Unit_hipMemcpy3D_Positive_DeviceToDevice_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy3D_Positive_DeviceToDevice_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT LinearAllocGuard3D src_alloc(make_hipExtent(32 * sizeof(int), 32, 8)); @@ -89,14 +73,14 @@ TEST_CASE("Unit_hipMemcpy3D_Positive_DeviceToDevice_Synchronization_Behavior") { REQUIRE(hipStreamQuery(kernel_stream) == hipSuccess); } -TEST_CASE("Unit_hipMemcpy3D_Positive_Parameters") { +TEST_CASE(Unit_hipMemcpy3D_Positive_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = false; Memcpy3DZeroWidthHeightDepth(Memcpy3DWrapper<>); } -TEST_CASE("Unit_hipMemcpy3D_Positive_Array") { +TEST_CASE(Unit_hipMemcpy3D_Positive_Array) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -106,7 +90,7 @@ TEST_CASE("Unit_hipMemcpy3D_Positive_Array") { #endif } -TEST_CASE("Unit_hipMemcpy3D_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpy3D_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr hipExtent extent{128 * sizeof(int), 128, 8}; @@ -255,7 +239,7 @@ TEST_CASE("Unit_hipMemcpy3D_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpy3D_Capture") { +TEST_CASE(Unit_hipMemcpy3D_Capture) { CHECK_IMAGE_SUPPORT constexpr hipExtent extent{16 * sizeof(int), 16, 16}; diff --git a/catch/unit/memory/hipMemcpy3DAsync.cc b/catch/unit/memory/hipMemcpy3DAsync.cc index aac4cfb57..f3ae1060f 100644 --- a/catch/unit/memory/hipMemcpy3DAsync.cc +++ b/catch/unit/memory/hipMemcpy3DAsync.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -30,7 +14,7 @@ THE SOFTWARE. #pragma clang diagnostic ignored "-Wunused-variable" -TEST_CASE("Unit_hipMemcpy3DAsync_Positive_Basic") { +TEST_CASE(Unit_hipMemcpy3DAsync_Positive_Basic) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -55,7 +39,7 @@ TEST_CASE("Unit_hipMemcpy3DAsync_Positive_Basic") { SECTION("Host to Host") { Memcpy3DHostToHostShell(Memcpy3DWrapper, stream); } } -TEST_CASE("Unit_hipMemcpy3DAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy3DAsync_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -77,14 +61,14 @@ TEST_CASE("Unit_hipMemcpy3DAsync_Positive_Synchronization_Behavior") { SECTION("Host to Host") { Memcpy3DHtoHSyncBehavior(Memcpy3DWrapper, true); } } -TEST_CASE("Unit_hipMemcpy3DAsync_Positive_Parameters") { +TEST_CASE(Unit_hipMemcpy3DAsync_Positive_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = true; Memcpy3DZeroWidthHeightDepth(Memcpy3DWrapper); } -TEST_CASE("Unit_hipMemcpy3DAsync_Positive_Array") { +TEST_CASE(Unit_hipMemcpy3DAsync_Positive_Array) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -94,7 +78,7 @@ TEST_CASE("Unit_hipMemcpy3DAsync_Positive_Array") { #endif } -TEST_CASE("Unit_hipMemcpy3DAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpy3DAsync_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -244,7 +228,7 @@ TEST_CASE("Unit_hipMemcpy3DAsync_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpy3DAsync_Capture") { +TEST_CASE(Unit_hipMemcpy3DAsync_Capture) { CHECK_IMAGE_SUPPORT constexpr hipExtent kExtent{128 * sizeof(int), 128, 8}; diff --git a/catch/unit/memory/hipMemcpy3DAsync_old.cc b/catch/unit/memory/hipMemcpy3DAsync_old.cc index 82984bc55..560c4f4e9 100644 --- a/catch/unit/memory/hipMemcpy3DAsync_old.cc +++ b/catch/unit/memory/hipMemcpy3DAsync_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpy3DAsync hipMemcpy3DAsync @@ -623,61 +610,6 @@ template void Memcpy3DAsync::simple_Memcpy3DAsync() { DeAllocateMemory(); } -/** - * Test Description - * ------------------------ - * - This testcase verifies hipMemcpyAsync for different datatypes and different sizes - * Test source - * ------------------------ - * - unit/memory/hipMemcpy3DAsync_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEMPLATE_TEST_CASE("Unit_hipMemcpy3DAsync_Basic", "[hipMemcpy3DAsync]", int, unsigned int, float) { - CHECK_IMAGE_SUPPORT - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - int device = -1; - HIP_CHECK(hipGetDevice(&device)); - hipDeviceProp_t prop; - HIP_CHECK(hipGetDeviceProperties(&prop, device)); - auto i = GENERATE_COPY(10, 100, 1024, prop.maxTexture3D[0]); - auto j = GENERATE(10, 100); - if (numDevices > 1) { - if (std::is_same::value) { - Memcpy3DAsync memcpy3d_obj(i, j, j, hipChannelFormatKindSigned); - memcpy3d_obj.simple_Memcpy3DAsync(); - } else if (std::is_same::value) { - Memcpy3DAsync memcpy3d_obj(i, j, j, hipChannelFormatKindUnsigned); - memcpy3d_obj.simple_Memcpy3DAsync(); - } else if (std::is_same::value) { - Memcpy3DAsync memcpy3d_obj(i, j, j, hipChannelFormatKindFloat); - memcpy3d_obj.simple_Memcpy3DAsync(); - } - } else { - SUCCEED("skipping the testcases as numDevices < 2"); - } -} - -/** - * Test Description - * ------------------------ - * - This testcase performs the extent validation scenarios of hipMemcpy3D API - * Test source - * ------------------------ - * - unit/memory/hipMemcpy3DAsync_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEST_CASE("Unit_hipMemcpy3DAsync_ExtentValidation") { - CHECK_IMAGE_SUPPORT - Memcpy3DAsync memcpy3d(width, height, depth, hipChannelFormatKindSigned); - memcpy3d.Extent_Validation(); -} /** * Test Description @@ -691,7 +623,7 @@ TEST_CASE("Unit_hipMemcpy3DAsync_ExtentValidation") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemcpy3DAsync_multiDevice-Negative") { +TEST_CASE(Unit_hipMemcpy3DAsync_multiDevice_Negative) { CHECK_IMAGE_SUPPORT int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -703,37 +635,6 @@ TEST_CASE("Unit_hipMemcpy3DAsync_multiDevice-Negative") { } } -/** - * Test Description - * ------------------------ - * - This testcase performs the D2H,H2D and D2D on peer GPU device - * Test source - * ------------------------ - * - unit/memory/hipMemcpy3DAsync_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEST_CASE("Unit_hipMemcpy3DAsync_multiDevice-D2D", "[multigpu]") { - CHECK_IMAGE_SUPPORT - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - SECTION("D2D on different Device") { - Memcpy3DAsync memcpy3d_d2d_obj(width, height, depth, hipChannelFormatKindFloat); - memcpy3d_d2d_obj.D2D_DeviceMem_OnDiffDevice(); - } - - SECTION("D2H and H2D on different device") { - Memcpy3DAsync memcpy3d_d2h_obj(width, height, depth, hipChannelFormatKindFloat); - memcpy3d_d2h_obj.D2H_H2D_DeviceMem_OnDiffDevice(); - } - } else { - SUCCEED("skipping the testcases as numDevices < 2"); - } -} - /** * Test Description * ------------------------ @@ -747,7 +648,7 @@ TEST_CASE("Unit_hipMemcpy3DAsync_multiDevice-D2D", "[multigpu]") { * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemcpy3DAsync_multiDevice-DiffStream", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy3DAsync_multiDevice_DiffStream) { CHECK_IMAGE_SUPPORT int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -759,34 +660,6 @@ TEST_CASE("Unit_hipMemcpy3DAsync_multiDevice-DiffStream", "[multigpu]") { } } -/** - * Test Description - * ------------------------ - * - This testcase performs size check on hipMemcpy3DAsync API - 1. Verify with 128 for all height, width & depth value - * Test source - * ------------------------ - * - unit/memory/hipMemcpy3DAsync_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEST_CASE("Unit_hipMemcpy3DAsync_Basic_Size_Test") { - CHECK_IMAGE_SUPPORT - constexpr int size_128b = 128; - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - - if (numDevices > 1) { - SECTION("Verify with 128 for all height, width & depth value") { - Memcpy3DAsync memcpy3dAsync(size_128b, size_128b, size_128b, - hipChannelFormatKindFloat); - memcpy3dAsync.D2D_SameDeviceMem_StreamDiffDevice(); - } - } -} - /** * End doxygen group MemoryTest. * @} diff --git a/catch/unit/memory/hipMemcpy3DBatchAsync.cc b/catch/unit/memory/hipMemcpy3DBatchAsync.cc index ca5be8157..7d193de1a 100644 --- a/catch/unit/memory/hipMemcpy3DBatchAsync.cc +++ b/catch/unit/memory/hipMemcpy3DBatchAsync.cc @@ -1,21 +1,9 @@ /* - * Copyright (c) 2025 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + #include #include #include @@ -68,7 +56,7 @@ void checkArrayContent(hipArray_t array, size_t width, size_t height, * ------------------------ * - HIP_VERSION >= 7.1 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy3DBatchAsync_Ptr2PtrBatchOps", "", char, int, +TEMPLATE_TEST_CASE(Unit_hipMemcpy3DBatchAsync_Ptr2PtrBatchOps, char, int, float) { constexpr auto kfloatval1 = -1.5f; constexpr auto kfloatval2 = 2.25f; @@ -211,7 +199,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy3DBatchAsync_Ptr2PtrBatchOps", "", char, int, * ------------------------ * - HIP_VERSION >= 7.1 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy3DBatchAsync_ArrayMemCpyBatchOps", "", char, +TEMPLATE_TEST_CASE(Unit_hipMemcpy3DBatchAsync_ArrayMemCpyBatchOps, char, int, float) { CHECK_IMAGE_SUPPORT constexpr auto kfloatval1 = -1.5f; @@ -363,7 +351,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy3DBatchAsync_ArrayMemCpyBatchOps", "", char, * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemcpy3DBatchAsync_NegativeTests") { +TEST_CASE(Unit_hipMemcpy3DBatchAsync_NegativeTests) { CHECK_IMAGE_SUPPORT const int numOps = 2; hipStream_t stream = NULL; diff --git a/catch/unit/memory/hipMemcpy3DPeer.cc b/catch/unit/memory/hipMemcpy3DPeer.cc index 5688e2639..ea9126fb4 100644 --- a/catch/unit/memory/hipMemcpy3DPeer.cc +++ b/catch/unit/memory/hipMemcpy3DPeer.cc @@ -1,21 +1,9 @@ /* - * Copyright (c) 2025 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + #include #include /*@addtogroup hipMemcpy3DPeer hipMemcpy3DPeer* @{ @@ -37,7 +25,7 @@ * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemcpy3DPeer_BasicFunctional") { +TEST_CASE(Unit_hipMemcpy3DPeer_BasicFunctional) { CHECK_IMAGE_SUPPORT constexpr int numW = 16; constexpr int numH = 16; @@ -140,7 +128,7 @@ TEST_CASE("Unit_hipMemcpy3DPeer_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemcpy3DPeer_NegativeTsts") { +TEST_CASE(Unit_hipMemcpy3DPeer_NegativeTsts) { CHECK_IMAGE_SUPPORT constexpr int numW = 16; constexpr int numH = 16; diff --git a/catch/unit/memory/hipMemcpy3DPeerAsync.cc b/catch/unit/memory/hipMemcpy3DPeerAsync.cc index 233b906a5..4fc162433 100644 --- a/catch/unit/memory/hipMemcpy3DPeerAsync.cc +++ b/catch/unit/memory/hipMemcpy3DPeerAsync.cc @@ -1,21 +1,9 @@ /* - * Copyright (c) 2025 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + #include #include /* @addtogroup hipMemcpy3DPeerAsync hipMemcpy3DPeerAsync @@ -40,7 +28,7 @@ * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemcpy3DPeerAsync_BasicFunctional") { +TEST_CASE(Unit_hipMemcpy3DPeerAsync_BasicFunctional) { CHECK_IMAGE_SUPPORT constexpr int numW = 16; constexpr int numH = 16; @@ -147,7 +135,7 @@ TEST_CASE("Unit_hipMemcpy3DPeerAsync_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemcpy3DPeerAsync_NegativeTsts") { +TEST_CASE(Unit_hipMemcpy3DPeerAsync_NegativeTsts) { CHECK_IMAGE_SUPPORT hipStream_t stream = nullptr; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/memory/hipMemcpy3D_old.cc b/catch/unit/memory/hipMemcpy3D_old.cc index 17ce84533..bfa72970a 100644 --- a/catch/unit/memory/hipMemcpy3D_old.cc +++ b/catch/unit/memory/hipMemcpy3D_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemcpy3D hipMemcpy3D @@ -514,62 +501,6 @@ template void Memcpy3D::simple_Memcpy3D() { DeAllocateMemory(); } -/** - * Test Description - * ------------------------ - * - This testcase performs hipMemcpy3D API validation for - different datatypes and different sizes - * Test source - * ------------------------ - * - unit/memory/hipMemcpy3D_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ - -TEMPLATE_TEST_CASE("Unit_hipMemcpy3D_Basic", "[hipMemcpy3D]", int, unsigned int, float) { - CHECK_IMAGE_SUPPORT - int device = -1; - HIP_CHECK(hipGetDevice(&device)); - hipDeviceProp_t prop; - HIP_CHECK(hipGetDeviceProperties(&prop, device)); - auto i = GENERATE_COPY(10, 100, 1024, prop.maxTexture3D[0]); - auto j = GENERATE(10, 100); - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - if (std::is_same::value) { - Memcpy3D memcpy3d_obj(i, j, j, hipChannelFormatKindFloat); - memcpy3d_obj.simple_Memcpy3D(); - } else if (std::is_same::value) { - Memcpy3D memcpy3d_obj(i, j, j, hipChannelFormatKindUnsigned); - memcpy3d_obj.simple_Memcpy3D(); - } else if (std::is_same::value) { - Memcpy3D memcpy3d_obj(i, j, j, hipChannelFormatKindSigned); - memcpy3d_obj.simple_Memcpy3D(); - } - } else { - SUCCEED("skipping the testcases as numDevices < 2"); - } -} - -/** - * Test Description - * ------------------------ - * - This testcase performs the extent validation scenarios of hipMemcpy3D API - * Test source - * ------------------------ - * - unit/memory/hipMemcpy3D_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ - -TEST_CASE("Unit_hipMemcpy3D_ExtentValidation") { - CHECK_IMAGE_SUPPORT - Memcpy3D memcpy3d(width, height, depth, hipChannelFormatKindSigned); - memcpy3d.Extent_Validation(); -} /** * Test Description @@ -583,7 +514,7 @@ TEST_CASE("Unit_hipMemcpy3D_ExtentValidation") { * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemcpy3D_multiDevice-Negative") { +TEST_CASE(Unit_hipMemcpy3D_multiDevice_Negative) { CHECK_IMAGE_SUPPORT int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -595,84 +526,6 @@ TEST_CASE("Unit_hipMemcpy3D_multiDevice-Negative") { } } -/** - * Test Description - * ------------------------ - * - This testcase performs the D2H,H2D and D2D on peer GPU device - 1. Verify with D2H & H2D On DiffDevice - 2. Verify with D2D On DiffDevice - * Test source - * ------------------------ - * - unit/memory/hipMemcpy3D_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 5.2 - */ - -TEST_CASE("Unit_hipMemcpy3D_multiDevice-OnPeerDevice", "[multigpu]") { - CHECK_IMAGE_SUPPORT - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - SECTION("D2H & H2D On DiffDevice") { - Memcpy3D memcpy3d_d2h_obj(width, height, depth, hipChannelFormatKindFloat); - memcpy3d_d2h_obj.D2H_H2D_DeviceMem_OnDiffDevice(); - } - - SECTION("D2D On DiffDevice") { - Memcpy3D memcpy3d_d2d_obj(width, height, depth, hipChannelFormatKindFloat); - memcpy3d_d2d_obj.D2D_DeviceMem_OnDiffDevice(); - } - } else { - SUCCEED("skipping the testcases as numDevices < 2"); - } -} - -/** - * Test Description - * ------------------------ - * - This testcase performs multidevice size check on hipMemcpy3D API - 1. Verify with 128 for all height, width & depth value - 2. Verify with 256 for height and 128 for width & depth value - 3. Verify with 256 for width and 128 for height & depth value - 4. Verify with 256 for depth and 128 for height & width value - * Test source - * ------------------------ - * - unit/memory/hipMemcpy3D_old.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.0 - */ - -TEST_CASE("Unit_hipMemcpy3D_multiDevice_Basic_Size_Test", "[multigpu]") { - CHECK_IMAGE_SUPPORT - constexpr int size_128b = 128, size_256b = 256; - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - - for (int i = 0; i < numDevices; i++) { - HIP_CHECK(hipSetDevice(i)); - - SECTION("Verify with 128 for all height, width & depth value") { - Memcpy3D memcpy3d_obj1(size_128b, size_128b, size_128b, hipChannelFormatKindUnsigned); - memcpy3d_obj1.simple_Memcpy3D(); - } - SECTION("Verify with 256 for height and 128 for width & depth value") { - Memcpy3D memcpy3d_obj2(size_256b, size_128b, size_128b, hipChannelFormatKindUnsigned); - memcpy3d_obj2.simple_Memcpy3D(); - } - SECTION("Verify with 256 for width and 128 for height & depth value") { - Memcpy3D memcpy3d_obj3(size_128b, size_256b, size_128b, hipChannelFormatKindFloat); - memcpy3d_obj3.simple_Memcpy3D(); - } - SECTION("Verify with 256 for depth and 128 for height & width value") { - Memcpy3D memcpy3d_obj4(size_128b, size_128b, size_256b, - hipChannelFormatKindUnsigned); - memcpy3d_obj4.simple_Memcpy3D(); - } - } -} - /** * End doxygen group MemoryTest. * @} diff --git a/catch/unit/memory/hipMemcpyAllApiNegative.cc b/catch/unit/memory/hipMemcpyAllApiNegative.cc index 116b7b0f9..6cd52ae18 100644 --- a/catch/unit/memory/hipMemcpyAllApiNegative.cc +++ b/catch/unit/memory/hipMemcpyAllApiNegative.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 - present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -34,7 +21,7 @@ static constexpr auto NUM_ELM{1024 * 1024}; /*This testcase verifies the negative scenarios of hipMemcpy APIs */ -TEST_CASE("Unit_hipMemcpy_Negative") { +TEST_CASE(Unit_hipMemcpy_Negative) { // Initialization of variables float *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; float *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}; @@ -107,7 +94,7 @@ TEST_CASE("Unit_hipMemcpy_Negative") { /* This testcase verifies the Nullcheck for all the 8 Memcpy APIs */ -TEST_CASE("Unit_hipMemcpy_NullCheck") { +TEST_CASE(Unit_hipMemcpy_NullCheck) { // Initialization of variables float *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; float *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}; @@ -170,7 +157,7 @@ TEST_CASE("Unit_hipMemcpy_NullCheck") { This testcase verifies all the hipMemcpy APIs by copying half the memory. */ -TEST_CASE("Unit_hipMemcpy_HalfMemCopy") { +TEST_CASE(Unit_hipMemcpy_HalfMemCopy) { // Initialization of variables float *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; float *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}; diff --git a/catch/unit/memory/hipMemcpyAsync.cc b/catch/unit/memory/hipMemcpyAsync.cc index d72e5fe26..7409e50b6 100644 --- a/catch/unit/memory/hipMemcpyAsync.cc +++ b/catch/unit/memory/hipMemcpyAsync.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -25,7 +10,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipMemcpyAsync_Positive_Basic") { +TEST_CASE(Unit_hipMemcpyAsync_Positive_Basic) { using namespace std::placeholders; const auto stream_type = GENERATE(Streams::nullstream, Streams::perThread, Streams::created); const StreamGuard stream_guard(stream_type); @@ -34,7 +19,7 @@ TEST_CASE("Unit_hipMemcpyAsync_Positive_Basic") { MemcpyWithDirectionCommonTests(std::bind(hipMemcpyAsync, _1, _2, _3, _4, stream), stream); } -TEST_CASE("Unit_hipMemcpyAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyAsync_Positive_Synchronization_Behavior) { using namespace std::placeholders; HIP_CHECK(hipDeviceSynchronize()); @@ -78,7 +63,7 @@ TEST_CASE("Unit_hipMemcpyAsync_Positive_Synchronization_Behavior") { } } -TEST_CASE("Unit_hipMemcpyAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyAsync_Negative_Parameters) { using namespace std::placeholders; SECTION("Host to device") { @@ -139,7 +124,7 @@ TEST_CASE("Unit_hipMemcpyAsync_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpyAsync_Capture") { +TEST_CASE(Unit_hipMemcpyAsync_Capture) { hipStream_t stream = nullptr; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/memory/hipMemcpyAsync_derivatives.cc b/catch/unit/memory/hipMemcpyAsync_derivatives.cc index bd4684ff5..ce72b2224 100644 --- a/catch/unit/memory/hipMemcpyAsync_derivatives.cc +++ b/catch/unit/memory/hipMemcpyAsync_derivatives.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,7 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipMemcpyDtoHAsync_Positive_Basic") { +TEST_CASE(Unit_hipMemcpyDtoHAsync_Positive_Basic) { const auto stream_type = GENERATE(Streams::nullstream, Streams::perThread, Streams::created); const StreamGuard stream_guard(stream_type); @@ -36,7 +21,7 @@ TEST_CASE("Unit_hipMemcpyDtoHAsync_Positive_Basic") { MemcpyDeviceToHostShell(f, stream_guard.stream()); } -TEST_CASE("Unit_hipMemcpyDtoHAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyDtoHAsync_Positive_Synchronization_Behavior) { HIP_CHECK(hipDeviceSynchronize()); SECTION("Device memory to pageable host memory") { @@ -56,7 +41,7 @@ TEST_CASE("Unit_hipMemcpyDtoHAsync_Positive_Synchronization_Behavior") { } } -TEST_CASE("Unit_hipMemcpyDtoHAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyDtoHAsync_Negative_Parameters) { using namespace std::placeholders; LinearAllocGuard device_alloc(LinearAllocs::hipMalloc, kPageSize); LinearAllocGuard host_alloc(LinearAllocs::hipHostMalloc, kPageSize); @@ -68,7 +53,7 @@ TEST_CASE("Unit_hipMemcpyDtoHAsync_Negative_Parameters") { host_alloc.ptr(), device_alloc.ptr(), kPageSize); } -TEST_CASE("Unit_hipMemcpyHtoDAsync_Positive_Basic") { +TEST_CASE(Unit_hipMemcpyHtoDAsync_Positive_Basic) { const auto stream_type = GENERATE(Streams::nullstream, Streams::perThread, Streams::created); const StreamGuard stream_guard(stream_type); @@ -78,7 +63,7 @@ TEST_CASE("Unit_hipMemcpyHtoDAsync_Positive_Basic") { MemcpyHostToDeviceShell(f, stream_guard.stream()); } -TEST_CASE("Unit_hipMemcpyHtoDAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyHtoDAsync_Positive_Synchronization_Behavior) { // This behavior differs on NVIDIA and AMD, on AMD the hipMemcpy calls is synchronous with // respect to the host #if HT_AMD @@ -94,7 +79,7 @@ TEST_CASE("Unit_hipMemcpyHtoDAsync_Positive_Synchronization_Behavior") { false); } -TEST_CASE("Unit_hipMemcpyHtoDAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyHtoDAsync_Negative_Parameters) { using namespace std::placeholders; LinearAllocGuard device_alloc(LinearAllocs::hipMalloc, kPageSize); LinearAllocGuard host_alloc(LinearAllocs::hipHostMalloc, kPageSize); @@ -106,7 +91,7 @@ TEST_CASE("Unit_hipMemcpyHtoDAsync_Negative_Parameters") { device_alloc.ptr(), host_alloc.ptr(), kPageSize); } -TEST_CASE("Unit_hipMemcpyDtoDAsync_Positive_Basic") { +TEST_CASE(Unit_hipMemcpyDtoDAsync_Positive_Basic) { const auto stream_type = GENERATE(Streams::nullstream, Streams::perThread, Streams::created); const StreamGuard stream_guard(stream_type); @@ -130,7 +115,7 @@ TEST_CASE("Unit_hipMemcpyDtoDAsync_Positive_Basic") { } } -TEST_CASE("Unit_hipMemcpyDtoDAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyDtoDAsync_Positive_Synchronization_Behavior) { MemcpyDtoDSyncBehavior( [](void* dst, void* src, size_t count) { return hipMemcpyDtoDAsync(reinterpret_cast(dst), @@ -139,7 +124,7 @@ TEST_CASE("Unit_hipMemcpyDtoDAsync_Positive_Synchronization_Behavior") { false); } -TEST_CASE("Unit_hipMemcpyDtoDAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyDtoDAsync_Negative_Parameters) { using namespace std::placeholders; LinearAllocGuard src_alloc(LinearAllocs::hipMalloc, kPageSize); LinearAllocGuard dst_alloc(LinearAllocs::hipMalloc, kPageSize); @@ -164,7 +149,7 @@ TEST_CASE("Unit_hipMemcpyDtoDAsync_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemcpyDtoHAsync_Capture") { +TEST_CASE(Unit_hipMemcpyDtoHAsync_Capture) { hipStream_t stream = nullptr; HIP_CHECK(hipStreamCreate(&stream)); @@ -202,7 +187,7 @@ TEST_CASE("Unit_hipMemcpyDtoHAsync_Capture") { * Test source * ------------------------ */ -TEST_CASE("Unit_hipMemcpyHtoDAsync_Capture") { +TEST_CASE(Unit_hipMemcpyHtoDAsync_Capture) { hipStream_t stream = nullptr; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/memory/hipMemcpyAsync_old.cc b/catch/unit/memory/hipMemcpyAsync_old.cc index 62a98a9cc..3b0dae015 100644 --- a/catch/unit/memory/hipMemcpyAsync_old.cc +++ b/catch/unit/memory/hipMemcpyAsync_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022 - present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This testcase verifies the following scenarios @@ -92,34 +79,6 @@ Initializes device variables Launches kernel and performs the sum of device variables copies the result to host variable and validates the result. */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_KernelLaunch", "", int, float, double) { - size_t Nbytes = NUM_ELM * sizeof(TestType); - int threads = 1024; - int blocks = (NUM_ELM % threads == 0) ? (NUM_ELM / threads) : ((NUM_ELM / threads) + 1); - - TestType *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; - TestType *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}; - HIP_CHECK(hipSetDevice(0)); - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, NUM_ELM, false); - - HIP_CHECK(hipMemcpyAsync(A_d, A_h, Nbytes, hipMemcpyHostToDevice, stream)); - HIP_CHECK(hipMemcpyAsync(B_d, B_h, Nbytes, hipMemcpyHostToDevice, stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - - hipLaunchKernelGGL(HipTest::vectorADD, blocks, threads, 0, 0, static_cast(A_d), - static_cast(B_d), C_d, NUM_ELM); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipMemcpyAsync(C_h, C_d, Nbytes, hipMemcpyDeviceToHost, stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - HIP_CHECK(hipStreamDestroy(stream)); - - HipTest::checkVectorADD(A_h, B_h, C_h, NUM_ELM); - - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); -} /* This testcase verifies the following scenarios 1. H2H,H2PinMem and PinnedMem2Host @@ -128,8 +87,7 @@ This testcase verifies the following scenarios 4. Device context change 5. H2D-D2D-D2H peer GPU */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_H2H-H2D-D2H-H2PinMem", "[multigpu]", - char, int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpyAsync_H2H_H2D_D2H_H2PinMem, char, int, float, double) { TestType *A_d{nullptr}, *B_d{nullptr}; TestType *A_h{nullptr}, *B_h{nullptr}; TestType *A_Ph{nullptr}, *B_Ph{nullptr}; @@ -230,7 +188,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_H2H-H2D-D2H-H2PinMem", "[multigpu]", // and also launch hipMemcpyAsync() api. This test case is simulate the scenario // reported in SWDEV-181598 -TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_hipMultiMemcpyMultiThread", "", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpyAsync_hipMultiMemcpyMultiThread, int, float, double) { size_t Nbytes = N_ELMTS * sizeof(TestType); int Data_mismatch = 0; @@ -270,7 +228,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_hipMultiMemcpyMultiThread", "", int, flo Thread_count.exchange(0); } -TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_hipMultiMemcpyMultiThreadMultiStream", "", int, float, +TEMPLATE_TEST_CASE(Unit_hipMemcpyAsync_hipMultiMemcpyMultiThreadMultiStream, int, float, double) { std::thread T[NUM_THREADS]; for (int i = 0; i < NUM_THREADS; i++) { @@ -293,8 +251,7 @@ This testcase verifies hipMemcpy API with pinnedMemory and hostRegister along with kernel launches */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyAsync_PinnedRegMemWithKernelLaunch", - "[multigpu]", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpyAsync_PinnedRegMemWithKernelLaunch, int, float, double) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); if (numDevices < 2) { diff --git a/catch/unit/memory/hipMemcpyAtoA.cc b/catch/unit/memory/hipMemcpyAtoA.cc index da161472f..27282049a 100644 --- a/catch/unit/memory/hipMemcpyAtoA.cc +++ b/catch/unit/memory/hipMemcpyAtoA.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +31,7 @@ THE SOFTWARE. * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemcpyAtoA_Basic") { +TEST_CASE(Unit_hipMemcpyAtoA_Basic) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("API currently unsupported on nvidia, skipping..."); return; diff --git a/catch/unit/memory/hipMemcpyAtoD.cc b/catch/unit/memory/hipMemcpyAtoD.cc index 139a0e9df..dac2ad69c 100644 --- a/catch/unit/memory/hipMemcpyAtoD.cc +++ b/catch/unit/memory/hipMemcpyAtoD.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -42,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemcpyAtoD_Basic") { +TEST_CASE(Unit_hipMemcpyAtoD_Basic) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("API currently unsupported on nvidia, skipping..."); return; diff --git a/catch/unit/memory/hipMemcpyAtoH.cc b/catch/unit/memory/hipMemcpyAtoH.cc index 0df76407c..5bdeb9449 100644 --- a/catch/unit/memory/hipMemcpyAtoH.cc +++ b/catch/unit/memory/hipMemcpyAtoH.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "array_memcpy_tests_common.hh" @@ -24,7 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipMemcpyAtoH_Positive_Default") { +TEST_CASE(Unit_hipMemcpyAtoH_Positive_Default) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -35,7 +22,7 @@ TEST_CASE("Unit_hipMemcpyAtoH_Positive_Default") { MemcpyAtoHShell(std::bind(hipMemcpyAtoH, _1, _2, 0, allocation_size), width); } -TEST_CASE("Unit_hipMemcpyAtoH_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyAtoH_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -56,7 +43,7 @@ Excluded the testcase for amd,as there is already a bug raised SWDEV-274683 */ #if HT_NVIDIA -TEST_CASE("Unit_hipMemcpyAtoH_Positive_ZeroCount") { +TEST_CASE(Unit_hipMemcpyAtoH_Positive_ZeroCount) { CHECK_IMAGE_SUPPORT const auto width = 1024; @@ -87,7 +74,7 @@ TEST_CASE("Unit_hipMemcpyAtoH_Positive_ZeroCount") { } #endif -TEST_CASE("Unit_hipMemcpyAtoH_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyAtoH_Negative_Parameters) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -130,7 +117,7 @@ TEST_CASE("Unit_hipMemcpyAtoH_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpyAtoH_Capture") { +TEST_CASE(Unit_hipMemcpyAtoH_Capture) { CHECK_IMAGE_SUPPORT const auto width = 1024; diff --git a/catch/unit/memory/hipMemcpyAtoHAsync.cc b/catch/unit/memory/hipMemcpyAtoHAsync.cc index 595a451f9..0848e9653 100644 --- a/catch/unit/memory/hipMemcpyAtoHAsync.cc +++ b/catch/unit/memory/hipMemcpyAtoHAsync.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -42,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemcpyAtoHAsync_Basic") { +TEST_CASE(Unit_hipMemcpyAtoHAsync_Basic) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("API currently unsupported on nvidia, skipping..."); return; @@ -73,7 +60,7 @@ TEST_CASE("Unit_hipMemcpyAtoHAsync_Basic") { #endif } -TEST_CASE("Unit_hipMemcpyAtoHAsync_Capture") { +TEST_CASE(Unit_hipMemcpyAtoHAsync_Capture) { CHECK_IMAGE_SUPPORT constexpr int kRows = 1; diff --git a/catch/unit/memory/hipMemcpyAtoH_old.cc b/catch/unit/memory/hipMemcpyAtoH_old.cc index c76ec5e77..cc1ad8fe3 100644 --- a/catch/unit/memory/hipMemcpyAtoH_old.cc +++ b/catch/unit/memory/hipMemcpyAtoH_old.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* * Test Scenarios: * 1. Perform host and Pinned host Memory @@ -33,54 +21,6 @@ static constexpr auto NUM_W{10}; static constexpr auto NUM_H{1}; static constexpr auto copy_bytes{2}; -/* -This testcase performs the basic and pinned host memory scenarios -of hipMemcpyAtoH API -Input: "A_d" initialized with "hData" Pi value -Output:"B_h" host variable output of hipMemcpyAtoH API - is then validated with "hData" - -The same scenario is then verified with pinned host memory -*/ - -TEMPLATE_TEST_CASE("Unit_hipMemcpyAtoH_Basic", "[hipMemcpyAtoH]", char, int, float) { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - // 1 refers to pinned host memory scenario - auto memtype_check = GENERATE(0, 1); - hipArray_t A_d; - TestType *hData{nullptr}, *B_h{nullptr}; - size_t width{NUM_W * sizeof(TestType)}; - - // Initialization of data - if (memtype_check) { - HipTest::initArrays(nullptr, nullptr, nullptr, &hData, &B_h, nullptr, NUM_W, true); - } else { - HipTest::initArrays(nullptr, nullptr, nullptr, &hData, &B_h, nullptr, NUM_W); - } - HipTest::setDefaultData(NUM_W, hData, B_h, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice)); - - // Performing API call - REQUIRE(hipMemcpyAtoH(B_h, A_d, 0, copy_bytes * sizeof(TestType)) == hipSuccess); - - // Validating the result - REQUIRE(HipTest::checkArray(B_h, hData, copy_bytes, NUM_H) == true); - - // DeAllocating the memory - HIP_CHECK(hipFreeArray(A_d)); - if (memtype_check) { - REQUIRE(HipTest::freeArrays(nullptr, nullptr, nullptr, hData, B_h, nullptr, true) == - true); - } else { - REQUIRE(HipTest::freeArrays(nullptr, nullptr, nullptr, hData, B_h, nullptr, false) == - true); - } -} - /* This testcase performs the basic and pinned host memory scenarios of hipMemcpyAtoH API @@ -90,8 +30,7 @@ Output:"B_h" host variable output of hipMemcpyAtoH API is then validated with "hData" */ #if HT_AMD -TEMPLATE_TEST_CASE("Unit_hipMemcpyAtoH_multiDevice-PeerDeviceContext", - "[hipMemcpyAtoH][multigpu]", char, int, float) { +TEMPLATE_TEST_CASE(Unit_hipMemcpyAtoH_multiDevice_PeerDeviceContext, char, int, float) { CHECK_IMAGE_SUPPORT int numDevices = 0; @@ -133,77 +72,3 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyAtoH_multiDevice-PeerDeviceContext", } } #endif -/* -This testcase verifies the negative scenarios of hipMemcpyAtoH API -*/ -TEST_CASE("Unit_hipMemcpyAtoH_Negative") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d; - float *hData{nullptr}, *B_h{nullptr}; - size_t width{NUM_W * sizeof(float)}; - - // Initialization of data - HipTest::initArrays(nullptr, nullptr, nullptr, &hData, &B_h, nullptr, NUM_W); - HipTest::setDefaultData(NUM_W, hData, B_h, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice)); - - SECTION("Destination pointer is nullptr") { - REQUIRE(hipMemcpyAtoH(nullptr, A_d, 0, copy_bytes * sizeof(float)) != hipSuccess); - } - - SECTION("Source offset is more than allocated size") { - REQUIRE(hipMemcpyAtoH(B_h, A_d, 100, copy_bytes * sizeof(float)) != hipSuccess); - } - - SECTION("ByteCount is greater than allocated size") { - REQUIRE(hipMemcpyAtoH(B_h, A_d, 0, 12 * sizeof(float)) != hipSuccess); - } - - // DeAllocating the memory - HIP_CHECK(hipFreeArray(A_d)); - REQUIRE(HipTest::freeArrays(nullptr, nullptr, nullptr, hData, B_h, nullptr, false) == - true); -} - -/* -This testcase verifies size 0 check of hipMemcpyAtoH API -Excluded the testcase for amd,as there is already a bug raised -SWDEV-274683 -*/ -#if HT_NVIDIA -TEST_CASE("Unit_hipMemcpyAtoH_SizeCheck") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d; - float *hData{nullptr}, *B_h{nullptr}, *def_data{nullptr}; - size_t width{NUM_W * sizeof(float)}; - - // Initialization of data - HipTest::initArrays(nullptr, nullptr, nullptr, nullptr, &def_data, nullptr, NUM_W); - HipTest::initArrays(nullptr, nullptr, nullptr, &hData, &B_h, nullptr, NUM_W); - HipTest::setDefaultData(NUM_W, hData, B_h, nullptr); - HipTest::setDefaultData(NUM_W, nullptr, def_data, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice)); - - SECTION("Passing 0 to copy bytes") { - REQUIRE(hipMemcpyAtoH(B_h, A_d, 0, 0) == hipSuccess); - REQUIRE(HipTest::checkArray(B_h, def_data, NUM_W, NUM_H) == true); - } - - SECTION(" Source Array is nullptr") { - REQUIRE(hipMemcpyAtoH(B_h, nullptr, 0, copy_bytes * sizeof(float)) != hipSuccess); - } - - // DeAllocating the memory - HIP_CHECK(hipFreeArray(A_d)); - REQUIRE(HipTest::freeArrays(nullptr, nullptr, nullptr, hData, B_h, def_data, false) == - true); -} -#endif diff --git a/catch/unit/memory/hipMemcpyBatchAsync.cc b/catch/unit/memory/hipMemcpyBatchAsync.cc index d9ba495c1..46da7de63 100644 --- a/catch/unit/memory/hipMemcpyBatchAsync.cc +++ b/catch/unit/memory/hipMemcpyBatchAsync.cc @@ -1,21 +1,9 @@ /* - * Copyright (c) 2025 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + #include #include /** @@ -44,7 +32,7 @@ * - HIP_VERSION >= 7.1 */ #if HT_AMD -TEMPLATE_TEST_CASE("Unit_hipMemcpyBatchAsync_D2D_Functional", "", char, int, +TEMPLATE_TEST_CASE(Unit_hipMemcpyBatchAsync_D2D_Functional, char, int, float) { const size_t count = 2; size_t numAttrs = 0; @@ -115,7 +103,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyBatchAsync_D2D_Functional", "", char, int, * ------------------------ * - HIP_VERSION >= 7.1 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyBatchAsync_H2D_Functional", "", char, int, +TEMPLATE_TEST_CASE(Unit_hipMemcpyBatchAsync_H2D_Functional, char, int, float) { const size_t count = 2; size_t numAttrs = 0; @@ -183,7 +171,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyBatchAsync_H2D_Functional", "", char, int, * ------------------------ * - HIP_VERSION >= 7.1 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyBatchAsync_D2H_Functional", "", char, int, +TEMPLATE_TEST_CASE(Unit_hipMemcpyBatchAsync_D2H_Functional, char, int, float) { const size_t count = 2; size_t numAttrs = 0; @@ -253,7 +241,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyBatchAsync_D2H_Functional", "", char, int, * ------------------------ * - HIP_VERSION >= 7.1 */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyBatchAsync_H2H_Functional", "", char, int, +TEMPLATE_TEST_CASE(Unit_hipMemcpyBatchAsync_H2H_Functional, char, int, float) { const size_t count = 2; size_t numAttrs = 0; @@ -320,7 +308,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyBatchAsync_H2H_Functional", "", char, int, * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemcpyBatchAsync_NegativeTsts") { +TEST_CASE(Unit_hipMemcpyBatchAsync_NegativeTsts) { const size_t count = 2; size_t numAttrs = 0; size_t sizes[2]; diff --git a/catch/unit/memory/hipMemcpyDeviceToDeviceNoCU.cc b/catch/unit/memory/hipMemcpyDeviceToDeviceNoCU.cc index 9635fc20f..f61f2d9bb 100644 --- a/catch/unit/memory/hipMemcpyDeviceToDeviceNoCU.cc +++ b/catch/unit/memory/hipMemcpyDeviceToDeviceNoCU.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -45,7 +32,7 @@ static void fillDataTransfer2Dev(int* hostBuf, size_t len) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemcpyDeviceToDeviceNoCU_SingleStream") { +TEST_CASE(Unit_hipMemcpyDeviceToDeviceNoCU_SingleStream) { auto testAsync = GENERATE(0, 1); auto isDefaultStrm = GENERATE(0, 1); constexpr int N = 1 << 18; @@ -109,7 +96,7 @@ TEST_CASE("Unit_hipMemcpyDeviceToDeviceNoCU_SingleStream") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemcpyDeviceToDeviceNoCU_WithCU_NoCU_Comb_SingleStrm") { +TEST_CASE(Unit_hipMemcpyDeviceToDeviceNoCU_WithCU_NoCU_Comb_SingleStrm) { constexpr int N = 1 << 18; size_t buffer_size = N * sizeof(int); // Allocate device resources @@ -170,7 +157,7 @@ TEST_CASE("Unit_hipMemcpyDeviceToDeviceNoCU_WithCU_NoCU_Comb_SingleStrm") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemcpyDeviceToDeviceNoCU_NoCU_MulStrm") { +TEST_CASE(Unit_hipMemcpyDeviceToDeviceNoCU_NoCU_MulStrm) { constexpr int N = 1 << 18; size_t buffer_size = N * sizeof(int); // Allocate device resources @@ -229,7 +216,7 @@ TEST_CASE("Unit_hipMemcpyDeviceToDeviceNoCU_NoCU_MulStrm") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemcpyDeviceToDeviceNoCU_Memcpy_Kernel_InParallel") { +TEST_CASE(Unit_hipMemcpyDeviceToDeviceNoCU_Memcpy_Kernel_InParallel) { constexpr int N = 1 << 24; size_t buffer_size = N * sizeof(int); constexpr unsigned threadsPerBlock = 1024; diff --git a/catch/unit/memory/hipMemcpyDtoA.cc b/catch/unit/memory/hipMemcpyDtoA.cc index 2db5d1a9a..520985f47 100644 --- a/catch/unit/memory/hipMemcpyDtoA.cc +++ b/catch/unit/memory/hipMemcpyDtoA.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -23,7 +10,7 @@ THE SOFTWARE. #define N 32 -TEMPLATE_TEST_CASE("Unit_hipMemcpyDtoA_Basic", "", char, int, float) { +TEMPLATE_TEST_CASE(Unit_hipMemcpyDtoA_Basic, char, int, float) { CHECK_IMAGE_SUPPORT hipArray_t dst_array = nullptr; @@ -53,7 +40,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyDtoA_Basic", "", char, int, float) { HIP_CHECK(hipFree(reinterpret_cast(src_device))); } -TEST_CASE("Unit_hipMemcpyDtoA_Negative") { +TEST_CASE(Unit_hipMemcpyDtoA_Negative) { CHECK_IMAGE_SUPPORT hipArray_t dst_array = nullptr; @@ -94,7 +81,7 @@ TEST_CASE("Unit_hipMemcpyDtoA_Negative") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemcpyDtoA_BasicPositive") { +TEST_CASE(Unit_hipMemcpyDtoA_BasicPositive) { CHECK_IMAGE_SUPPORT const size_t width = 1024; diff --git a/catch/unit/memory/hipMemcpyDtoD.cc b/catch/unit/memory/hipMemcpyDtoD.cc index 9a90dfdb3..dca6ae55e 100644 --- a/catch/unit/memory/hipMemcpyDtoD.cc +++ b/catch/unit/memory/hipMemcpyDtoD.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This testcase verifies the hipMemcpyDtoD basic scenario @@ -38,7 +25,7 @@ This testcase verifies hipMemcpyDtoD API 6.Kernel Launch 7.DtoH copy and validating the result */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyDtoD_Basic", "[multigpu]", int, float, +TEMPLATE_TEST_CASE(Unit_hipMemcpyDtoD_Basic, int, float, double) { size_t Nbytes = NUM_ELM * sizeof(TestType); int numDevices = 0; diff --git a/catch/unit/memory/hipMemcpyDtoDAsync.cc b/catch/unit/memory/hipMemcpyDtoDAsync.cc index d96fa2b5e..807613b91 100644 --- a/catch/unit/memory/hipMemcpyDtoDAsync.cc +++ b/catch/unit/memory/hipMemcpyDtoDAsync.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This testcase verifies the Basic scenario @@ -40,7 +27,7 @@ This testcase verifies hipMemcpyDtoDAsync API 7.DtoH copy and validating the result */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyDtoDAsync_Basic", "[multigpu]", int, float, +TEMPLATE_TEST_CASE(Unit_hipMemcpyDtoDAsync_Basic, int, float, double) { size_t Nbytes = NUM_ELM * sizeof(TestType); int numDevices = 0; @@ -110,7 +97,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyDtoDAsync_Basic", "[multigpu]", int, float, * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemcpyDtoDAsync_Capture") { +TEST_CASE(Unit_hipMemcpyDtoDAsync_Capture) { int device_count = 0; HIP_CHECK(hipGetDeviceCount(&device_count)); if (device_count <= 1) { diff --git a/catch/unit/memory/hipMemcpyFromSymbol.cc b/catch/unit/memory/hipMemcpyFromSymbol.cc index 88a30bbfe..81c6fbf01 100644 --- a/catch/unit/memory/hipMemcpyFromSymbol.cc +++ b/catch/unit/memory/hipMemcpyFromSymbol.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -25,7 +12,7 @@ __constant__ int constSymbol[10]; /* Test verifies hipMemcpy[From/To]Symbol[Async] API Negative scenarios. */ -TEST_CASE("Unit_hipMemcpyFromToSymbol_Negative") { +TEST_CASE(Unit_hipMemcpyFromToSymbol_Negative) { SECTION("Invalid Src Ptr") { int result{0}; HIP_CHECK_ERROR( @@ -111,7 +98,7 @@ TEST_CASE("Unit_hipMemcpyFromToSymbol_Negative") { * For Array Values To and From Symbol * For Array Values with offset To and From Symbol * For Sync and Async Variants*/ -TEST_CASE("Unit_hipMemcpyToFromSymbol_SyncAndAsync") { +TEST_CASE(Unit_hipMemcpyToFromSymbol_SyncAndAsync) { enum StreamTestType { NullStream = 0, StreamPerThread, CreatedStream, NoStream }; /* Test type NoStream - Use Sync variants, else use async variants */ @@ -228,7 +215,7 @@ TEST_CASE("Unit_hipMemcpyToFromSymbol_SyncAndAsync") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemcpyToFromSymbol_Capture") { +TEST_CASE(Unit_hipMemcpyToFromSymbol_Capture) { hipStream_t stream = nullptr; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/memory/hipMemcpyHtoA.cc b/catch/unit/memory/hipMemcpyHtoA.cc index c01769f95..7eefa406a 100644 --- a/catch/unit/memory/hipMemcpyHtoA.cc +++ b/catch/unit/memory/hipMemcpyHtoA.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipMemcpyHtoA_Positive_Default - Test basic memcpy between host and 1D @@ -34,7 +22,7 @@ hipMemcpyHtoA api when parameters are invalid #include -TEST_CASE("Unit_hipMemcpyHtoA_Positive_Default") { +TEST_CASE(Unit_hipMemcpyHtoA_Positive_Default) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -45,7 +33,7 @@ TEST_CASE("Unit_hipMemcpyHtoA_Positive_Default") { MemcpyHtoAShell(std::bind(hipMemcpyHtoA, _1, 0, _2, allocation_size), width); } -TEST_CASE("Unit_hipMemcpyHtoA_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyHtoA_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -63,7 +51,7 @@ This is excluded for AMD as we have a bug already raised SWDEV-274683 */ #if HT_NVIDIA -TEST_CASE("Unit_hipMemcpyHtoA_Positive_ZeroCount") { +TEST_CASE(Unit_hipMemcpyHtoA_Positive_ZeroCount) { CHECK_IMAGE_SUPPORT const auto width = 1024; @@ -97,7 +85,7 @@ TEST_CASE("Unit_hipMemcpyHtoA_Positive_ZeroCount") { } #endif -TEST_CASE("Unit_hipMemcpyHtoA_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyHtoA_Negative_Parameters) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -141,7 +129,7 @@ TEST_CASE("Unit_hipMemcpyHtoA_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpyHtoA_Capture") { +TEST_CASE(Unit_hipMemcpyHtoA_Capture) { CHECK_IMAGE_SUPPORT const auto width = 512; diff --git a/catch/unit/memory/hipMemcpyHtoAAsync.cc b/catch/unit/memory/hipMemcpyHtoAAsync.cc index 170286267..b20689c6e 100644 --- a/catch/unit/memory/hipMemcpyHtoAAsync.cc +++ b/catch/unit/memory/hipMemcpyHtoAAsync.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -24,7 +11,7 @@ THE SOFTWARE. #define N 32 -TEMPLATE_TEST_CASE("Unit_hipMemcpyHtoAAsync_Basic", "", char, int, float) { +TEMPLATE_TEST_CASE(Unit_hipMemcpyHtoAAsync_Basic, char, int, float) { CHECK_IMAGE_SUPPORT hipArray_t dst_array = nullptr; @@ -53,7 +40,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyHtoAAsync_Basic", "", char, int, float) { HIP_CHECK(hipFreeArray(dst_array)); } -TEST_CASE("Unit_hipMemcpyHtoAAsync_Negative") { +TEST_CASE(Unit_hipMemcpyHtoAAsync_Negative) { CHECK_IMAGE_SUPPORT hipArray_t dst_array = nullptr; @@ -104,7 +91,7 @@ TEST_CASE("Unit_hipMemcpyHtoAAsync_Negative") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemcpyHtoAAsync_BasicTstsWithDiffStreams") { +TEST_CASE(Unit_hipMemcpyHtoAAsync_BasicTstsWithDiffStreams) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("API currently unsupported on nvidia, skipping..."); return; @@ -166,7 +153,7 @@ TEST_CASE("Unit_hipMemcpyHtoAAsync_BasicTstsWithDiffStreams") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemcpyHtoAAsync_MultiDevice", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyHtoAAsync_MultiDevice) { #if HT_NVIDIA HipTest::HIP_SKIP_TEST("API currently unsupported on nvidia, skipping..."); return; @@ -204,7 +191,7 @@ TEST_CASE("Unit_hipMemcpyHtoAAsync_MultiDevice", "[multigpu]") { #endif } -TEST_CASE("UnitHipMemcpyHtoAAsync_Capture") { +TEST_CASE(UnitHipMemcpyHtoAAsync_Capture) { CHECK_IMAGE_SUPPORT auto host_src = std::make_unique>(N); diff --git a/catch/unit/memory/hipMemcpyHtoA_old.cc b/catch/unit/memory/hipMemcpyHtoA_old.cc index e02c405e4..782e866f1 100644 --- a/catch/unit/memory/hipMemcpyHtoA_old.cc +++ b/catch/unit/memory/hipMemcpyHtoA_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* * Test Scenarios: @@ -34,56 +21,6 @@ static constexpr auto NUM_W{10}; static constexpr auto NUM_H{1}; static constexpr auto copy_bytes{2}; -/* -This testcase performs the basic and pinned host memory scenarios -of hipMemcpyHtoA API -Input: "B_h" which is initialized with 1.6 -Output: "A_d" output of hipMemcpyHtoA is copied to "hData" host variable - validated the result with "B_h" - -The same scenario is then verified with pinned host memory -*/ -TEMPLATE_TEST_CASE("Unit_hipMemcpyHtoA_Basic", "[hipMemcpyHtoA]", char, int, float) { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - auto memtype_check = GENERATE(0, 1); - hipArray_t A_d; - TestType *hData{nullptr}, *B_h{nullptr}; - size_t width{NUM_W * sizeof(TestType)}; - - // Initialization of data - if (memtype_check) { - HipTest::initArrays(nullptr, nullptr, nullptr, &hData, &B_h, nullptr, NUM_W, true); - } else { - HipTest::initArrays(nullptr, nullptr, nullptr, &hData, &B_h, nullptr, NUM_W); - } - HipTest::setDefaultData(NUM_W, hData, B_h, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice)); - - // Performing API call - HIP_CHECK(hipMemcpyHtoA(A_d, 0, B_h, copy_bytes * sizeof(TestType))); - HIP_CHECK(hipMemcpy2DFromArray(hData, sizeof(TestType) * NUM_W, A_d, 0, 0, - sizeof(TestType) * NUM_W, 1, hipMemcpyDeviceToHost)); - - - // Validating the result - REQUIRE(HipTest::checkArray(B_h, hData, copy_bytes, NUM_H) == true); - - // DeAllocating the memory - HIP_CHECK(hipFreeArray(A_d)); - if (memtype_check) { - REQUIRE(HipTest::freeArrays(nullptr, nullptr, nullptr, hData, B_h, nullptr, true) == - true); - } else { - REQUIRE(HipTest::freeArrays(nullptr, nullptr, nullptr, hData, B_h, nullptr, false) == - true); - } -} - - /* This testcase performs the peer device context scenario of hipMemcpyHtoA API @@ -93,8 +30,7 @@ Output: "A_d" output of hipMemcpyHtoA is copied to "hData" host variable validated the result with "B_h" */ #if HT_AMD -TEMPLATE_TEST_CASE("Unit_hipMemcpyHtoA_multiDevice-PeerDeviceContext", - "[hipMemcpyHtoA][multigpu]", char, int, float) { +TEMPLATE_TEST_CASE(Unit_hipMemcpyHtoA_multiDevice_PeerDeviceContext, char, int, float) { CHECK_IMAGE_SUPPORT int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -139,80 +75,3 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyHtoA_multiDevice-PeerDeviceContext", #endif -/* -This testcase verifies the negative scenarios of hipMemcpyHtoA API -*/ -TEST_CASE("Unit_hipMemcpyHtoA_Negative") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d; - float *hData{nullptr}, *B_h{nullptr}; - size_t width{NUM_W * sizeof(float)}; - - // Initialization of data - HipTest::initArrays(nullptr, nullptr, nullptr, &hData, &B_h, nullptr, NUM_W); - HipTest::setDefaultData(NUM_W, hData, B_h, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice)); - - SECTION("Source pointer is nullptr") { - REQUIRE(hipMemcpyHtoA(A_d, 0, nullptr, copy_bytes * sizeof(float)) != hipSuccess); - } - - SECTION("Source offset is more than allocated size") { - REQUIRE(hipMemcpyHtoA(A_d, 100, B_h, copy_bytes * sizeof(float)) != hipSuccess); - } - - SECTION("ByteCount is greater than allocated size") { - REQUIRE(hipMemcpyHtoA(A_d, 0, B_h, 12 * sizeof(float)) != hipSuccess); - } - - // DeAllocating the memory - HIP_CHECK(hipFreeArray(A_d)); - REQUIRE(HipTest::freeArrays(nullptr, nullptr, nullptr, hData, B_h, nullptr, false) == - true); -} - -/* -This testcase verifies the size 0 check of hipMemcpyHtoA API -This is excluded for AMD as we have a bug already raised -SWDEV-274683 -*/ -#if HT_NVIDIA -TEST_CASE("Unit_hipMemcpyHtoA_SizeCheck") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - hipArray_t A_d; - float *hData{nullptr}, *B_h{nullptr}, *def_data{nullptr}; - size_t width{NUM_W * sizeof(float)}; - - // Initialization of data - HipTest::initArrays(nullptr, nullptr, nullptr, nullptr, &def_data, nullptr, NUM_W); - HipTest::initArrays(nullptr, nullptr, nullptr, &hData, &B_h, nullptr, NUM_W); - HipTest::setDefaultData(NUM_W, hData, B_h, nullptr); - HipTest::setDefaultData(NUM_W, nullptr, def_data, nullptr); - hipChannelFormatDesc desc = hipCreateChannelDesc(); - HIP_CHECK(hipMallocArray(&A_d, &desc, NUM_W, NUM_H, hipArrayDefault)); - HIP_CHECK(hipMemcpy2DToArray(A_d, 0, 0, hData, width, width, NUM_H, hipMemcpyHostToDevice)); - - SECTION("Passing 0 to copy bytes") { - REQUIRE(hipMemcpyHtoA(A_d, 0, B_h, 0) == hipSuccess); - HIP_CHECK(hipMemcpy2DFromArray(def_data, sizeof(float) * NUM_W, A_d, 0, 0, - sizeof(float) * NUM_W, 1, hipMemcpyDeviceToHost)); - - REQUIRE(HipTest::checkArray(hData, def_data, NUM_W, NUM_H) == true); - } - - SECTION(" Source Array is nullptr") { - REQUIRE(hipMemcpyHtoA(nullptr, 0, B_h, copy_bytes * sizeof(float)) != hipSuccess); - } - - // DeAllocating the memory - HIP_CHECK(hipFreeArray(A_d)); - REQUIRE(HipTest::freeArrays(nullptr, nullptr, nullptr, hData, B_h, def_data, false) == - true); -} -#endif diff --git a/catch/unit/memory/hipMemcpyParam2D.cc b/catch/unit/memory/hipMemcpyParam2D.cc index 060065c74..88d8d7ec9 100644 --- a/catch/unit/memory/hipMemcpyParam2D.cc +++ b/catch/unit/memory/hipMemcpyParam2D.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy2d_tests_common.hh" @@ -27,7 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipMemcpyParam2D_Positive_Basic", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyParam2D_Positive_Basic) { CHECK_IMAGE_SUPPORT constexpr bool async = false; @@ -48,7 +32,7 @@ TEST_CASE("Unit_hipMemcpyParam2D_Positive_Basic", "[multigpu]") { #endif } -TEST_CASE("Unit_hipMemcpyParam2D_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyParam2D_Positive_Synchronization_Behavior) { HIP_CHECK(hipDeviceSynchronize()); SECTION("Host to Device") { Memcpy2DHtoDSyncBehavior(MemcpyParam2DAdapter<>(), true); } @@ -66,13 +50,13 @@ TEST_CASE("Unit_hipMemcpyParam2D_Positive_Synchronization_Behavior") { SECTION("Host to Host") { Memcpy2DHtoHSyncBehavior(MemcpyParam2DAdapter<>(), true); } } -TEST_CASE("Unit_hipMemcpyParam2D_Positive_Parameters") { +TEST_CASE(Unit_hipMemcpyParam2D_Positive_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = false; Memcpy2DZeroWidthHeight(MemcpyParam2DAdapter()); } -TEST_CASE("Unit_hipMemcpyParam2D_Positive_Array") { +TEST_CASE(Unit_hipMemcpyParam2D_Positive_Array) { CHECK_IMAGE_SUPPORT constexpr bool async = false; SECTION("Array from/to Host") { @@ -83,7 +67,7 @@ TEST_CASE("Unit_hipMemcpyParam2D_Positive_Array") { } } -TEST_CASE("Unit_hipMemcpyParam2D_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyParam2D_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr size_t cols = 128; constexpr size_t rows = 128; @@ -185,7 +169,7 @@ TEST_CASE("Unit_hipMemcpyParam2D_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpyParam2D_Capture") { +TEST_CASE(Unit_hipMemcpyParam2D_Capture) { CHECK_IMAGE_SUPPORT constexpr size_t cols = 128; diff --git a/catch/unit/memory/hipMemcpyParam2DAsync.cc b/catch/unit/memory/hipMemcpyParam2DAsync.cc index 585f0b31e..efcc97a31 100644 --- a/catch/unit/memory/hipMemcpyParam2DAsync.cc +++ b/catch/unit/memory/hipMemcpyParam2DAsync.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "memcpy2d_tests_common.hh" @@ -27,7 +11,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipMemcpyParam2DAsync_Positive_Basic", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyParam2DAsync_Positive_Basic) { using namespace std::placeholders; constexpr bool async = true; @@ -60,7 +44,7 @@ TEST_CASE("Unit_hipMemcpyParam2DAsync_Positive_Basic", "[multigpu]") { } } -TEST_CASE("Unit_hipMemcpyParam2DAsync_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyParam2DAsync_Positive_Synchronization_Behavior) { CHECK_IMAGE_SUPPORT using namespace std::placeholders; @@ -96,13 +80,13 @@ TEST_CASE("Unit_hipMemcpyParam2DAsync_Positive_Synchronization_Behavior") { #endif } -TEST_CASE("Unit_hipMemcpyParam2DAsync_Positive_Parameters") { +TEST_CASE(Unit_hipMemcpyParam2DAsync_Positive_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = true; Memcpy2DZeroWidthHeight(MemcpyParam2DAdapter()); } -TEST_CASE("Unit_hipMemcpyParam2DAsync_Positive_Array") { +TEST_CASE(Unit_hipMemcpyParam2DAsync_Positive_Array) { CHECK_IMAGE_SUPPORT constexpr bool async = true; SECTION("Array from/to Host") { @@ -113,7 +97,7 @@ TEST_CASE("Unit_hipMemcpyParam2DAsync_Positive_Array") { } } -TEST_CASE("Unit_hipMemcpyParam2DAsync_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyParam2DAsync_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr bool async = true; @@ -213,7 +197,7 @@ TEST_CASE("Unit_hipMemcpyParam2DAsync_Negative_Parameters") { static constexpr size_t NUM_W{10}; static constexpr size_t NUM_H{10}; -TEST_CASE("Unit_hipMemcpyParam2DAsync_Capture") { +TEST_CASE(Unit_hipMemcpyParam2DAsync_Capture) { void* device_a = nullptr; void* device_b = nullptr; size_t pitch_a = 0; diff --git a/catch/unit/memory/hipMemcpyParam2DAsync_old.cc b/catch/unit/memory/hipMemcpyParam2DAsync_old.cc index c1d1b5063..745c6d307 100644 --- a/catch/unit/memory/hipMemcpyParam2DAsync_old.cc +++ b/catch/unit/memory/hipMemcpyParam2DAsync_old.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This testfile verifies the following scenarios of hipMemcpyParam2DAsync API @@ -43,8 +30,7 @@ static constexpr size_t NUM_H{10}; * it with the initalized data "C_h". * */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2DAsync_multiDevice-StreamOnDiffDevice", - "[hipMemcpyParam2DAsync][multigpu]", char, float, int, +TEMPLATE_TEST_CASE(Unit_hipMemcpyParam2DAsync_multiDevice_StreamOnDiffDevice, char, float, int, double, long double) { CHECK_IMAGE_SUPPORT @@ -109,309 +95,3 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2DAsync_multiDevice-StreamOnDiffDevice", SUCCEED("skipping the testcases as numDevices < 2"); } } - -/* - * This testcase verifies D2D functionality of hipMemcpyParam2DAsync API - * Input: Intializing "A_d" device variable with "C_h" host variable - * Output: "A_d" device variable to "E_d" device variable - * - * Validating the result by copying "E_d" to "A_h" and checking - * it with the initalized data "C_h". - * - */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2DAsync_multiDevice-D2D", - "[hipMemcpyParam2DAsync][multigpu]", char, int, float, - double, long double) { - CHECK_IMAGE_SUPPORT - - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - // Allocating and Initializing the data - HIP_CHECK(hipSetDevice(0)); - TestType *A_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(TestType)}; - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, &C_h, width * NUM_H, - false); - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, C_h); - - int peerAccess = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&peerAccess, 1, 0)); - if (!peerAccess) { - SUCCEED("Skipped the test as there is no peer access"); - } else { - HIP_CHECK(hipSetDevice(1)); - TestType* E_d; - size_t pitch_E; - HIP_CHECK(hipMallocPitch(reinterpret_cast(&E_d), &pitch_E, width, NUM_H)); - - // Initializing A_d with C_h - HIP_CHECK(hipMemcpy2D(A_d, pitch_A, C_h, width, NUM_W * sizeof(TestType), NUM_H, - hipMemcpyHostToDevice)); - - // Device to Device - hip_Memcpy2D desc = {}; - desc.srcMemoryType = hipMemoryTypeDevice; - desc.srcHost = A_d; - desc.srcDevice = hipDeviceptr_t(A_d); - desc.srcPitch = pitch_A; - desc.dstMemoryType = hipMemoryTypeDevice; - desc.dstHost = E_d; - desc.dstDevice = hipDeviceptr_t(E_d); - desc.dstPitch = pitch_E; - desc.WidthInBytes = NUM_W * sizeof(TestType); - desc.Height = NUM_H; - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) == hipSuccess); - HIP_CHECK(hipStreamSynchronize(stream)); - - // Copying the result E_d to A_h host variable - HIP_CHECK(hipMemcpy2D(A_h, width, E_d, pitch_E, NUM_W * sizeof(TestType), NUM_H, - hipMemcpyDeviceToHost)); - - // Validating the result - REQUIRE(HipTest::checkArray(A_h, C_h, NUM_W, NUM_H) == true); - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, C_h, false); - } - } else { - SUCCEED("skipping the testcases as numDevices < 2"); - } -} - -/* - * This testcase verifies H2D & D2H functionality of hipMemcpyParam2DAsync API - * H2D case: - * Input: "C_h" host variable initialized with default data - * Output: "A_d" device variable - * - * D2H case: - * Input: "A_d" device variable from the previous output - * OutPut: "A_h" variable - * - * Validating the result by comparing "A_h" to "C_h" - */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2DAsync_multiDevice-H2D-D2H", - "[hipMemcpyParam2DAsync][multigpu]", char, int, float, - double, long double) { - CHECK_IMAGE_SUPPORT - - // 1 refers to pinned host memory and 0 refers - // to unpinned memory - auto memory_type = GENERATE(0, 1); - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - // Allocating and Initializing the data - HIP_CHECK(hipSetDevice(0)); - TestType *A_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(TestType)}; - hipStream_t stream; - - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - - // Based on memory type (pinned/unpinned) allocating memory - if (memory_type) { - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, &C_h, width * NUM_H, - true); - } else { - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, &C_h, width * NUM_H, - false); - } - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, C_h); - int peerAccess = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&peerAccess, 1, 0)); - if (!peerAccess) { - SUCCEED("Skipped the test as there is no peer access"); - } else { - // Host to Device - hip_Memcpy2D desc = {}; - HIP_CHECK(hipStreamCreate(&stream)); - desc.srcMemoryType = hipMemoryTypeHost; - desc.srcHost = C_h; - desc.srcDevice = hipDeviceptr_t(C_h); - desc.srcPitch = width; - desc.dstMemoryType = hipMemoryTypeDevice; - desc.dstHost = A_d; - desc.dstDevice = hipDeviceptr_t(A_d); - desc.dstPitch = pitch_A; - desc.WidthInBytes = NUM_W * sizeof(TestType); - desc.Height = NUM_H; - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) == hipSuccess); - HIP_CHECK(hipStreamSynchronize(stream)); - - // Device to Host - memset(&desc, 0x0, sizeof(hip_Memcpy2D)); - desc.srcMemoryType = hipMemoryTypeDevice; - desc.srcHost = A_d; - desc.srcDevice = hipDeviceptr_t(A_d); - desc.srcPitch = pitch_A; - desc.dstMemoryType = hipMemoryTypeHost; - desc.dstHost = A_h; - desc.dstDevice = hipDeviceptr_t(A_h); - desc.dstPitch = width; - desc.WidthInBytes = NUM_W * sizeof(TestType); - desc.Height = NUM_H; - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) == hipSuccess); - HIP_CHECK(hipStreamSynchronize(stream)); - - // Validating the result - REQUIRE(HipTest::checkArray(A_h, C_h, NUM_W, NUM_H) == true); - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - if (memory_type) { - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, C_h, true); - } else { - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, C_h, false); - } - } - } else { - SUCCEED("skipping the testcases as numDevices < 2"); - } -} -/* - * This testcase verifies the extent validation scenarios - */ -TEST_CASE("Unit_hipMemcpyParam2DAsync_ExtentValidation") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - char *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(char)}; - constexpr auto memsetval{100}; - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - - // Allocating and Initializing the data - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, &C_h, width * NUM_H, false); - HipTest::initArrays(nullptr, nullptr, nullptr, &B_h, nullptr, nullptr, width * NUM_H, - false); - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, C_h); - HipTest::setDefaultData(NUM_W * NUM_H, B_h, nullptr, nullptr); - HIP_CHECK(hipMemset2D(A_d, pitch_A, memsetval, NUM_W, NUM_H)); - - // Device to Host - hip_Memcpy2D desc = {}; - desc.srcMemoryType = hipMemoryTypeDevice; - desc.srcHost = A_d; - desc.srcDevice = hipDeviceptr_t(A_d); - desc.srcPitch = pitch_A; - desc.dstMemoryType = hipMemoryTypeHost; - desc.dstHost = A_h; - desc.dstDevice = hipDeviceptr_t(A_h); - desc.dstPitch = width; - desc.WidthInBytes = NUM_W; - desc.Height = NUM_H; - - SECTION("Destination Pitch is 0") { - desc.dstPitch = 0; - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) == hipSuccess); - } - - SECTION("Source Pitch is 0") { - desc.srcPitch = 0; - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) == hipSuccess); - } - - SECTION("Height is 0") { - desc.Height = 0; - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) == hipSuccess); - HIP_CHECK(hipStreamSynchronize(stream)); - REQUIRE(HipTest::checkArray(A_h, B_h, NUM_W, NUM_H) == true); - } - - SECTION("Width is 0") { - desc.Height = 0; - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) == hipSuccess); - HIP_CHECK(hipStreamSynchronize(stream)); - REQUIRE(HipTest::checkArray(A_h, B_h, NUM_W, NUM_H) == true); - } - - // DeAllocating the Memory - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, B_h, C_h, false); -} - -/* - * This testcase verifies the negative scenarios - */ -TEST_CASE("Unit_hipMemcpyParam2DAsync_Negative") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - float *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(float)}; - constexpr auto memsetval{100}; - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - - // Allocating and Initializing the data - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &B_h, &C_h, width * NUM_H, false); - HipTest::setDefaultData(NUM_W * NUM_H, A_h, B_h, C_h); - HIP_CHECK(hipMemset2D(A_d, pitch_A, memsetval, NUM_W, NUM_H)); - - // Device to Host - hip_Memcpy2D desc = {}; - desc.srcMemoryType = hipMemoryTypeDevice; - desc.srcHost = A_d; - desc.srcDevice = hipDeviceptr_t(A_d); - desc.srcPitch = pitch_A; - desc.dstMemoryType = hipMemoryTypeHost; - desc.dstHost = A_h; - desc.dstDevice = hipDeviceptr_t(A_h); - desc.dstPitch = width; - desc.WidthInBytes = NUM_W; - desc.Height = NUM_H; - - SECTION("Null Pointer to Source Device Pointer") { - desc.srcDevice = hipDeviceptr_t(nullptr); - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) != hipSuccess); - } - - SECTION("Null Pointer to Destination Device Pointer") { - memset(&desc, 0x0, sizeof(hip_Memcpy2D)); - desc.srcMemoryType = hipMemoryTypeHost; - desc.srcHost = A_h; - desc.srcDevice = hipDeviceptr_t(A_h); - desc.srcPitch = width; - desc.dstMemoryType = hipMemoryTypeDevice; - desc.dstHost = A_d; - desc.dstDevice = hipDeviceptr_t(nullptr); - desc.dstPitch = pitch_A; - desc.WidthInBytes = NUM_W; - desc.Height = NUM_H; - - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) != hipSuccess); - } - - SECTION("Null Pointer to both Src & Dst Device Pointer") { - desc.srcDevice = hipDeviceptr_t(nullptr); - desc.dstDevice = hipDeviceptr_t(nullptr); - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) != hipSuccess); - } - - SECTION("Width > src/dest pitches") { - desc.WidthInBytes = pitch_A + 1; - REQUIRE(hipMemcpyParam2DAsync(&desc, stream) != hipSuccess); - } - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - HIP_CHECK(hipStreamSynchronize(stream)); - HIP_CHECK(hipStreamDestroy(stream)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, B_h, C_h, false); -} diff --git a/catch/unit/memory/hipMemcpyParam2D_old.cc b/catch/unit/memory/hipMemcpyParam2D_old.cc deleted file mode 100644 index 0240b10b9..000000000 --- a/catch/unit/memory/hipMemcpyParam2D_old.cc +++ /dev/null @@ -1,316 +0,0 @@ -/* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/* -This testfile verifies the following scenarios of hipMemcpyParam2D API -1. Negative Scenarios -2. Extent Validation Scenarios -3. D2D copy for different datatypes -4. H2D and D2H copy for different datatypes -*/ - -#include -#include - -static constexpr size_t NUM_W{10}; -static constexpr size_t NUM_H{10}; -/* - * This testcase verifies D2D functionality of hipMemcpyParam2D API - * Input: Intializing "A_d" device variable with "C_h" host variable - * Output: "A_d" device variable to "E_d" device variable - * - * Validating the result by copying "E_d" to "A_h" and checking - * it with the initalized data "C_h". - * - */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2D_multiDevice-D2D", - "[hipMemcpyParam2D][multigpu]", char, float, int, double, - long double) { - CHECK_IMAGE_SUPPORT - - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - // Initialize and Allocating Memory - HIP_CHECK(hipSetDevice(0)); - TestType *A_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(TestType)}; - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, &C_h, width * NUM_H, - false); - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, C_h); - - int peerAccess = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&peerAccess, 1, 0)); - if (!peerAccess) { - SUCCEED("Skipped the test as there is no peer access"); - } else { - HIP_CHECK(hipSetDevice(1)); - char* E_d; - size_t pitch_E; - HIP_CHECK(hipMallocPitch(reinterpret_cast(&E_d), &pitch_E, width, NUM_H)); - - // Initalizing A_d with C_h - HIP_CHECK(hipMemcpy2D(A_d, pitch_A, C_h, width, NUM_W * sizeof(TestType), NUM_H, - hipMemcpyHostToDevice)); - - // Device to Device - hip_Memcpy2D desc = {}; - desc.srcMemoryType = hipMemoryTypeDevice; - desc.srcHost = A_d; - desc.srcDevice = hipDeviceptr_t(A_d); - desc.srcPitch = pitch_A; - desc.dstMemoryType = hipMemoryTypeDevice; - desc.dstHost = E_d; - desc.dstDevice = hipDeviceptr_t(E_d); - desc.dstPitch = pitch_E; - desc.WidthInBytes = NUM_W * sizeof(TestType); - desc.Height = NUM_H; - REQUIRE(hipMemcpyParam2D(&desc) == hipSuccess); - - // Copying E_d to A_h - HIP_CHECK(hipMemcpy2D(A_h, width, E_d, pitch_E, NUM_W * sizeof(TestType), NUM_H, - hipMemcpyDeviceToHost)); - - // Validating the result - REQUIRE(HipTest::checkArray(A_h, C_h, NUM_W, NUM_H) == true); - - // DeAllocating the memory - HIP_CHECK(hipFree(A_d)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, C_h, false); - } - } else { - SUCCEED("skipping the testcases as numDevices < 2"); - } -} - -/* - * This testcase verifies H2D & D2H functionality of hipMemcpyParam2D API - * H2D case: - * Input: "C_h" host variable initialized with default data - * Output: "A_d" device variable - * - * D2H case: - * Input: "A_d" device variable from the previous output - * OutPut: "A_h" variable - * - * Validating the result by comparing "A_h" to "C_h" - */ -TEMPLATE_TEST_CASE("Unit_hipMemcpyParam2D_multiDevice-H2D-D2H", "[hipMemcpyParam2D]", char, float, - int, double, long double) { - CHECK_IMAGE_SUPPORT - - // 1 refers to pinned host memory and 0 refers - // to unpinned memory - auto memory_type = GENERATE(0, 1); - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - HIP_CHECK(hipSetDevice(0)); - - // Initialize and Allocating Memory - TestType *A_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(TestType)}; - - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - - // Based on memory type (pinned/unpinned) allocating memory - if (memory_type) { - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, &C_h, width * NUM_H, - true); - } else { - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, &C_h, width * NUM_H, - false); - } - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, C_h); - int peerAccess = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&peerAccess, 1, 0)); - if (!peerAccess) { - SUCCEED("Skipped the test as there is no peer access"); - } else { - // Host to Device - hip_Memcpy2D desc = {}; - desc.srcMemoryType = hipMemoryTypeHost; - desc.srcHost = C_h; - desc.srcDevice = hipDeviceptr_t(C_h); - desc.srcPitch = width; - desc.dstMemoryType = hipMemoryTypeDevice; - desc.dstHost = A_d; - desc.dstDevice = hipDeviceptr_t(A_d); - desc.dstPitch = pitch_A; - desc.WidthInBytes = NUM_W * sizeof(TestType); - desc.Height = NUM_H; - REQUIRE(hipMemcpyParam2D(&desc) == hipSuccess); - - // Device to Host - memset(&desc, 0x0, sizeof(hip_Memcpy2D)); - desc.srcMemoryType = hipMemoryTypeDevice; - desc.srcHost = A_d; - desc.srcDevice = hipDeviceptr_t(A_d); - desc.srcPitch = pitch_A; - desc.dstMemoryType = hipMemoryTypeHost; - desc.dstHost = A_h; - desc.dstDevice = hipDeviceptr_t(A_h); - desc.dstPitch = width; - desc.WidthInBytes = NUM_W * sizeof(TestType); - desc.Height = NUM_H; - REQUIRE(hipMemcpyParam2D(&desc) == hipSuccess); - - // Validating the result - REQUIRE(HipTest::checkArray(A_h, C_h, NUM_W, NUM_H) == true); - - // DeAllocating the Memory - HIP_CHECK(hipFree(A_d)); - if (memory_type) { - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, C_h, true); - } else { - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, nullptr, C_h, false); - } - } - } else { - SUCCEED("skipping the testcases as numDevices < 2"); - } -} -/* - * This testcase verifies the extent validation scenarios - */ -TEST_CASE("Unit_hipMemcpyParam2D_ExtentValidation") { - CHECK_IMAGE_SUPPORT - - // Allocating memory and Initializing the data - HIP_CHECK(hipSetDevice(0)); - char *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(char)}; - constexpr auto memsetval{100}; - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, nullptr, &C_h, width * NUM_H, false); - HipTest::initArrays(nullptr, nullptr, nullptr, &B_h, nullptr, nullptr, width * NUM_H, - false); - HipTest::setDefaultData(NUM_W * NUM_H, A_h, nullptr, C_h); - HipTest::setDefaultData(NUM_W * NUM_H, B_h, nullptr, nullptr); - HIP_CHECK(hipMemset2D(A_d, pitch_A, memsetval, NUM_W, NUM_H)); - - // Device to Host - hip_Memcpy2D desc = {}; - desc.srcMemoryType = hipMemoryTypeDevice; - desc.srcHost = A_d; - desc.srcDevice = hipDeviceptr_t(A_d); - desc.srcPitch = pitch_A; - desc.dstMemoryType = hipMemoryTypeHost; - desc.dstHost = A_h; - desc.dstDevice = hipDeviceptr_t(A_h); - desc.dstPitch = width; - desc.WidthInBytes = NUM_W; - desc.Height = NUM_H; - - SECTION("Destination Pitch is 0") { - desc.dstPitch = 0; - REQUIRE(hipMemcpyParam2D(&desc) == hipSuccess); - } - - SECTION("Source Pitch is 0") { - desc.srcPitch = 0; - REQUIRE(hipMemcpyParam2D(&desc) == hipSuccess); - } - - SECTION("Height is 0") { - desc.Height = 0; - REQUIRE(hipMemcpyParam2D(&desc) == hipSuccess); - REQUIRE(HipTest::checkArray(A_h, B_h, NUM_W, NUM_H) == true); - } - - SECTION("Width is 0") { - desc.WidthInBytes = 0; - REQUIRE(hipMemcpyParam2D(&desc) == hipSuccess); - REQUIRE(HipTest::checkArray(A_h, B_h, NUM_W, NUM_H) == true); - } - - // DeAllocating the Memory - HIP_CHECK(hipFree(A_d)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, B_h, C_h, false); -} - -/* - * This testcase verifies the negative scenarios - */ -TEST_CASE("Unit_hipMemcpyParam2D_Negative") { - CHECK_IMAGE_SUPPORT - - HIP_CHECK(hipSetDevice(0)); - - // Allocating and Initializing the data - float *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}, *A_d{nullptr}; - size_t pitch_A; - size_t width{NUM_W * sizeof(float)}; - constexpr auto memsetval{100}; - HIP_CHECK(hipMallocPitch(reinterpret_cast(&A_d), &pitch_A, width, NUM_H)); - HipTest::initArrays(nullptr, nullptr, nullptr, &A_h, &B_h, &C_h, width * NUM_H, false); - HipTest::setDefaultData(NUM_W * NUM_H, A_h, B_h, C_h); - HIP_CHECK(hipMemset2D(A_d, pitch_A, memsetval, NUM_W, NUM_H)); - - hip_Memcpy2D desc = {}; - desc.srcMemoryType = hipMemoryTypeDevice; - desc.srcHost = A_d; - desc.srcDevice = hipDeviceptr_t(A_d); - desc.srcPitch = pitch_A; - desc.dstMemoryType = hipMemoryTypeHost; - desc.dstHost = A_h; - desc.dstDevice = hipDeviceptr_t(A_h); - desc.dstPitch = width; - desc.WidthInBytes = NUM_W; - desc.Height = NUM_H; - - SECTION("Null Pointer to Source Device Pointer") { - desc.srcDevice = hipDeviceptr_t(nullptr); - REQUIRE(hipMemcpyParam2D(&desc) != hipSuccess); - } - - SECTION("Null Pointer to Destination Device Pointer") { - memset(&desc, 0x0, sizeof(hip_Memcpy2D)); - desc.srcMemoryType = hipMemoryTypeHost; - desc.srcHost = A_h; - desc.srcDevice = hipDeviceptr_t(A_h); - desc.srcPitch = width; - desc.dstMemoryType = hipMemoryTypeDevice; - desc.dstHost = A_d; - desc.dstDevice = hipDeviceptr_t(nullptr); - desc.dstPitch = pitch_A; - desc.WidthInBytes = NUM_W; - desc.Height = NUM_H; - REQUIRE(hipMemcpyParam2D(&desc) != hipSuccess); - } - - SECTION("Null Pointer to both Src & Dst Device Pointer") { - desc.srcDevice = hipDeviceptr_t(nullptr); - desc.dstDevice = hipDeviceptr_t(nullptr); - REQUIRE(hipMemcpyParam2D(&desc) != hipSuccess); - } - - SECTION("Width > src/dest pitches") { - desc.WidthInBytes = pitch_A + 1; - REQUIRE(hipMemcpyParam2D(&desc) != hipSuccess); - } - - // DeAllocating the Memory - HIP_CHECK(hipFree(A_d)); - HipTest::freeArrays(nullptr, nullptr, nullptr, A_h, B_h, C_h, false); -} diff --git a/catch/unit/memory/hipMemcpyPeer.cc b/catch/unit/memory/hipMemcpyPeer.cc index 1cec76cfb..1bde8e674 100644 --- a/catch/unit/memory/hipMemcpyPeer.cc +++ b/catch/unit/memory/hipMemcpyPeer.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -45,7 +32,7 @@ THE SOFTWARE. * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemcpyPeer_Positive_Default", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyPeer_Positive_Default) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -110,8 +97,7 @@ TEST_CASE("Unit_hipMemcpyPeer_Positive_Default", "[multigpu]") { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemcpyPeer_Positive_Synchronization_Behavior", - "[multigpu]") { +TEST_CASE(Unit_hipMemcpyPeer_Positive_Synchronization_Behavior) { HIP_CHECK(hipDeviceSynchronize()); const auto device_count = HipTest::getDeviceCount(); @@ -159,7 +145,7 @@ TEST_CASE("Unit_hipMemcpyPeer_Positive_Synchronization_Behavior", * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemcpyPeer_Positive_ZeroSize", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyPeer_Positive_ZeroSize) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -242,7 +228,7 @@ TEST_CASE("Unit_hipMemcpyPeer_Positive_ZeroSize", "[multigpu]") { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemcpyPeer_Negative_Parameters", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyPeer_Negative_Parameters) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); diff --git a/catch/unit/memory/hipMemcpyPeerAsync.cc b/catch/unit/memory/hipMemcpyPeerAsync.cc index a2bdf638c..43693f5c3 100644 --- a/catch/unit/memory/hipMemcpyPeerAsync.cc +++ b/catch/unit/memory/hipMemcpyPeerAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -45,7 +32,7 @@ THE SOFTWARE. * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemcpyPeerAsync_Positive_Default", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyPeerAsync_Positive_Default) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -114,8 +101,7 @@ TEST_CASE("Unit_hipMemcpyPeerAsync_Positive_Default", "[multigpu]") { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemcpyPeerAsync_Positive_Synchronization_Behavior", - "[multigpu]") { +TEST_CASE(Unit_hipMemcpyPeerAsync_Positive_Synchronization_Behavior) { HIP_CHECK(hipDeviceSynchronize()); const auto device_count = HipTest::getDeviceCount(); @@ -166,7 +152,7 @@ TEST_CASE("Unit_hipMemcpyPeerAsync_Positive_Synchronization_Behavior", * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemcpyPeerAsync_Positive_ZeroSize", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyPeerAsync_Positive_ZeroSize) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -251,7 +237,7 @@ TEST_CASE("Unit_hipMemcpyPeerAsync_Positive_ZeroSize", "[multigpu]") { * - Multi-device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipMemcpyPeerAsync_Negative_Parameters", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyPeerAsync_Negative_Parameters) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); @@ -311,7 +297,7 @@ TEST_CASE("Unit_hipMemcpyPeerAsync_Negative_Parameters", "[multigpu]") { } } -TEST_CASE("Unit_hipMemcpyPeerAsync_Capture") { +TEST_CASE(Unit_hipMemcpyPeerAsync_Capture) { const int device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("Skipping because devices < 2"); diff --git a/catch/unit/memory/hipMemcpyPeerAsync_old.cc b/catch/unit/memory/hipMemcpyPeerAsync_old.cc index d9284c0c0..0fd4935c7 100644 --- a/catch/unit/memory/hipMemcpyPeerAsync_old.cc +++ b/catch/unit/memory/hipMemcpyPeerAsync_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This testfile verifies the following scenarios of hipMemcpyPeerAsync API @@ -30,140 +17,6 @@ This testfile verifies the following scenarios of hipMemcpyPeerAsync API #include #include -/*This testcase verifies the negative scenarios of hipmemcpypeerAsync - */ -TEST_CASE("Unit_hipMemcpyPeerAsync_Negative", "[multigpu]") { - constexpr auto numElements{10}; - constexpr auto copy_bytes{numElements * sizeof(int)}; - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - int canAccessPeer = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); - if (canAccessPeer) { - // Initialization of variables - int *A_d{nullptr}, *B_d{nullptr}; - int *A_h{nullptr}, *B_h{nullptr}; - hipStream_t stream; - HIP_CHECK(hipSetDevice(0)); - HIP_CHECK(hipStreamCreate(&stream)); - HipTest::initArrays(&A_d, nullptr, nullptr, &A_h, &B_h, nullptr, - numElements * sizeof(int)); - HipTest::setDefaultData(numElements, A_h, B_h, nullptr); - HIP_CHECK(hipSetDevice(1)); - HipTest::initArrays(nullptr, &B_d, nullptr, nullptr, nullptr, nullptr, - numElements * sizeof(int)); - HIP_CHECK(hipMemcpy(B_d, B_h, numElements * sizeof(int), hipMemcpyHostToDevice)); - - SECTION("Nullptr to Destination Pointer") { - REQUIRE(hipMemcpyPeerAsync(nullptr, 1, A_d, 0, copy_bytes, stream) != hipSuccess); - } - - SECTION("Nullptr to Source Pointer") { - REQUIRE(hipMemcpyPeerAsync(B_d, 1, nullptr, 0, copy_bytes, stream) != hipSuccess); - } - - SECTION("Pass NumElements as 0") { - HIP_CHECK(hipMemcpy(A_d, A_h, numElements * sizeof(int), hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpyPeerAsync(B_d, 1, A_d, 0, 0, stream)); - HIP_CHECK(hipMemcpy(A_h, B_d, numElements * sizeof(int), hipMemcpyDeviceToHost)); - HipTest::checkTest(A_h, B_h, numElements); - } - - SECTION("Passing more than allocated size") { - REQUIRE(hipMemcpyPeerAsync(B_d, 1, A_d, 0, 100 * sizeof(int), stream) != hipSuccess); - } - - SECTION("Passing invalid Destination device ID") { - REQUIRE(hipMemcpyPeerAsync(B_d, numDevices, A_d, 0, copy_bytes, stream) != hipSuccess); - } - - SECTION("Passing invalid Source device ID") { - REQUIRE(hipMemcpyPeerAsync(B_d, 0, A_d, numDevices, copy_bytes, stream) != hipSuccess); - } - - HipTest::freeArrays(A_d, B_d, nullptr, A_h, B_h, nullptr, false); - HIP_CHECK(hipStreamDestroy(stream)); - } else { - SUCCEED("Machine Does not have P2P capability"); - } - } else { - SUCCEED("Number of devices are < 2"); - } -} -/* - * This test case verifies the basic scenario of hipMemcpyPeer API - * Initializes data in GPU-0 - * Launches the kernel and performs addition in GPU-0 - * Copies the data from GPU-0 to GPU-1 using hipMemcpyPeerAsync API - * Then performs the addition and validates the sum - */ - -TEST_CASE("Unit_hipMemcpyPeerAsync_Basic", "[multigpu]") { - constexpr auto numElements{10}; - constexpr auto copy_bytes{numElements * sizeof(int)}; - - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - int canAccessPeer = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); - if (canAccessPeer) { - // Initialization of Variables on GPU-0 - int *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; - int *X_d{nullptr}, *Y_d{nullptr}, *Z_d{nullptr}; - int *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}; - hipStream_t stream; - HIP_CHECK(hipSetDevice(0)); - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, numElements * sizeof(int)); - HipTest::setDefaultData(numElements, A_h, B_h, nullptr); - HIP_CHECK(hipMemcpy(A_d, A_h, numElements * sizeof(int), hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(B_d, B_h, numElements * sizeof(int), hipMemcpyHostToDevice)); - HIP_CHECK(hipStreamCreate(&stream)); - - // Initialization of Variables in GPU-1 - HIP_CHECK(hipSetDevice(1)); - HipTest::initArrays(&X_d, &Y_d, &Z_d, nullptr, nullptr, nullptr, - numElements * sizeof(int)); - - // Launching kernel and performing vector addition in GPU-0 - HIP_CHECK(hipSetDevice(0)); - hipLaunchKernelGGL(HipTest::vectorADD, dim3(1), numElements, 0, 0, static_cast(A_d), - static_cast(B_d), C_d, numElements * sizeof(int)); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipMemcpy(C_h, C_d, numElements * sizeof(int), hipMemcpyDeviceToHost)); - HipTest::checkVectorADD(A_h, B_h, C_h, numElements); - - // Copying data from GPU-0 to GPU-1 and performing vector addition - HIP_CHECK(hipSetDevice(1)); - SECTION("Calling hipMemcpyPerAsync() using user defined stream obj") { - HIP_CHECK(hipMemcpyPeerAsync(X_d, 1, A_d, 0, copy_bytes, stream)); - HIP_CHECK(hipMemcpyPeerAsync(Y_d, 1, B_d, 0, copy_bytes, stream)); - HIP_CHECK(hipStreamSynchronize(stream)); - } - SECTION("Calling hipMemcpyPerAsync() using hipStreamPerThread") { - HIP_CHECK(hipMemcpyPeerAsync(X_d, 1, A_d, 0, copy_bytes, hipStreamPerThread)); - HIP_CHECK(hipMemcpyPeerAsync(Y_d, 1, B_d, 0, copy_bytes, hipStreamPerThread)); - HIP_CHECK(hipStreamSynchronize(hipStreamPerThread)); - } - hipLaunchKernelGGL(HipTest::vectorADD, dim3(1), numElements, 0, 0, static_cast(X_d), - static_cast(Y_d), Z_d, numElements * sizeof(int)); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipMemcpy(C_h, Z_d, numElements * sizeof(int), hipMemcpyDeviceToHost)); - HipTest::checkVectorADD(A_h, B_h, C_h, numElements); - - // Cleaning the Memory - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); - HipTest::freeArrays(X_d, Y_d, Z_d, nullptr, nullptr, nullptr, false); - HIP_CHECK(hipStreamDestroy(stream)); - } else { - SUCCEED("Machine Does not have P2P capability"); - } - } else { - SUCCEED("Number of devices are < 2"); - } -} - /* * This test case verifies the following functionality where Memory is allocated in One GPU and @@ -175,7 +28,7 @@ TEST_CASE("Unit_hipMemcpyPeerAsync_Basic", "[multigpu]") { * where stream is created in GPU-1 * Then performs the addition and validates the sum */ -TEST_CASE("Unit_hipMemcpyPeerAsync_StreamOnDiffDevice", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyPeerAsync_StreamOnDiffDevice) { constexpr auto numElements{10}; constexpr auto copy_bytes{numElements * sizeof(int)}; int numDevices = 0; diff --git a/catch/unit/memory/hipMemcpyPeer_old.cc b/catch/unit/memory/hipMemcpyPeer_old.cc deleted file mode 100644 index 87266e76c..000000000 --- a/catch/unit/memory/hipMemcpyPeer_old.cc +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright (c) 2021 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 -#include -#include -/* -This testfile verifies the following scenarios of hipMemcpyPeer API -1. Negative Scenarios -2. Basic scenario of hipMemcpyPeer API -*/ - -/*This testcase verifies the negative scenarios of hipmemcpypeer - */ -TEST_CASE("Unit_hipMemcpyPeer_Negative", "[multigpu]") { - constexpr auto numElements{10}; - constexpr auto copy_bytes{numElements * sizeof(int)}; - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - int canAccessPeer = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); - if (canAccessPeer) { - // Initialization of variables - int *A_d{nullptr}, *B_d{nullptr}; - int *A_h{nullptr}, *B_h{nullptr}; - HIP_CHECK(hipSetDevice(0)); - HipTest::initArrays(&A_d, nullptr, nullptr, &A_h, &B_h, nullptr, - numElements * sizeof(int)); - HipTest::setDefaultData(numElements, A_h, B_h, nullptr); - HIP_CHECK(hipSetDevice(1)); - HipTest::initArrays(nullptr, &B_d, nullptr, nullptr, nullptr, nullptr, - numElements * sizeof(int)); - HIP_CHECK(hipMemcpy(B_d, B_h, numElements * sizeof(int), hipMemcpyHostToDevice)); - - SECTION("Nullptr to Destination Pointer") { - REQUIRE(hipMemcpyPeer(nullptr, 1, A_d, 0, copy_bytes) != hipSuccess); - } - - SECTION("Nullptr to Source Pointer") { - REQUIRE(hipMemcpyPeer(B_d, 1, nullptr, 0, copy_bytes) != hipSuccess); - } - - SECTION("Pass NumElements as 0") { - HIP_CHECK(hipMemcpy(A_d, A_h, numElements * sizeof(int), hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpyPeer(B_d, 1, A_d, 0, 0)); - HIP_CHECK(hipMemcpy(A_h, B_d, numElements * sizeof(int), hipMemcpyDeviceToHost)); - HipTest::checkTest(A_h, B_h, numElements); - } - - SECTION("Passing more than allocated size") { - REQUIRE(hipMemcpyPeer(B_d, 1, A_d, 0, ((numElements + 40) * sizeof(int))) != hipSuccess); - } - - SECTION("Passing invalid Destination device ID") { - REQUIRE(hipMemcpyPeer(B_d, numDevices, A_d, 0, copy_bytes) != hipSuccess); - } - - SECTION("Passing invalid Source device ID") { - REQUIRE(hipMemcpyPeer(B_d, 1, A_d, numDevices, copy_bytes) != hipSuccess); - } - HipTest::freeArrays(A_d, B_d, nullptr, A_h, B_h, nullptr, false); - } else { - SUCCEED("Machine Does not have P2P capability"); - } - } else { - SUCCEED("Number of devices are < 2"); - } -} - -/* - * This test case verifies the basic scenario of hipMemcpyPeer API - * Initializes data in GPU-0 - * Launches the kernel and performs addition in GPU-0 - * Copies the data from GPU-0 to GPU-1 using hipMemcpyPeer API - * Then performs the addition and validates the sum - */ -TEST_CASE("Unit_hipMemcpyPeer_Basic", "[multigpu]") { - constexpr auto numElements{10}; - constexpr auto copy_bytes{numElements * sizeof(int)}; - int numDevices = 0; - HIP_CHECK(hipGetDeviceCount(&numDevices)); - if (numDevices > 1) { - int canAccessPeer = 0; - HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); - if (canAccessPeer) { - int *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; - int *X_d{nullptr}, *Y_d{nullptr}, *Z_d{nullptr}; - int *A_h{nullptr}, *B_h{nullptr}, *C_h{nullptr}; - - // Initialization of Variables on GPU-0 - HIP_CHECK(hipSetDevice(0)); - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, numElements * sizeof(int)); - HIP_CHECK(hipMemcpy(A_d, A_h, numElements * sizeof(int), hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(B_d, B_h, numElements * sizeof(int), hipMemcpyHostToDevice)); - - // Initialization of Variables on GPU-1 - HIP_CHECK(hipSetDevice(1)); - HipTest::initArrays(&X_d, &Y_d, &Z_d, nullptr, nullptr, nullptr, - numElements * sizeof(int)); - - // Launching kernel and performing vector addition on GPU-0 - HIP_CHECK(hipSetDevice(0)); - hipLaunchKernelGGL(HipTest::vectorADD, dim3(1), numElements, 0, 0, - static_cast(A_d), static_cast(B_d), C_d, - numElements * sizeof(int)); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipMemcpy(C_h, C_d, numElements * sizeof(int), hipMemcpyDeviceToHost)); - HipTest::checkVectorADD(A_h, B_h, C_h, numElements); - - HIP_CHECK(hipSetDevice(1)); - // Copying data from GPU-0 to GPU-1 and performing vector addition - HIP_CHECK(hipMemcpyPeer(X_d, 1, A_d, 0, copy_bytes)); - HIP_CHECK(hipMemcpyPeer(Y_d, 1, B_d, 0, copy_bytes)); - hipLaunchKernelGGL(HipTest::vectorADD, dim3(1), numElements, 0, 0, - static_cast(X_d), static_cast(Y_d), Z_d, - numElements * sizeof(int)); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipMemcpy(C_h, Z_d, numElements * sizeof(int), hipMemcpyDeviceToHost)); - HipTest::checkVectorADD(A_h, B_h, C_h, numElements); - - // Cleaning the memory - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); - HipTest::freeArrays(X_d, Y_d, Z_d, nullptr, nullptr, nullptr, false); - } else { - SUCCEED("Machine Does not have P2P capability"); - } - } else { - SUCCEED("Number of devices are < 2"); - } -} diff --git a/catch/unit/memory/hipMemcpySync.cc b/catch/unit/memory/hipMemcpySync.cc index bef3c953f..7ebdecd9e 100644 --- a/catch/unit/memory/hipMemcpySync.cc +++ b/catch/unit/memory/hipMemcpySync.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of intge, 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "MemUtils.hh" #include @@ -177,7 +161,7 @@ static void runMemcpyTests(hipStream_t stream, bool async, allocType type, memTy #if HT_AMD /* Disabled because frequency based wait is timing out on nvidia platforms */ -TEST_CASE("Unit_hipMemcpySync") { +TEST_CASE(Unit_hipMemcpySync) { #if HT_AMD // To be removed when EXSWCPHIPT-127 is fixed HipTest::HIP_SKIP_TEST("EXSWCPHIPT-127 - Sync behaviour differs on AMD and Nvidia"); return; @@ -191,7 +175,7 @@ TEST_CASE("Unit_hipMemcpySync") { doMemTest(runMemcpyTests, type, memcpy_type, data); // Uses long running kernel } -TEST_CASE("Unit_hipMemcpy2DSync") { +TEST_CASE(Unit_hipMemcpy2DSync) { #if HT_AMD HipTest::HIP_SKIP_TEST("EXSWCPHIPT-127 - Sync behaviour differs on AMD and Nvidia"); return; @@ -207,7 +191,7 @@ TEST_CASE("Unit_hipMemcpy2DSync") { doMemTest(runMemcpyTests, mallocType, memcpy_type, data); } -TEST_CASE("Unit_hipMemcpy3DSync") { +TEST_CASE(Unit_hipMemcpy3DSync) { #if HT_AMD HipTest::HIP_SKIP_TEST("EXSWCPHIPT-127 - Sync behaviour differs on AMD and Nvidia"); return; diff --git a/catch/unit/memory/hipMemcpyWithStream.cc b/catch/unit/memory/hipMemcpyWithStream.cc index 88fb0bd7a..35e98003a 100644 --- a/catch/unit/memory/hipMemcpyWithStream.cc +++ b/catch/unit/memory/hipMemcpyWithStream.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -25,9 +10,9 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipMemcpy_Positive_Basic") { MemcpyWithDirectionCommonTests(hipMemcpy); } +TEST_CASE(Unit_hipMemcpy_Positive_Basic) { MemcpyWithDirectionCommonTests(hipMemcpy); } -TEST_CASE("Unit_hipMemcpy_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpy_Positive_Synchronization_Behavior) { using namespace std::placeholders; HIP_CHECK(hipDeviceSynchronize()); @@ -68,7 +53,7 @@ TEST_CASE("Unit_hipMemcpy_Positive_Synchronization_Behavior") { } } -TEST_CASE("Unit_hipMemcpy_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpy_Negative_Parameters) { using namespace std::placeholders; SECTION("Host to device") { @@ -100,7 +85,7 @@ TEST_CASE("Unit_hipMemcpy_Negative_Parameters") { } } -TEST_CASE("Unit_hipMemcpyWithStream_Capture") { +TEST_CASE(Unit_hipMemcpyWithStream_Capture) { constexpr size_t kNumElements = 1024; LinearAllocGuard host_data(LinearAllocs::malloc, kNumElements * sizeof(int)); diff --git a/catch/unit/memory/hipMemcpyWithStreamMultiThread.cc b/catch/unit/memory/hipMemcpyWithStreamMultiThread.cc index 41b4d846a..df79c4073 100644 --- a/catch/unit/memory/hipMemcpyWithStreamMultiThread.cc +++ b/catch/unit/memory/hipMemcpyWithStreamMultiThread.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2020-present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* * Different test for checking functionality of @@ -580,7 +567,7 @@ void HipMemcpyWithStreamMultiThreadtests::TestkindHtoH(bool& val_res) { HIP_CHECK_THREAD(hipStreamDestroy(stream)); } -TEST_CASE("Unit_hipMemcpyWithStream_MultiThread", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyWithStream_MultiThread) { const auto Threadcount{10}; bool ret_val[Threadcount]; std::thread th[Threadcount]; diff --git a/catch/unit/memory/hipMemcpyWithStream_old.cc b/catch/unit/memory/hipMemcpyWithStream_old.cc index 1841b5690..da2a18b3d 100644 --- a/catch/unit/memory/hipMemcpyWithStream_old.cc +++ b/catch/unit/memory/hipMemcpyWithStream_old.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021-22-present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* * Different test for checking functionality of @@ -55,7 +42,6 @@ static constexpr unsigned blocksPerCU{6}; // to hide latency static constexpr unsigned threadsPerBlock{256}; enum class ops { - TestwithOnestream, TestwithTwoStream, TestOnMultiGPUwithOneStream, TestkindDtoH, @@ -79,30 +65,6 @@ struct joinable_thread : std::thread { } }; -void TestwithOnestream(void) { - size_t Nbytes = N * sizeof(int); - int *A_d, *B_d, *C_d; - int *A_h, *B_h, *C_h; - - unsigned blocks = HipTest::setNumBlocks(blocksPerCU, threadsPerBlock, N); - HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, N, false); - - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - - HIP_CHECK(hipMemcpyWithStream(A_d, A_h, Nbytes, hipMemcpyHostToDevice, stream)); - HIP_CHECK(hipMemcpyWithStream(B_d, B_h, Nbytes, hipMemcpyHostToDevice, stream)); - hipLaunchKernelGGL(HipTest::vectorADD, dim3(blocks), dim3(threadsPerBlock), 0, stream, - static_cast(A_d), static_cast(B_d), C_d, N); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipStreamSynchronize(stream)); - HIP_CHECK(hipMemcpy(C_h, C_d, Nbytes, hipMemcpyDeviceToHost)); - HipTest::checkVectorADD(A_h, B_h, C_h, N); - - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); - HIP_CHECK(hipStreamDestroy(stream)); -} - void TestwithTwoStream(void) { size_t Nbytes = N * sizeof(int); const int NUM_STREAMS = 2; @@ -512,28 +474,25 @@ void TestkindHtoH(void) { } -TEST_CASE("Unit_hipMemcpyWithStream_TestWithOneStream") { TestwithOnestream(); } - TEST_CASE("Unit_hipMemcpyWithStream_TestwithTwoStream") { TestwithTwoStream(); } -TEST_CASE("Unit_hipMemcpyWithStream_TestkindDtoH") { TestkindDtoH(); } +TEST_CASE(Unit_hipMemcpyWithStream_TestkindDtoH) { TestkindDtoH(); } -TEST_CASE("Unit_hipMemcpyWithStream_TestkindHtoH") { TestkindHtoH(); } +TEST_CASE(Unit_hipMemcpyWithStream_TestkindHtoH) { TestkindHtoH(); } -TEST_CASE("Unit_hipMemcpyWithStream_TestkindDtoD", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyWithStream_TestkindDtoD) { TestkindDtoD(); } -TEST_CASE("Unit_hipMemcpyWithStream_TestOnMultiGPUwithOneStream", - "[multigpu]") { +TEST_CASE(Unit_hipMemcpyWithStream_TestOnMultiGPUwithOneStream) { TestOnMultiGPUwithOneStream(); } -TEST_CASE("Unit_hipMemcpyWithStream_TestkindDefault") { TestkindDefault(); } +TEST_CASE(Unit_hipMemcpyWithStream_TestkindDefault) { TestkindDefault(); } #ifndef __HIP_PLATFORM_NVIDIA__ -TEST_CASE("Unit_hipMemcpyWithStream_TestkindDefaultForDtoD", "[multigpu]") { +TEST_CASE(Unit_hipMemcpyWithStream_TestkindDefaultForDtoD) { TestkindDefaultForDtoD(); } #endif -TEST_CASE("Unit_hipMemcpyWithStream_TestDtoDonSameDevice") { TestDtoDonSameDevice(); } +TEST_CASE(Unit_hipMemcpyWithStream_TestDtoDonSameDevice) { TestDtoDonSameDevice(); } diff --git a/catch/unit/memory/hipMemcpy_EdgeCases.cc b/catch/unit/memory/hipMemcpy_EdgeCases.cc index 63971e7f8..7adbb09f5 100644 --- a/catch/unit/memory/hipMemcpy_EdgeCases.cc +++ b/catch/unit/memory/hipMemcpy_EdgeCases.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 - present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This testcase verifies following scenarios @@ -372,7 +359,7 @@ Initializes device variables Launches kernel and performs the sum of device variables copies the result to host variable and validates the result. */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy_KernelLaunch", "", int, float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpy_KernelLaunch, int, float, double) { size_t Nbytes = NUM_ELM * sizeof(TestType); TestType *A_d{nullptr}, *B_d{nullptr}, *C_d{nullptr}; @@ -404,8 +391,7 @@ This testcase verifies the following scenarios 4. Device context change 5. H2D-D2D-D2H peer GPU */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy_H2H-H2D-D2H-H2PinMem", "[multigpu]", int, - float, double) { +TEMPLATE_TEST_CASE(Unit_hipMemcpy_H2H_H2D_D2H_H2PinMem, int, float, double) { TestType *A_d{nullptr}, *B_d{nullptr}; TestType *A_h{nullptr}, *B_h{nullptr}; TestType *A_Ph{nullptr}, *B_Ph{nullptr}; @@ -485,7 +471,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpy_H2H-H2D-D2H-H2PinMem", "[multigpu]", int, /* This testcase verifies the multi thread scenario */ -TEST_CASE("Unit_hipMemcpy_MultiThreadWithSerialization") { +TEST_CASE(Unit_hipMemcpy_MultiThreadWithSerialization) { HIP_CHECK(hipDeviceReset()); // Simplest cases: serialize the threads, and also used pinned memory: @@ -501,7 +487,7 @@ This testcase verifies hipMemcpy API with pinnedMemory and hostRegister along with kernel launches */ -TEMPLATE_TEST_CASE("Unit_hipMemcpy_PinnedRegMemWithKernelLaunch", "[multigpu]", +TEMPLATE_TEST_CASE(Unit_hipMemcpy_PinnedRegMemWithKernelLaunch, int, float, double) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); diff --git a/catch/unit/memory/hipMemcpy_MultiThread.cc b/catch/unit/memory/hipMemcpy_MultiThread.cc index 468412111..fed97308e 100644 --- a/catch/unit/memory/hipMemcpy_MultiThread.cc +++ b/catch/unit/memory/hipMemcpy_MultiThread.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 - present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -280,7 +267,7 @@ void Thread_func(bool& ret_val) { } -TEST_CASE("Unit_hipMemcpy_MultiThread-AllAPIs", "[multigpu]") { +TEST_CASE(Unit_hipMemcpy_MultiThread_AllAPIs) { std::thread Thrd[NUM_THREADS]; bool ret_val[NUM_THREADS]; for (int i = 0; i < NUM_THREADS; i++) Thrd[i] = std::thread(Thread_func, std::ref(ret_val[i])); diff --git a/catch/unit/memory/hipMemcpy_derivatives.cc b/catch/unit/memory/hipMemcpy_derivatives.cc index e3ff93e8f..52d7c42cc 100644 --- a/catch/unit/memory/hipMemcpy_derivatives.cc +++ b/catch/unit/memory/hipMemcpy_derivatives.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,13 +11,13 @@ THE SOFTWARE. #include // hipMemcpyDtoH -TEST_CASE("Unit_hipMemcpyDtoH_Positive_Basic") { +TEST_CASE(Unit_hipMemcpyDtoH_Positive_Basic) { MemcpyDeviceToHostShell([](void* dst, void* src, size_t count) { return hipMemcpyDtoH(dst, reinterpret_cast(src), count); }); } -TEST_CASE("Unit_hipMemcpyDtoH_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyDtoH_Positive_Synchronization_Behavior) { const auto f = [](void* dst, void* src, size_t count) { return hipMemcpyDtoH(dst, reinterpret_cast(src), count); }; @@ -40,7 +25,7 @@ TEST_CASE("Unit_hipMemcpyDtoH_Positive_Synchronization_Behavior") { MemcpyDtoHPinnedSyncBehavior(f, true); } -TEST_CASE("Unit_hipMemcpyDtoH_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyDtoH_Negative_Parameters) { using namespace std::placeholders; LinearAllocGuard device_alloc(LinearAllocs::hipMalloc, kPageSize); LinearAllocGuard host_alloc(LinearAllocs::hipHostMalloc, kPageSize); @@ -53,13 +38,13 @@ TEST_CASE("Unit_hipMemcpyDtoH_Negative_Parameters") { } // hipMemcpyHtoD -TEST_CASE("Unit_hipMemcpyHtoD_Positive_Basic") { +TEST_CASE(Unit_hipMemcpyHtoD_Positive_Basic) { MemcpyHostToDeviceShell([](void* dst, void* src, size_t count) { return hipMemcpyHtoD(reinterpret_cast(dst), src, count); }); } -TEST_CASE("Unit_hipMemcpyHtoD_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyHtoD_Positive_Synchronization_Behavior) { MemcpyHPageabletoDSyncBehavior( [](void* dst, void* src, size_t count) { return hipMemcpyHtoD(reinterpret_cast(dst), src, count); @@ -67,7 +52,7 @@ TEST_CASE("Unit_hipMemcpyHtoD_Positive_Synchronization_Behavior") { true); } -TEST_CASE("Unit_hipMemcpyHtoD_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyHtoD_Negative_Parameters) { using namespace std::placeholders; LinearAllocGuard device_alloc(LinearAllocs::hipMalloc, kPageSize); LinearAllocGuard host_alloc(LinearAllocs::hipHostMalloc, kPageSize); @@ -80,7 +65,7 @@ TEST_CASE("Unit_hipMemcpyHtoD_Negative_Parameters") { } // hipMemcpyDtoD -TEST_CASE("Unit_hipMemcpyDtoD_Positive_Basic") { +TEST_CASE(Unit_hipMemcpyDtoD_Positive_Basic) { const auto f = [](void* dst, void* src, size_t count) { return hipMemcpyDtoD(reinterpret_cast(dst), reinterpret_cast(src), count); @@ -89,7 +74,7 @@ TEST_CASE("Unit_hipMemcpyDtoD_Positive_Basic") { SECTION("Peer access disabled") { MemcpyDeviceToDeviceShell(f); } } -TEST_CASE("Unit_hipMemcpyDtoD_Positive_Synchronization_Behavior") { +TEST_CASE(Unit_hipMemcpyDtoD_Positive_Synchronization_Behavior) { // This behavior differs on NVIDIA and AMD, on AMD the hipMemcpy calls is synchronous with // respect to the host #if HT_AMD @@ -105,7 +90,7 @@ TEST_CASE("Unit_hipMemcpyDtoD_Positive_Synchronization_Behavior") { false); } -TEST_CASE("Unit_hipMemcpyDtoD_Negative_Parameters") { +TEST_CASE(Unit_hipMemcpyDtoD_Negative_Parameters) { using namespace std::placeholders; LinearAllocGuard src_alloc(LinearAllocs::hipMalloc, kPageSize); LinearAllocGuard dst_alloc(LinearAllocs::hipMalloc, kPageSize); diff --git a/catch/unit/memory/hipMemset.cc b/catch/unit/memory/hipMemset.cc index 7f31f63db..e0affdf2e 100644 --- a/catch/unit/memory/hipMemset.cc +++ b/catch/unit/memory/hipMemset.cc @@ -1,20 +1,7 @@ /* - * Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -133,7 +120,7 @@ template static bool testhipMemsetAsync(T* A_h, T* A_d, T memsetval * Test hipMemset, hipMemsetD8, hipMemsetD16, hipMemsetD32 apis with unique * number of elements and memset values. */ -TEST_CASE("Unit_hipMemset_SetMemoryWithOffset") { +TEST_CASE(Unit_hipMemset_SetMemoryWithOffset) { char memsetval; int memsetD32val; int16_t memsetD16val; @@ -175,7 +162,7 @@ TEST_CASE("Unit_hipMemset_SetMemoryWithOffset") { * Test hipMemsetAsync, hipMemsetD8Async, hipMemsetD16Async, hipMemsetD32Async * apis with unique number of elements and memset values. */ -TEST_CASE("Unit_hipMemsetAsync_SetMemoryWithOffset") { +TEST_CASE(Unit_hipMemsetAsync_SetMemoryWithOffset) { char memsetval; int memsetD32val; int16_t memsetD16val; @@ -215,7 +202,7 @@ TEST_CASE("Unit_hipMemsetAsync_SetMemoryWithOffset") { /** * Test hipMemset small size buffers with unique memset values. */ -TEST_CASE("Unit_hipMemset_SmallBufferSizes") { +TEST_CASE(Unit_hipMemset_SmallBufferSizes) { char *A_d, *A_h; constexpr int memsetval = 0x24; @@ -243,7 +230,7 @@ TEST_CASE("Unit_hipMemset_SmallBufferSizes") { /** * Test two memset async operations at the same time. */ -TEST_CASE("Unit_hipMemset_2AsyncOperations") { +TEST_CASE(Unit_hipMemset_2AsyncOperations) { std::vector v; v.resize(2048); float *p2, *p3; @@ -308,11 +295,11 @@ TEST_CASE("Unit_hipMemset_Capture") { TEST_CASE("Unit_hipMemsetD8_Capture") { const size_t N = 512; void* dst = nullptr; - HIP_CHECK(hipMalloc(&dst, N * sizeof(uint8_t))); + HIP_CHECK(hipMalloc(&dst, N * sizeof(uint8_t))); hipError_t memcpy_err = hipSuccess; BEGIN_CAPTURE_SYNC(memcpy_err, false); - HIP_CHECK_ERROR(hipMemsetD8(dst, 0xCD, N), memcpy_err); + HIP_CHECK_ERROR(hipMemsetD8(reinterpret_cast(dst), 0xCD, N), memcpy_err); END_CAPTURE_SYNC(memcpy_err); HIP_CHECK(hipFree(dst)); diff --git a/catch/unit/memory/hipMemset2D.cc b/catch/unit/memory/hipMemset2D.cc index fa5c3882b..10fb6f8a2 100644 --- a/catch/unit/memory/hipMemset2D.cc +++ b/catch/unit/memory/hipMemset2D.cc @@ -1,20 +1,7 @@ /* - * Copyright (c) 2021 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -43,7 +30,7 @@ static constexpr std::initializer_list tableItems{ /** * Basic Functionality of hipMemset2D */ -TEST_CASE("Unit_hipMemset2D_BasicFunctional") { +TEST_CASE(Unit_hipMemset2D_BasicFunctional) { CHECK_IMAGE_SUPPORT constexpr int memsetval = 0x24; @@ -82,7 +69,7 @@ TEST_CASE("Unit_hipMemset2D_BasicFunctional") { /** * Basic Functionality of hipMemset2DAsync */ -TEST_CASE("Unit_hipMemset2DAsync_BasicFunctional") { +TEST_CASE(Unit_hipMemset2DAsync_BasicFunctional) { CHECK_IMAGE_SUPPORT constexpr int memsetval = 0x26; @@ -125,7 +112,7 @@ TEST_CASE("Unit_hipMemset2DAsync_BasicFunctional") { /** * Memset partial buffer with unique Width and Height */ -TEST_CASE("Unit_hipMemset2D_UniqueWidthHeight") { +TEST_CASE(Unit_hipMemset2D_UniqueWidthHeight) { CHECK_IMAGE_SUPPORT int width2D, height2D; @@ -180,7 +167,7 @@ TEST_CASE("Unit_hipMemset2D_UniqueWidthHeight") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemset2DAsync_capturehipMemset2DAsync") { +TEST_CASE(Unit_hipMemset2DAsync_capturehipMemset2DAsync) { char *A_h, *B_h, *A_d; hipGraph_t graph{nullptr}; hipGraphExec_t graphExec{nullptr}; diff --git a/catch/unit/memory/hipMemset2DAsyncMultiThreadAndKernel.cc b/catch/unit/memory/hipMemset2DAsyncMultiThreadAndKernel.cc index 72fa3412a..47d7d910e 100644 --- a/catch/unit/memory/hipMemset2DAsyncMultiThreadAndKernel.cc +++ b/catch/unit/memory/hipMemset2DAsyncMultiThreadAndKernel.cc @@ -1,20 +1,7 @@ /* - * Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -48,7 +35,7 @@ void queueJobsForhipMemset2DAsync(char* A_d, char* A_h, size_t pitch, size_t wid /** * Order of execution of device kernel and hipMemset2DAsync api. */ -TEST_CASE("Unit_hipMemset2DAsync_WithKernel") { +TEST_CASE(Unit_hipMemset2DAsync_WithKernel) { CHECK_IMAGE_SUPPORT constexpr auto N = 4 * 1024 * 1024; @@ -127,7 +114,7 @@ TEST_CASE("Unit_hipMemset2DAsync_WithKernel") { /** * hipMemSet2DAsync execution in multiple threads. */ -TEST_CASE("Unit_hipMemset2DAsync_MultiThread") { +TEST_CASE(Unit_hipMemset2DAsync_MultiThread) { CHECK_IMAGE_SUPPORT constexpr auto memPerThread = 200; diff --git a/catch/unit/memory/hipMemset3D.cc b/catch/unit/memory/hipMemset3D.cc index 3d41574bf..e579e29e2 100644 --- a/catch/unit/memory/hipMemset3D.cc +++ b/catch/unit/memory/hipMemset3D.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Functional test for Memset3D and Memset3DAsync @@ -31,7 +15,7 @@ THE SOFTWARE. /** * Basic Functional test of hipMemset3D */ -TEST_CASE("Unit_hipMemset3D_BasicFunctional") { +TEST_CASE(Unit_hipMemset3D_BasicFunctional) { CHECK_IMAGE_SUPPORT constexpr int memsetval = 0x22; @@ -81,7 +65,7 @@ TEST_CASE("Unit_hipMemset3D_BasicFunctional") { /** * Basic Functional test of hipMemset3DAsync */ -TEST_CASE("Unit_hipMemset3DAsync_BasicFunctional") { +TEST_CASE(Unit_hipMemset3DAsync_BasicFunctional) { CHECK_IMAGE_SUPPORT constexpr int memsetval = 0x22; @@ -143,7 +127,7 @@ TEST_CASE("Unit_hipMemset3DAsync_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipMemset3DAsync_capturehipMemset3DAsync") { +TEST_CASE(Unit_hipMemset3DAsync_capturehipMemset3DAsync) { char* A_h; hipPitchedPtr A_d; hipGraph_t graph{nullptr}; diff --git a/catch/unit/memory/hipMemset3DFunctional.cc b/catch/unit/memory/hipMemset3DFunctional.cc index 92f15b2dd..f183e6ac6 100644 --- a/catch/unit/memory/hipMemset3DFunctional.cc +++ b/catch/unit/memory/hipMemset3DFunctional.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -400,7 +387,7 @@ static void seekAndSet3DArrayPortion(bool bAsync) { * Test Memset3D with different combinations of extent * taking zero and non-zero fields. */ -TEST_CASE("Unit_hipMemset3D_MemsetWithExtent") { +TEST_CASE(Unit_hipMemset3D_MemsetWithExtent) { CHECK_IMAGE_SUPPORT hipExtent testExtent; @@ -436,7 +423,7 @@ TEST_CASE("Unit_hipMemset3D_MemsetWithExtent") { * Test Memset3DAsync with different combinations of extent * taking zero and non-zero fields. */ -TEST_CASE("Unit_hipMemset3DAsync_MemsetWithExtent") { +TEST_CASE(Unit_hipMemset3DAsync_MemsetWithExtent) { CHECK_IMAGE_SUPPORT hipExtent testExtent; @@ -470,7 +457,7 @@ TEST_CASE("Unit_hipMemset3DAsync_MemsetWithExtent") { /** * Memset3D with max unsigned char and verify memset operation is success */ -TEST_CASE("Unit_hipMemset3D_MemsetMaxValue") { +TEST_CASE(Unit_hipMemset3D_MemsetMaxValue) { CHECK_IMAGE_SUPPORT testMemsetMaxValue(0); @@ -479,7 +466,7 @@ TEST_CASE("Unit_hipMemset3D_MemsetMaxValue") { /** * Memset3DAsync with max unsigned char and verify memset operation is success */ -TEST_CASE("Unit_hipMemset3DAsync_MemsetMaxValue") { +TEST_CASE(Unit_hipMemset3DAsync_MemsetMaxValue) { CHECK_IMAGE_SUPPORT testMemsetMaxValue(1); @@ -488,7 +475,7 @@ TEST_CASE("Unit_hipMemset3DAsync_MemsetMaxValue") { /** * Seek and set random slice of 3d array, verify memset is success */ -TEST_CASE("Unit_hipMemset3D_SeekSetSlice") { +TEST_CASE(Unit_hipMemset3D_SeekSetSlice) { CHECK_IMAGE_SUPPORT seekAndSet3DArraySlice(0); @@ -497,7 +484,7 @@ TEST_CASE("Unit_hipMemset3D_SeekSetSlice") { /** * Seek and set random slice of 3d array with async, verify memset is success */ -TEST_CASE("Unit_hipMemset3DAsync_SeekSetSlice") { +TEST_CASE(Unit_hipMemset3DAsync_SeekSetSlice) { CHECK_IMAGE_SUPPORT seekAndSet3DArraySlice(1); @@ -506,7 +493,7 @@ TEST_CASE("Unit_hipMemset3DAsync_SeekSetSlice") { /** * Memset3D selected portion of 3d array */ -TEST_CASE("Unit_hipMemset3D_SeekSetArrayPortion") { +TEST_CASE(Unit_hipMemset3D_SeekSetArrayPortion) { CHECK_IMAGE_SUPPORT seekAndSet3DArrayPortion(0); @@ -515,7 +502,7 @@ TEST_CASE("Unit_hipMemset3D_SeekSetArrayPortion") { /** * Memset3DAsync selected portion of 3d array */ -TEST_CASE("Unit_hipMemset3DAsync_SeekSetArrayPortion") { +TEST_CASE(Unit_hipMemset3DAsync_SeekSetArrayPortion) { CHECK_IMAGE_SUPPORT seekAndSet3DArrayPortion(1); diff --git a/catch/unit/memory/hipMemset3DRegressMultiThread.cc b/catch/unit/memory/hipMemset3DRegressMultiThread.cc index ce535ec9a..b29f2189f 100644 --- a/catch/unit/memory/hipMemset3DRegressMultiThread.cc +++ b/catch/unit/memory/hipMemset3DRegressMultiThread.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -186,7 +173,7 @@ bool loopRegression(bool bAsync) { * Perform regression of hipMemset3D api with device memory allocated * on different gpus. */ -TEST_CASE("Unit_hipMemset3D_RegressInLoop", "[multigpu]") { +TEST_CASE(Unit_hipMemset3D_RegressInLoop) { CHECK_IMAGE_SUPPORT bool TestPassed = false; @@ -199,7 +186,7 @@ TEST_CASE("Unit_hipMemset3D_RegressInLoop", "[multigpu]") { * Perform regression of hipMemset3DAsync api with device memory allocated * on different gpus. */ -TEST_CASE("Unit_hipMemset3DAsync_RegressInLoop", "[multigpu]") { +TEST_CASE(Unit_hipMemset3DAsync_RegressInLoop) { CHECK_IMAGE_SUPPORT bool TestPassed = false; @@ -211,7 +198,7 @@ TEST_CASE("Unit_hipMemset3DAsync_RegressInLoop", "[multigpu]") { /** * Async commands queued concurrently and executed */ -TEST_CASE("Unit_hipMemset3DAsync_ConcurrencyMthread") { +TEST_CASE(Unit_hipMemset3DAsync_ConcurrencyMthread) { CHECK_IMAGE_SUPPORT char* A_h; diff --git a/catch/unit/memory/hipMemsetAsync.cc b/catch/unit/memory/hipMemsetAsync.cc index 80e6ecb04..422da44d7 100644 --- a/catch/unit/memory/hipMemsetAsync.cc +++ b/catch/unit/memory/hipMemsetAsync.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of intge, 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "MemUtils.hh" @@ -77,7 +61,7 @@ template static void doMemsetTest(allocType mallocType, memType mem * test 2 async hipMemset's on the same memory at different offsets */ -TEST_CASE("Unit_hipMemsetASyncMulti") { +TEST_CASE(Unit_hipMemsetASyncMulti) { allocType mallocType = GENERATE(allocType::hostMalloc, allocType::deviceMalloc, allocType::hostRegisted, allocType::devRegistered); memType mem_type = memType::hipMemsetD8; @@ -94,7 +78,7 @@ TEST_CASE("Unit_hipMemsetASyncMulti") { /* * test 2 async hipMemsetD[8,16,32]'s on the same memory at different offsets */ -TEMPLATE_TEST_CASE("Unit_hipMemsetDASyncMulti", "", int8_t, int16_t, uint32_t) { +TEMPLATE_TEST_CASE(Unit_hipMemsetDASyncMulti, int8_t, int16_t, uint32_t) { allocType mallocType = GENERATE(allocType::hostRegisted, allocType::deviceMalloc, allocType::hostMalloc, allocType::devRegistered); memType memset_type; @@ -118,7 +102,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemsetDASyncMulti", "", int8_t, int16_t, uint32_t) { /* * test 2 async hipMemset2D's on the same memory at different offsets */ -TEST_CASE("Unit_hipMemset2DASyncMulti") { +TEST_CASE(Unit_hipMemset2DASyncMulti) { #if HT_AMD HipTest::HIP_SKIP_TEST("EXSWCPHIPT-127"); return; @@ -140,7 +124,7 @@ TEST_CASE("Unit_hipMemset2DASyncMulti") { /* * test 2 async hipMemset3D's on the same memory at different offsets */ -TEST_CASE("Unit_hipMemset3DASyncMulti") { +TEST_CASE(Unit_hipMemset3DASyncMulti) { #if HT_AMD HipTest::HIP_SKIP_TEST("EXSWCPHIPT-127"); return; diff --git a/catch/unit/memory/hipMemsetAsyncAndKernel.cc b/catch/unit/memory/hipMemsetAsyncAndKernel.cc index 412fe215e..6785a3826 100644 --- a/catch/unit/memory/hipMemsetAsyncAndKernel.cc +++ b/catch/unit/memory/hipMemsetAsyncAndKernel.cc @@ -1,20 +1,7 @@ /* - * Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /* @@ -168,7 +155,7 @@ static bool testhipMemsetD8AsyncWithKernel() { * Test for checking order of execution of device kernel and * hipMemsetAsync apis on all gpus */ -TEST_CASE("Unit_hipMemsetAsync_VerifyExecutionWithKernel") { +TEST_CASE(Unit_hipMemsetAsync_VerifyExecutionWithKernel) { int numDevices = 0; bool ret, UseStrmPerThrd = false; diff --git a/catch/unit/memory/hipMemsetBasic.cc b/catch/unit/memory/hipMemsetBasic.cc deleted file mode 100644 index 91f2d0460..000000000 --- a/catch/unit/memory/hipMemsetBasic.cc +++ /dev/null @@ -1,21 +0,0 @@ -#include - -TEST_CASE("Unit_hipMemset_4bytes") { - int* d_a; - auto res = hipMalloc(&d_a, sizeof(int)); - REQUIRE(res == hipSuccess); - res = hipMemset(d_a, 0, sizeof(int)); - REQUIRE(res == hipSuccess); - res = hipFree(d_a); - REQUIRE(res == hipSuccess); -} - -TEST_CASE("Unit_hipMemset_4bytes_hostMem") { - int* d_a; - auto res = hipHostMalloc(&d_a, sizeof(int), 0); - REQUIRE(res == hipSuccess); - res = hipMemset(d_a, 0, sizeof(int)); - REQUIRE(res == hipSuccess); - res = hipHostFree(d_a); - REQUIRE(res == hipSuccess); -} diff --git a/catch/unit/memory/hipMemsetD16.cc b/catch/unit/memory/hipMemsetD16.cc index b6bb4ae5d..51357c65c 100644 --- a/catch/unit/memory/hipMemsetD16.cc +++ b/catch/unit/memory/hipMemsetD16.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -105,7 +92,7 @@ static bool testMemset(allocator_fn_t allocator, deallocator_fn_t deallocator) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD16_ValidBuffer") { +TEST_CASE(Unit_hipMemsetD16_ValidBuffer) { SECTION("Device Buffer") { bool result = testMemset(hipMalloc, hipFree); @@ -133,7 +120,7 @@ TEST_CASE("Unit_hipMemsetD16_ValidBuffer") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD16_InvalidArg") { +TEST_CASE(Unit_hipMemsetD16_InvalidArg) { constexpr size_t ptr_test_nelem = 4096; void* ptr = nullptr; @@ -161,7 +148,7 @@ TEST_CASE("Unit_hipMemsetD16_InvalidArg") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD16_KernelBuffer") { +TEST_CASE(Unit_hipMemsetD16_KernelBuffer) { constexpr size_t ptr_test_nelem = 4096; constexpr unsigned blocksPerCU = 6; constexpr unsigned threadsPerBlock = 256; @@ -214,7 +201,7 @@ TEST_CASE("Unit_hipMemsetD16_Capture") { hipError_t memcpy_err = hipSuccess; BEGIN_CAPTURE_SYNC(memcpy_err, false); - HIP_CHECK_ERROR(hipMemsetD16(dst, 0xAB, N), memcpy_err); + HIP_CHECK_ERROR(hipMemsetD16(reinterpret_cast(dst), 0xAB, N), memcpy_err); END_CAPTURE_SYNC(memcpy_err); HIP_CHECK(hipFree(dst)); diff --git a/catch/unit/memory/hipMemsetD16Async.cc b/catch/unit/memory/hipMemsetD16Async.cc index fb5781927..98c42901c 100644 --- a/catch/unit/memory/hipMemsetD16Async.cc +++ b/catch/unit/memory/hipMemsetD16Async.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -113,7 +100,7 @@ static bool testMemset(allocator_fn_t allocator, deallocator_fn_t deallocator) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD16Async_ValidBuffer") { +TEST_CASE(Unit_hipMemsetD16Async_ValidBuffer) { SECTION("Device Buffer") { bool result = testMemset(hipMalloc, hipFree); @@ -141,7 +128,7 @@ TEST_CASE("Unit_hipMemsetD16Async_ValidBuffer") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD16Async_InvalidArg") { +TEST_CASE(Unit_hipMemsetD16Async_InvalidArg) { constexpr size_t ptr_test_nelem = 4096; void* ptr = nullptr; @@ -169,7 +156,7 @@ TEST_CASE("Unit_hipMemsetD16Async_InvalidArg") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD16Async_KernelBuffer") { +TEST_CASE(Unit_hipMemsetD16Async_KernelBuffer) { constexpr size_t ptr_test_nelem = 4096; constexpr unsigned blocksPerCU = 6; constexpr unsigned threadsPerBlock = 256; diff --git a/catch/unit/memory/hipMemsetD2D16.cc b/catch/unit/memory/hipMemsetD2D16.cc index 17f0ec8fc..86ae2b2b2 100644 --- a/catch/unit/memory/hipMemsetD2D16.cc +++ b/catch/unit/memory/hipMemsetD2D16.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -42,7 +30,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D16_BasicFunctional") { +TEST_CASE(Unit_hipMemsetD2D16_BasicFunctional) { constexpr uint16_t memsetval = static_cast(0xDEADBEEF); constexpr size_t numH = 256; constexpr size_t numW = 256; @@ -78,7 +66,7 @@ TEST_CASE("Unit_hipMemsetD2D16_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D16_UnEvenRowsCols") { +TEST_CASE(Unit_hipMemsetD2D16_UnEvenRowsCols) { hipDeviceptr_t A_d; constexpr uint16_t memsetVal = 5; int rows, cols; @@ -116,7 +104,7 @@ TEST_CASE("Unit_hipMemsetD2D16_UnEvenRowsCols") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D16_NegTsts") { +TEST_CASE(Unit_hipMemsetD2D16_NegTsts) { hipDeviceptr_t A_d; constexpr size_t numH = 256; constexpr size_t numW = 256; diff --git a/catch/unit/memory/hipMemsetD2D16Async.cc b/catch/unit/memory/hipMemsetD2D16Async.cc index a3da1247d..f2406cada 100644 --- a/catch/unit/memory/hipMemsetD2D16Async.cc +++ b/catch/unit/memory/hipMemsetD2D16Async.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -42,7 +30,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D16Async_BasicFunctional") { +TEST_CASE(Unit_hipMemsetD2D16Async_BasicFunctional) { constexpr int memsetval = 0x24; constexpr size_t numH = 256; constexpr size_t numW = 256; @@ -83,7 +71,7 @@ TEST_CASE("Unit_hipMemsetD2D16Async_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D16Async_UnEvenRowsCols") { +TEST_CASE(Unit_hipMemsetD2D16Async_UnEvenRowsCols) { hipDeviceptr_t A_d; int rows, cols; constexpr int memsetval = 5; @@ -123,7 +111,7 @@ TEST_CASE("Unit_hipMemsetD2D16Async_UnEvenRowsCols") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D16Async_NegTsts") { +TEST_CASE(Unit_hipMemsetD2D16Async_NegTsts) { hipDeviceptr_t A_d; constexpr size_t numH = 256; constexpr size_t numW = 256; diff --git a/catch/unit/memory/hipMemsetD2D32.cc b/catch/unit/memory/hipMemsetD2D32.cc index 36de34055..b1371feb8 100644 --- a/catch/unit/memory/hipMemsetD2D32.cc +++ b/catch/unit/memory/hipMemsetD2D32.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -42,7 +30,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D32_BasicFunctional") { +TEST_CASE(Unit_hipMemsetD2D32_BasicFunctional) { constexpr int memsetval = 15; constexpr size_t numH = 256; constexpr size_t numW = 256; @@ -77,7 +65,7 @@ TEST_CASE("Unit_hipMemsetD2D32_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D32_UnEvenRowsCols") { +TEST_CASE(Unit_hipMemsetD2D32_UnEvenRowsCols) { constexpr int memsetval = 5; hipDeviceptr_t A_d; int rows, cols; @@ -114,7 +102,7 @@ TEST_CASE("Unit_hipMemsetD2D32_UnEvenRowsCols") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D32_NegTsts") { +TEST_CASE(Unit_hipMemsetD2D32_NegTsts) { hipDeviceptr_t A_d; constexpr size_t numH = 256; constexpr size_t numW = 256; diff --git a/catch/unit/memory/hipMemsetD2D32Async.cc b/catch/unit/memory/hipMemsetD2D32Async.cc index 4de90d4dd..0365b8a4a 100644 --- a/catch/unit/memory/hipMemsetD2D32Async.cc +++ b/catch/unit/memory/hipMemsetD2D32Async.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -42,7 +30,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D32Async_BasicFunctional") { +TEST_CASE(Unit_hipMemsetD2D32Async_BasicFunctional) { constexpr int memsetval = 0x24; constexpr size_t numH = 256; constexpr size_t numW = 256; @@ -79,7 +67,7 @@ TEST_CASE("Unit_hipMemsetD2D32Async_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D32Async_UnEvenRowsCols") { +TEST_CASE(Unit_hipMemsetD2D32Async_UnEvenRowsCols) { constexpr int memsetval = 5; hipDeviceptr_t A_d; int rows, cols; @@ -120,7 +108,7 @@ TEST_CASE("Unit_hipMemsetD2D32Async_UnEvenRowsCols") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D32Async_NegTsts") { +TEST_CASE(Unit_hipMemsetD2D32Async_NegTsts) { hipDeviceptr_t A_d; constexpr size_t numH = 256; constexpr size_t numW = 256; diff --git a/catch/unit/memory/hipMemsetD2D8.cc b/catch/unit/memory/hipMemsetD2D8.cc index 9c739079a..067b78ef8 100644 --- a/catch/unit/memory/hipMemsetD2D8.cc +++ b/catch/unit/memory/hipMemsetD2D8.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -41,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D8_BasicFunctional") { +TEST_CASE(Unit_hipMemsetD2D8_BasicFunctional) { constexpr char memsetval = 'c'; constexpr size_t numH = 256; constexpr size_t numW = 256; @@ -75,7 +63,7 @@ TEST_CASE("Unit_hipMemsetD2D8_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D8_UnEvenRowsCols") { +TEST_CASE(Unit_hipMemsetD2D8_UnEvenRowsCols) { hipDeviceptr_t A_d; int rows, cols; rows = GENERATE(3, 4, 100); @@ -115,7 +103,7 @@ TEST_CASE("Unit_hipMemsetD2D8_UnEvenRowsCols") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D8_NegTsts") { +TEST_CASE(Unit_hipMemsetD2D8_NegTsts) { hipDeviceptr_t A_d; constexpr size_t numH = 256; constexpr size_t numW = 256; diff --git a/catch/unit/memory/hipMemsetD2D8Async.cc b/catch/unit/memory/hipMemsetD2D8Async.cc index 4bc6e09e0..7c8f4367c 100644 --- a/catch/unit/memory/hipMemsetD2D8Async.cc +++ b/catch/unit/memory/hipMemsetD2D8Async.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -43,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D8Async_BasicFunctional") { +TEST_CASE(Unit_hipMemsetD2D8Async_BasicFunctional) { constexpr char memsetval = 'c'; constexpr size_t numH = 256; constexpr size_t numW = 256; @@ -82,7 +70,7 @@ TEST_CASE("Unit_hipMemsetD2D8Async_BasicFunctional") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D8Async_UnEvenRowsCols") { +TEST_CASE(Unit_hipMemsetD2D8Async_UnEvenRowsCols) { hipDeviceptr_t A_d; int rows, cols; rows = GENERATE(3, 4, 100); @@ -125,7 +113,7 @@ TEST_CASE("Unit_hipMemsetD2D8Async_UnEvenRowsCols") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipMemsetD2D8Async_NegTsts") { +TEST_CASE(Unit_hipMemsetD2D8Async_NegTsts) { hipDeviceptr_t A_d; constexpr size_t numH = 256; constexpr size_t numW = 256; diff --git a/catch/unit/memory/hipMemsetD32.cc b/catch/unit/memory/hipMemsetD32.cc index aa71d87c5..7c5664426 100644 --- a/catch/unit/memory/hipMemsetD32.cc +++ b/catch/unit/memory/hipMemsetD32.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -105,7 +92,7 @@ static bool testMemset(allocator_fn_t allocator, deallocator_fn_t deallocator) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD32_ValidBuffer") { +TEST_CASE(Unit_hipMemsetD32_ValidBuffer) { SECTION("Device Buffer") { bool result = testMemset(hipMalloc, hipFree); @@ -133,7 +120,7 @@ TEST_CASE("Unit_hipMemsetD32_ValidBuffer") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD32_InvalidArg") { +TEST_CASE(Unit_hipMemsetD32_InvalidArg) { constexpr size_t ptr_test_nelem = 4096; void* ptr = nullptr; @@ -161,7 +148,7 @@ TEST_CASE("Unit_hipMemsetD32_InvalidArg") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD32_KernelBuffer") { +TEST_CASE(Unit_hipMemsetD32_KernelBuffer) { constexpr size_t ptr_test_nelem = 4096; constexpr unsigned blocksPerCU = 6; constexpr unsigned threadsPerBlock = 256; @@ -214,7 +201,7 @@ TEST_CASE("Unit_hipMemsetD32_Capture") { hipError_t memcpy_err = hipSuccess; BEGIN_CAPTURE_SYNC(memcpy_err, false); - HIP_CHECK_ERROR(hipMemsetD32(dst, 0xAB, N), memcpy_err); + HIP_CHECK_ERROR(hipMemsetD32(reinterpret_cast(dst), 0xAB, N), memcpy_err); END_CAPTURE_SYNC(memcpy_err); HIP_CHECK(hipFree(dst)); diff --git a/catch/unit/memory/hipMemsetD32Async.cc b/catch/unit/memory/hipMemsetD32Async.cc index cdfb56bd0..17b72afc7 100644 --- a/catch/unit/memory/hipMemsetD32Async.cc +++ b/catch/unit/memory/hipMemsetD32Async.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -113,7 +100,7 @@ static bool testMemset(allocator_fn_t allocator, deallocator_fn_t deallocator) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD32Async_ValidBuffer") { +TEST_CASE(Unit_hipMemsetD32Async_ValidBuffer) { SECTION("Device Buffer") { bool result = testMemset(hipMalloc, hipFree); @@ -141,7 +128,7 @@ TEST_CASE("Unit_hipMemsetD32Async_ValidBuffer") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD32Async_InvalidArg") { +TEST_CASE(Unit_hipMemsetD32Async_InvalidArg) { constexpr size_t ptr_test_nelem = 4096; void* ptr = nullptr; @@ -169,7 +156,7 @@ TEST_CASE("Unit_hipMemsetD32Async_InvalidArg") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD32Async_KernelBuffer") { +TEST_CASE(Unit_hipMemsetD32Async_KernelBuffer) { constexpr size_t ptr_test_nelem = 4096; constexpr unsigned blocksPerCU = 6; constexpr unsigned threadsPerBlock = 256; diff --git a/catch/unit/memory/hipMemsetD8Async.cc b/catch/unit/memory/hipMemsetD8Async.cc index 7d5c66006..abe8e78a0 100644 --- a/catch/unit/memory/hipMemsetD8Async.cc +++ b/catch/unit/memory/hipMemsetD8Async.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -113,7 +100,7 @@ static bool testMemset(allocator_fn_t allocator, deallocator_fn_t deallocator) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD8Async_ValidBuffer") { +TEST_CASE(Unit_hipMemsetD8Async_ValidBuffer) { SECTION("Device Buffer") { bool result = testMemset(hipMalloc, hipFree); @@ -141,7 +128,7 @@ TEST_CASE("Unit_hipMemsetD8Async_ValidBuffer") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD8Async_InvalidArg") { +TEST_CASE(Unit_hipMemsetD8Async_InvalidArg) { constexpr size_t ptr_test_nelem = 4096; void* ptr = nullptr; @@ -169,7 +156,7 @@ TEST_CASE("Unit_hipMemsetD8Async_InvalidArg") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemsetD8Async_KernelBuffer") { +TEST_CASE(Unit_hipMemsetD8Async_KernelBuffer) { constexpr size_t ptr_test_nelem = 4096; constexpr unsigned blocksPerCU = 6; constexpr unsigned threadsPerBlock = 256; diff --git a/catch/unit/memory/hipMemsetFunctional.cc b/catch/unit/memory/hipMemsetFunctional.cc index 9aefa3805..5e17564be 100644 --- a/catch/unit/memory/hipMemsetFunctional.cc +++ b/catch/unit/memory/hipMemsetFunctional.cc @@ -1,20 +1,7 @@ /* - * 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ /** @@ -148,9 +135,9 @@ void checkMemset(T value, size_t count, MemsetType memsetType, bool async = fals // Macro which defines a TEST_CASE which calls and then checks the result of the 1D memset macros // for all combinations of sync/async and hipMalloc/hipHostMalloc, given the value and memory range. -#define DEFINE_1D_BASIC_TEST_CASE(suffix, memsetType, T, value, count) \ - TEST_CASE("Unit_hipMemsetFunctional_" + std::string(suffix)) { \ - const std::string memsetStr = std::string(suffix); \ +#define DEFINE_1D_BASIC_TEST(suffix, memsetType, T, value, count) \ + TEST_CASE(Unit_hipMemsetFunctional_##suffix) { \ + const std::string memsetStr = std::string(#suffix); \ SECTION(memsetStr + " - Device Malloc") { \ checkMemset(static_cast(value), count, memsetType, false, hipDeviceMalloc_t); \ } \ @@ -165,20 +152,20 @@ void checkMemset(T value, size_t count, MemsetType memsetType, bool async = fals } \ } -DEFINE_1D_BASIC_TEST_CASE("ZeroValue_hipMemset", hipMemsetTypeDefault, float, 0, 1024) -DEFINE_1D_BASIC_TEST_CASE("ZeroValue_hipMemsetD32", hipMemsetTypeD32, uint32_t, 0, 1024) -DEFINE_1D_BASIC_TEST_CASE("ZeroValue_hipMemsetD16", hipMemsetTypeD16, int16_t, 0, 1024) -DEFINE_1D_BASIC_TEST_CASE("ZeroValue_hipMemsetD8", hipMemsetTypeD8, int8_t, 0, 1024) +DEFINE_1D_BASIC_TEST(ZeroValue_hipMemset, hipMemsetTypeDefault, float, 0, 1024) +DEFINE_1D_BASIC_TEST(ZeroValue_hipMemsetD32, hipMemsetTypeD32, uint32_t, 0, 1024) +DEFINE_1D_BASIC_TEST(ZeroValue_hipMemsetD16, hipMemsetTypeD16, int16_t, 0, 1024) +DEFINE_1D_BASIC_TEST(ZeroValue_hipMemsetD8, hipMemsetTypeD8, int8_t, 0, 1024) -DEFINE_1D_BASIC_TEST_CASE("SmallSize_hipMemset", hipMemsetTypeDefault, char, 0x42, 1) -DEFINE_1D_BASIC_TEST_CASE("SmallSize_hipMemsetD32", hipMemsetTypeD32, uint32_t, 0x101, 1) -DEFINE_1D_BASIC_TEST_CASE("SmallSize_hipMemsetD16", hipMemsetTypeD16, int16_t, 0x10, 1) -DEFINE_1D_BASIC_TEST_CASE("SmallSize_hipMemsetD8", hipMemsetTypeD8, int8_t, 0x1, 1) +DEFINE_1D_BASIC_TEST(SmallSize_hipMemset, hipMemsetTypeDefault, char, 0x42, 1) +DEFINE_1D_BASIC_TEST(SmallSize_hipMemsetD32, hipMemsetTypeD32, uint32_t, 0x101, 1) +DEFINE_1D_BASIC_TEST(SmallSize_hipMemsetD16, hipMemsetTypeD16, int16_t, 0x10, 1) +DEFINE_1D_BASIC_TEST(SmallSize_hipMemsetD8, hipMemsetTypeD8, int8_t, 0x1, 1) -DEFINE_1D_BASIC_TEST_CASE("ZeroSize_hipMemset", hipMemsetTypeDefault, char, 0x42, 0) -DEFINE_1D_BASIC_TEST_CASE("ZeroSize_hipMemsetD32", hipMemsetTypeD32, uint32_t, 0x101, 0) -DEFINE_1D_BASIC_TEST_CASE("ZeroSize_hipMemsetD16", hipMemsetTypeD16, int16_t, 0x10, 0) -DEFINE_1D_BASIC_TEST_CASE("ZeroSize_hipMemsetD8", hipMemsetTypeD8, int8_t, 0x1, 0) +DEFINE_1D_BASIC_TEST(ZeroSize_hipMemset, hipMemsetTypeDefault, char, 0x42, 0) +DEFINE_1D_BASIC_TEST(ZeroSize_hipMemsetD32, hipMemsetTypeD32, uint32_t, 0x101, 0) +DEFINE_1D_BASIC_TEST(ZeroSize_hipMemsetD16, hipMemsetTypeD16, int16_t, 0x10, 0) +DEFINE_1D_BASIC_TEST(ZeroSize_hipMemsetD8, hipMemsetTypeD8, int8_t, 0x1, 0) // Helper function that sets a full region of memory with an initial value, sets a smaller subregion // with another value and check that the memset API do not write outside of the subregion of data. @@ -201,7 +188,7 @@ template void partialMemsetTest(T valA, T valB, size_t count, size_ HIP_CHECK(hipFree(devPtr)); } -TEST_CASE("Unit_hipMemsetFunctional_PartialSet_1D") { +TEST_CASE(Unit_hipMemsetFunctional_PartialSet_1D) { auto widthOffset = GENERATE(8, 16, 32, 64, 128, 256, 512, 1024); SECTION("hipMemset - Partial Set") { partialMemsetTest(0x1, 0x42, 1024, widthOffset, hipMemsetTypeDefault, false); @@ -278,7 +265,7 @@ template void checkMemset2D(T value, size_t width, size_t height, b HIP_CHECK(hipStreamDestroy(stream)); } -TEST_CASE("Unit_hipMemsetFunctional_ZeroValue_2D") { +TEST_CASE(Unit_hipMemsetFunctional_ZeroValue_2D) { CHECK_IMAGE_SUPPORT constexpr size_t width{128}; @@ -288,7 +275,7 @@ TEST_CASE("Unit_hipMemsetFunctional_ZeroValue_2D") { SECTION("hipMemset2DAsync - Zero Value") { checkMemset2D(memsetVal, width, height, true); } } -TEST_CASE("Unit_hipMemsetFunctional_SmallSize_2D") { +TEST_CASE(Unit_hipMemsetFunctional_SmallSize_2D) { CHECK_IMAGE_SUPPORT constexpr char memsetVal = 0x42; @@ -296,7 +283,7 @@ TEST_CASE("Unit_hipMemsetFunctional_SmallSize_2D") { SECTION("hipMemset2DAsync - Small Size") { checkMemset2D(memsetVal, 1, 1, true); } } -TEST_CASE("Unit_hipMemsetFunctional_ZeroSize_2D") { +TEST_CASE(Unit_hipMemsetFunctional_ZeroSize_2D) { CHECK_IMAGE_SUPPORT size_t pitch{0}; @@ -378,7 +365,7 @@ template void partialMemsetTest2D(T valA, T valB, size_t width, siz HIP_CHECK(hipFree(devPtr)); } -TEST_CASE("Unit_hipMemsetFunctional_PartialSet_2D") { +TEST_CASE(Unit_hipMemsetFunctional_PartialSet_2D) { CHECK_IMAGE_SUPPORT for (auto widthOffset = 8; widthOffset <= 128; widthOffset *= 2) { @@ -492,19 +479,19 @@ void check_memset_3D(std::string sectionStr, size_t width, size_t height, size_t } } -TEST_CASE("Unit_hipMemsetFunctional_ZeroValue_3D") { +TEST_CASE(Unit_hipMemsetFunctional_ZeroValue_3D) { CHECK_IMAGE_SUPPORT check_memset_3D("Zero Value", 128, 128, 10, 0); } -TEST_CASE("Unit_hipMemsetFunctional_SmallSize_3D") { +TEST_CASE(Unit_hipMemsetFunctional_SmallSize_3D) { CHECK_IMAGE_SUPPORT check_memset_3D("Small Size", 1, 1, 1, 0x42); } -TEST_CASE("Unit_hipMemsetFunctional_ZeroSize_3D") { +TEST_CASE(Unit_hipMemsetFunctional_ZeroSize_3D) { CHECK_IMAGE_SUPPORT constexpr size_t elementSize = sizeof(char); @@ -560,7 +547,7 @@ void partialMemsetTest3D(T valA, T valB, size_t width, size_t height, size_t dep HIP_CHECK(hipFree(devPitchedPtr.ptr)); } -TEST_CASE("Unit_hipMemsetFunctional_PartialSet_3D") { +TEST_CASE(Unit_hipMemsetFunctional_PartialSet_3D) { CHECK_IMAGE_SUPPORT for (auto widthOffset = 8; widthOffset <= 128; widthOffset *= 2) { diff --git a/catch/unit/memory/hipMemsetNegative.cc b/catch/unit/memory/hipMemsetNegative.cc index 4184e313d..0994030ee 100644 --- a/catch/unit/memory/hipMemsetNegative.cc +++ b/catch/unit/memory/hipMemsetNegative.cc @@ -1,20 +1,7 @@ /* - * 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include @@ -54,7 +41,7 @@ inline void testHipMemset3DApis(hipPitchedPtr& pitchedDevPtr, int value, const h HIP_CHECK_ERROR(hipMemset3DAsync(pitchedDevPtr, value, extent, nullStream), expectedReturn); } -TEST_CASE("Unit_hipMemset_Negative_InvalidPtr") { +TEST_CASE(Unit_hipMemset_Negative_InvalidPtr) { void* dst; SECTION("Uninitialized Dst") {} @@ -70,7 +57,7 @@ TEST_CASE("Unit_hipMemset_Negative_InvalidPtr") { } -TEST_CASE("Unit_hipMemset_Negative_OutOfBoundsSize") { +TEST_CASE(Unit_hipMemset_Negative_OutOfBoundsSize) { #if !HT_AMD void* dst; constexpr size_t outOfBoundsSize{width + 1}; @@ -81,7 +68,7 @@ TEST_CASE("Unit_hipMemset_Negative_OutOfBoundsSize") { #endif } -TEST_CASE("Unit_hipMemset_Negative_OutOfBoundsPtr") { +TEST_CASE(Unit_hipMemset_Negative_OutOfBoundsPtr) { void* dst; HIP_CHECK(hipMalloc(&dst, width)); void* outOfBoundsPtr{reinterpret_cast(dst) + width + 1}; @@ -89,7 +76,7 @@ TEST_CASE("Unit_hipMemset_Negative_OutOfBoundsPtr") { HIP_CHECK(hipFree(dst)); } -TEST_CASE("Unit_hipMemset2D_Negative_InvalidPtr") { +TEST_CASE(Unit_hipMemset2D_Negative_InvalidPtr) { CHECK_IMAGE_SUPPORT void* dst; @@ -109,7 +96,7 @@ TEST_CASE("Unit_hipMemset2D_Negative_InvalidPtr") { HIP_CHECK(hipFree(A_d)); } -TEST_CASE("Unit_hipMemset2D_Negative_InvalidSizes") { +TEST_CASE(Unit_hipMemset2D_Negative_InvalidSizes) { CHECK_IMAGE_SUPPORT void* dst; @@ -135,7 +122,7 @@ TEST_CASE("Unit_hipMemset2D_Negative_InvalidSizes") { HIP_CHECK(hipFree(dst)); } -TEST_CASE("Unit_hipMemset2D_Negative_OutOfBoundsPtr") { +TEST_CASE(Unit_hipMemset2D_Negative_OutOfBoundsPtr) { CHECK_IMAGE_SUPPORT void* dst; @@ -148,7 +135,7 @@ TEST_CASE("Unit_hipMemset2D_Negative_OutOfBoundsPtr") { } -TEST_CASE("Unit_hipMemset3D_Negative_InvalidPtr") { +TEST_CASE(Unit_hipMemset3D_Negative_InvalidPtr) { CHECK_IMAGE_SUPPORT hipPitchedPtr pitchedDevPtr; @@ -159,7 +146,7 @@ TEST_CASE("Unit_hipMemset3D_Negative_InvalidPtr") { testHipMemset3DApis(pitchedDevPtr, memsetVal, validExtent); } -TEST_CASE("Unit_hipMemset3D_Negative_ModifiedPtr") { +TEST_CASE(Unit_hipMemset3D_Negative_ModifiedPtr) { CHECK_IMAGE_SUPPORT hipPitchedPtr pitchedDevPtr; @@ -182,7 +169,7 @@ TEST_CASE("Unit_hipMemset3D_Negative_ModifiedPtr") { HIP_CHECK(hipFree(allocatedMemory)); } -TEST_CASE("Unit_hipMemset3D_Negative_InvalidSizes") { +TEST_CASE(Unit_hipMemset3D_Negative_InvalidSizes) { CHECK_IMAGE_SUPPORT hipPitchedPtr pitchedDevPtr; @@ -210,7 +197,7 @@ TEST_CASE("Unit_hipMemset3D_Negative_InvalidSizes") { HIP_CHECK(hipFree(pitchedDevPtr.ptr)); } -TEST_CASE("Unit_hipMemset3D_Negative_OutOfBounds") { +TEST_CASE(Unit_hipMemset3D_Negative_OutOfBounds) { CHECK_IMAGE_SUPPORT hipPitchedPtr pitchedDevPtr; diff --git a/catch/unit/memory/hipMemsetSync.cc b/catch/unit/memory/hipMemsetSync.cc index 4d0e46530..0669a8d0f 100644 --- a/catch/unit/memory/hipMemsetSync.cc +++ b/catch/unit/memory/hipMemsetSync.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. - -Permission is hereby granted, free of intge, 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -439,7 +423,7 @@ static void doMemsetTest(allocType mallocType, memSetType memset_type, MultiDDat if (streamType == CREATEDSTR) HIP_CHECK(hipStreamDestroy(stream)); } -TEST_CASE("Unit_hipMemsetSync") { +TEST_CASE(Unit_hipMemsetSync) { allocType type = GENERATE(allocType::deviceMalloc, allocType::hostMalloc, allocType::hostRegisted, allocType::devRegistered); memSetType memset_type = memSetType::hipMemset; @@ -448,7 +432,7 @@ TEST_CASE("Unit_hipMemsetSync") { doMemsetTest(type, memset_type, data); } -TEMPLATE_TEST_CASE("Unit_hipMemsetDSync", "", int8_t, int16_t, uint32_t) { +TEMPLATE_TEST_CASE(Unit_hipMemsetDSync, int8_t, int16_t, uint32_t) { allocType mallocType = GENERATE(allocType::hostRegisted, allocType::deviceMalloc, allocType::hostMalloc, allocType::devRegistered); memSetType memset_type; @@ -466,7 +450,7 @@ TEMPLATE_TEST_CASE("Unit_hipMemsetDSync", "", int8_t, int16_t, uint32_t) { doMemsetTest(mallocType, memset_type, data); } -TEST_CASE("Unit_hipMemset2DSync") { +TEST_CASE(Unit_hipMemset2DSync) { allocType mallocType = GENERATE(allocType::deviceMalloc, allocType::hostMalloc, allocType::hostRegisted, allocType::devRegistered); memSetType memset_type = memSetType::hipMemset2D; @@ -477,7 +461,7 @@ TEST_CASE("Unit_hipMemset2DSync") { doMemsetTest(mallocType, memset_type, data); } -TEST_CASE("Unit_hipMemset3DSync") { +TEST_CASE(Unit_hipMemset3DSync) { allocType mallocType = GENERATE(allocType::deviceMalloc, allocType::hostMalloc, allocType::hostRegisted, allocType::devRegistered); memSetType memset_type = memSetType::hipMemset3D; diff --git a/catch/unit/memory/hipPointerGetAttribute.cc b/catch/unit/memory/hipPointerGetAttribute.cc index eb1c8c202..b316a1bd8 100644 --- a/catch/unit/memory/hipPointerGetAttribute.cc +++ b/catch/unit/memory/hipPointerGetAttribute.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Added Negative and Functional tests for hipPointerGetAttribute API @@ -69,7 +57,7 @@ static __global__ void var_update(int* data) { /* Allocate memory using different Allocation APIs and check whether correct memory type and device oridinal are returned */ -TEST_CASE("Unit_hipPointerGetAttribute_MemoryTypes") { +TEST_CASE(Unit_hipPointerGetAttribute_MemoryTypes) { CHECK_IMAGE_SUPPORT HIP_CHECK(hipSetDevice(0)); @@ -121,7 +109,7 @@ TEST_CASE("Unit_hipPointerGetAttribute_MemoryTypes") { * Validates the device variable to check whether the * data is updated or not. */ -TEST_CASE("Unit_hipPointerGetAttribute_KernelUpdation") { +TEST_CASE(Unit_hipPointerGetAttribute_KernelUpdation) { HIP_CHECK(hipSetDevice(0)); size_t Nbytes = 0; Nbytes = N * sizeof(int); @@ -150,7 +138,7 @@ TEST_CASE("Unit_hipPointerGetAttribute_KernelUpdation") { * from peer GPU device.It validates the memory type and * device ordinal in peer GPU */ -TEST_CASE("Unit_hipPointerGetAttribute_PeerGPU", "[multigpu]") { +TEST_CASE(Unit_hipPointerGetAttribute_PeerGPU) { HIP_CHECK(hipSetDevice(0)); size_t Nbytes = 0; Nbytes = N * sizeof(int); @@ -185,7 +173,7 @@ TEST_CASE("Unit_hipPointerGetAttribute_PeerGPU", "[multigpu]") { hipPointerGetAttribute API with HIP_POINTER_ATTRIBUTE_BUFFER_ID, DeAllocate and Allocate the memory again and ensure that the buffer ID is unique */ -TEST_CASE("Unit_hipPointerGetAttribute_BufferID") { +TEST_CASE(Unit_hipPointerGetAttribute_BufferID) { HIP_CHECK(hipSetDevice(0)); size_t Nbytes = 0; Nbytes = N * sizeof(int); @@ -207,7 +195,7 @@ TEST_CASE("Unit_hipPointerGetAttribute_BufferID") { and ensure that it matches with CUDA result */ #if HT_AMD -TEST_CASE("Unit_hipPointerGetAttribute_HostDeviceOrdinal") { +TEST_CASE(Unit_hipPointerGetAttribute_HostDeviceOrdinal) { size_t Nbytes = 0; Nbytes = N * sizeof(int); int* A_h; @@ -227,7 +215,7 @@ TEST_CASE("Unit_hipPointerGetAttribute_HostDeviceOrdinal") { /* Allocate managed memory with different flags and trigger hipPointerGetAttribute with the following flags HIP_POINTER_ATTRIBUTE_MAPPED and verify the behaviour */ -TEST_CASE("Unit_hipPointerGetAttribute_MappedMem") { +TEST_CASE(Unit_hipPointerGetAttribute_MappedMem) { HIP_CHECK(hipSetDevice(0)); size_t Nbytes = 0; Nbytes = N * sizeof(int); @@ -256,7 +244,7 @@ TEST_CASE("Unit_hipPointerGetAttribute_MappedMem") { } /* This testcase verifies negative scenarios of hipPointerGetAttribute API */ -TEST_CASE("Unit_hipPointerGetAttribute_Negative") { +TEST_CASE(Unit_hipPointerGetAttribute_Negative) { HIP_CHECK(hipSetDevice(0)); size_t Nbytes = 0; constexpr size_t N{100}; @@ -334,7 +322,7 @@ TEST_CASE("Unit_hipPointerGetAttribute_Negative") { /* Allocate memory using different Allocation APIs and check whether IPC CAPABLE attribute returns correctly */ -TEST_CASE("Unit_hipPointerGetAttribute_ipc_capable") { +TEST_CASE(Unit_hipPointerGetAttribute_ipc_capable) { HIP_CHECK(hipSetDevice(0)); size_t Nbytes = N * sizeof(int); diff --git a/catch/unit/memory/hipPointerGetAttributes.cc b/catch/unit/memory/hipPointerGetAttributes.cc index 792ff0f6a..e207d5c64 100644 --- a/catch/unit/memory/hipPointerGetAttributes.cc +++ b/catch/unit/memory/hipPointerGetAttributes.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2021-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Following scenarios are verified for hipPointerGetAttributes API @@ -225,7 +209,7 @@ void clusterAllocs(int numAllocs, size_t minSize, size_t maxSize) { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipPointerGetAttributes_Basic") { +TEST_CASE(Unit_hipPointerGetAttributes_Basic) { HIP_CHECK(hipSetDevice(0)); Nbytes = N * sizeof(char); printf("\n"); @@ -310,7 +294,7 @@ TEST_CASE("Unit_hipPointerGetAttributes_Basic") { * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipPointerGetAttributes_ClusterAlloc", "[multigpu]") { +TEST_CASE(Unit_hipPointerGetAttributes_ClusterAlloc) { srand(0x100); printf("\n=============================================\n"); clusterAllocs(100, 1024 * 1, 1024 * 1024); @@ -327,7 +311,7 @@ TEST_CASE("Unit_hipPointerGetAttributes_ClusterAlloc", "[multigpu]") { * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipPointerGetAttributes_TinyClusterAlloc", "[multigpu]") { +TEST_CASE(Unit_hipPointerGetAttributes_TinyClusterAlloc) { srand(0x200); printf("\n=============================================\n"); clusterAllocs(1000, 1, 10); // Many tiny allocations; @@ -337,7 +321,7 @@ TEST_CASE("Unit_hipPointerGetAttributes_TinyClusterAlloc", "[multigpu]") { // IN : serialize will force the test to run in serial fashion. #if 0 // FIXME_jatinx These need to be ported to HIP_CHECK_THREAD. Disabling it for now -TEST_CASE("Unit_hipPointerGetAttributes_MultiThread", "[multigpu]") { +TEST_CASE(Unit_hipPointerGetAttributes_MultiThread) { srand(0x300); auto serialize = 1; printf("\n=============================================\n"); @@ -370,7 +354,7 @@ TEST_CASE("Unit_hipPointerGetAttributes_MultiThread", "[multigpu]") { * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipPointerGetAttributes_Negative") { +TEST_CASE(Unit_hipPointerGetAttributes_Negative) { #if HT_AMD // Nvidia crashed in hipPointerGetAttributes on nullptr SECTION("Invalid Attributes Pointer") { int* dPtr{nullptr}; @@ -393,7 +377,7 @@ TEST_CASE("Unit_hipPointerGetAttributes_Negative") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipPointerGetAttributes_GpuIter", "[multigpu]") { +TEST_CASE(Unit_hipPointerGetAttributes_GpuIter) { int deviceCount{0}; HIP_CHECK(hipGetDeviceCount(&deviceCount)); REQUIRE(deviceCount != 0); @@ -453,8 +437,7 @@ TEST_CASE("Unit_hipPointerGetAttributes_GpuIter", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipPointerGetAttributes_GpuIter_Managed__Memory", - "[multigpu]") { +TEST_CASE(Unit_hipPointerGetAttributes_GpuIter_Managed__Memory) { int deviceCount{0}; HIP_CHECK(hipGetDeviceCount(&deviceCount)); REQUIRE(deviceCount != 0); @@ -491,8 +474,7 @@ TEST_CASE("Unit_hipPointerGetAttributes_GpuIter_Managed__Memory", * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipPointerGetAttributes_GpuIter_Unregistered_Memory", - "[multigpu]") { +TEST_CASE(Unit_hipPointerGetAttributes_GpuIter_Unregistered_Memory) { int deviceCount{0}; HIP_CHECK(hipGetDeviceCount(&deviceCount)); REQUIRE(deviceCount != 0); diff --git a/catch/unit/memory/hipPointerSetAttribute.cc b/catch/unit/memory/hipPointerSetAttribute.cc index b44035ae1..f4e108652 100644 --- a/catch/unit/memory/hipPointerSetAttribute.cc +++ b/catch/unit/memory/hipPointerSetAttribute.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipPointerSetAttribute hipPointerSetAttribute @@ -43,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipPointerSetAttribute_Positive_SyncMemops") { +TEST_CASE(Unit_hipPointerSetAttribute_Positive_SyncMemops) { LinearAllocGuard src(LinearAllocs::hipMalloc, 1024); LinearAllocGuard dst(LinearAllocs::hipMalloc, 1024); @@ -74,7 +58,7 @@ TEST_CASE("Unit_hipPointerSetAttribute_Positive_SyncMemops") { * ------------------------ * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipPointerSetAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipPointerSetAttribute_Negative_Parameters) { LinearAllocGuard mem(LinearAllocs::hipMalloc, 4); int value = 0; diff --git a/catch/unit/memory/hipPtrGetAttribute.cc b/catch/unit/memory/hipPtrGetAttribute.cc index 6698e1902..9e3a083ac 100644 --- a/catch/unit/memory/hipPtrGetAttribute.cc +++ b/catch/unit/memory/hipPtrGetAttribute.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Run through few sanity tests to verify different attributes of hipPointerGetAttribute @@ -29,7 +13,7 @@ THE SOFTWARE. #include // Run few simple cases including host pointer arithmetic: -TEST_CASE("Unit_hipPtrGetAttribute_Simple", "[multigpu]") { +TEST_CASE(Unit_hipPtrGetAttribute_Simple) { HIP_CHECK(hipSetDevice(0)); size_t Nbytes = 0; constexpr size_t N{1000000}; diff --git a/catch/unit/memory/hipSVMTestByteGranularity.cpp b/catch/unit/memory/hipSVMTestByteGranularity.cpp index 343a23550..53b720544 100644 --- a/catch/unit/memory/hipSVMTestByteGranularity.cpp +++ b/catch/unit/memory/hipSVMTestByteGranularity.cpp @@ -72,7 +72,7 @@ __global__ void sum_neighbor_locations(char* a, unsigned int num_devices, * - Fine grain access and atomics supported on devices * - HIP_VERSION >= 5.7 */ -TEST_CASE("test_svm_byte_granularity", "[multigpu]") { +TEST_CASE(test_svm_byte_granularity) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/memory/hipSVMTestFineGrainMemoryConsistency.cpp b/catch/unit/memory/hipSVMTestFineGrainMemoryConsistency.cpp index 0f7505873..3261c9dd6 100644 --- a/catch/unit/memory/hipSVMTestFineGrainMemoryConsistency.cpp +++ b/catch/unit/memory/hipSVMTestFineGrainMemoryConsistency.cpp @@ -227,7 +227,7 @@ void launch_kernels_and_verify(std::vector& streams, unsigned int n * - Fine grain access and atomics supported on devices and host * - HIP_VERSION >= 5.7 */ -TEST_CASE("test_svm_fine_grain_memory_consistency", "[multigpu]") { +TEST_CASE(test_svm_fine_grain_memory_consistency) { int num_devices = 0; HIP_CHECK(hipGetDeviceCount(&num_devices)); diff --git a/catch/unit/memory/hipSVMTestFineGrainSyncBuffers.cpp b/catch/unit/memory/hipSVMTestFineGrainSyncBuffers.cpp index 42f7100e6..e2afd4e40 100644 --- a/catch/unit/memory/hipSVMTestFineGrainSyncBuffers.cpp +++ b/catch/unit/memory/hipSVMTestFineGrainSyncBuffers.cpp @@ -71,7 +71,7 @@ void spawnAnalysisTask(int location) { printf("found target at location %d\n", l * - Fine grain access and atomics supported on device and host * - HIP_VERSION >= 5.7 */ -TEST_CASE("test_svm_fine_grain_sync_buffers") { +TEST_CASE(test_svm_fine_grain_sync_buffers) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/memory/hipSVMTestSharedAddressSpaceFineGrain.cpp b/catch/unit/memory/hipSVMTestSharedAddressSpaceFineGrain.cpp index d7fee9132..7cd728f2d 100644 --- a/catch/unit/memory/hipSVMTestSharedAddressSpaceFineGrain.cpp +++ b/catch/unit/memory/hipSVMTestSharedAddressSpaceFineGrain.cpp @@ -157,7 +157,7 @@ void verify_linked_lists_on_device(hipStream_t stream, Node* pNodes, unsigned in * - Fine grain access supported on devices and host * - HIP_VERSION >= 5.7 */ -TEST_CASE("test_svm_shared_address_space_fine_grain_buffers", "[multigpu]") { +TEST_CASE(test_svm_shared_address_space_fine_grain_buffers) { const unsigned int num_elements = 1024; int num_devices = 0; HIP_CHECK(hipGetDeviceCount(&num_devices)); @@ -247,7 +247,7 @@ TEST_CASE("test_svm_shared_address_space_fine_grain_buffers", "[multigpu]") { * - System fine grain access supported on devices * - HIP_VERSION >= 5.7 */ -TEST_CASE("test_svm_shared_address_space_fine_grain_system", "[multigpu]") { +TEST_CASE(test_svm_shared_address_space_fine_grain_system) { int num_devices = 0; HIP_CHECK(hipGetDeviceCount(&num_devices)); diff --git a/catch/unit/memory/hipStreamAttachMemAsync.cc b/catch/unit/memory/hipStreamAttachMemAsync.cc index d20667e3c..3112426a5 100644 --- a/catch/unit/memory/hipStreamAttachMemAsync.cc +++ b/catch/unit/memory/hipStreamAttachMemAsync.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,7 +10,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_Basic") { +TEST_CASE(Unit_hipStreamAttachMemAsync_Positive_Basic) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory is not supported"); return; @@ -40,7 +24,7 @@ TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_Basic") { HIP_CHECK(hipStreamSynchronize(stream.stream())); } -TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_Pageable") { +TEST_CASE(Unit_hipStreamAttachMemAsync_Positive_Pageable) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory is not supported"); return; @@ -61,7 +45,7 @@ TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_Pageable") { // CUDA docs: // If the cudaMemAttachGlobal flag is specified, the memory can be accessed by any stream on any // device. -TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_AttachGlobal", "[multigpu]") { +TEST_CASE(Unit_hipStreamAttachMemAsync_Positive_AttachGlobal) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory is not supported"); return; @@ -106,7 +90,7 @@ TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_AttachGlobal", "[multigpu]") { // If the cudaMemAttachHost flag is specified, the program makes a guarantee that it won't access // the memory on the device from any stream on a device that has a zero value for the device // attribute cudaDevAttrConcurrentManagedAccess. -TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_AttachHost") { +TEST_CASE(Unit_hipStreamAttachMemAsync_Positive_AttachHost) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory is not supported"); return; @@ -137,7 +121,7 @@ TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_AttachHost") { // If the cudaMemAttachSingle flag is specified and stream is associated with a device that has a // zero value for the device attribute cudaDevAttrConcurrentManagedAccess, the program makes a // guarantee that it will only access the memory on the device from stream. -TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_AttachSingle") { +TEST_CASE(Unit_hipStreamAttachMemAsync_Positive_AttachSingle) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory is not supported"); return; @@ -174,7 +158,7 @@ TEST_CASE("Unit_hipStreamAttachMemAsync_Positive_AttachSingle") { REQUIRE(*managed_single.ptr() == 128); } -TEST_CASE("Unit_hipStreamAttachMemAsync_Negative_Parameters") { +TEST_CASE(Unit_hipStreamAttachMemAsync_Negative_Parameters) { if (!DeviceAttributesSupport(0, hipDeviceAttributeManagedMemory)) { HipTest::HIP_SKIP_TEST("Managed memory is not supported"); return; diff --git a/catch/unit/memory/inlineVar.cc b/catch/unit/memory/inlineVar.cc index eac9e9d10..547177ff4 100644 --- a/catch/unit/memory/inlineVar.cc +++ b/catch/unit/memory/inlineVar.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ // This test verifies the usage of inline constant variable in different translation units // The inline variable is declared in MemUtils.hh, it is used in memoryCommon.cc where @@ -25,7 +12,7 @@ THE SOFTWARE. #include "memoryCommon.hh" using namespace mem_utils; -TEST_CASE("Unit_hipMemcpyToFromSymbol_GlobalConstVar") { +TEST_CASE(Unit_hipMemcpyToFromSymbol_GlobalConstVar) { int const initialValue = 10; set_value(initialValue); int const finalValue = get_value(); diff --git a/catch/unit/memory/malloc.cc b/catch/unit/memory/malloc.cc deleted file mode 100644 index f90a36c76..000000000 --- a/catch/unit/memory/malloc.cc +++ /dev/null @@ -1,17 +0,0 @@ -#include - -TEST_CASE("Unit_hipHostMalloc_4bytes") { - int* d_a; - auto res = hipHostMalloc(&d_a, sizeof(int), 0); - REQUIRE(res == hipSuccess); - res = hipHostFree(d_a); - REQUIRE(res == hipSuccess); -} - -TEST_CASE("Unit_hipMalloc_4bytes") { - int* d_a; - auto res = hipMalloc(&d_a, sizeof(int)); - REQUIRE(res == hipSuccess); - res = hipFree(d_a); - REQUIRE(res == hipSuccess); -} diff --git a/catch/unit/memory/memcpy2d_tests_common.hh b/catch/unit/memory/memcpy2d_tests_common.hh index 9654a9ea3..6c2dc2d3f 100644 --- a/catch/unit/memory/memcpy2d_tests_common.hh +++ b/catch/unit/memory/memcpy2d_tests_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/memory/memoryCommon.hh b/catch/unit/memory/memoryCommon.hh index b7cf75142..f9dd6531a 100644 --- a/catch/unit/memory/memoryCommon.hh +++ b/catch/unit/memory/memoryCommon.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/memory/mempool_common.hh b/catch/unit/memory/mempool_common.hh index 7e2e10275..cc6e16365 100644 --- a/catch/unit/memory/mempool_common.hh +++ b/catch/unit/memory/mempool_common.hh @@ -1,21 +1,9 @@ /* - Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR - IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + #pragma once #include diff --git a/catch/unit/module/CMakeLists.txt b/catch/unit/module/CMakeLists.txt index b5f7c2408..0ed59d0ba 100644 --- a/catch/unit/module/CMakeLists.txt +++ b/catch/unit/module/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(TEST_SRC @@ -38,76 +22,135 @@ set(TEST_SRC hipModuleLoadFatBinary.cc ) -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} +if (HIP_PLATFORM MATCHES "amd") + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/get_function_module.cc -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -o get_function_module.code DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/get_function_module.cc) +else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/get_function_module.cc + -I${HIP_INCLUDE_DIR} + -o get_function_module.code + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/get_function_module.cc) +endif() add_custom_target(get_function_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code) -#target_link_libraries(get_function_module.code hip::host hip::device) if (NOT WIN32) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + if (HIP_PLATFORM MATCHES "amd") + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -o launch_kernel_module.code DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc) - #target_link_libraries(launch_kernel_module.code hip::host hip::device) - add_custom_target(launch_kernel_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code) + #target_link_libraries(launch_kernel_module.code hip::host hip::device) + add_custom_target(launch_kernel_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code) - add_custom_target(coopKernel.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(coopKernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/coopKernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/coopKernel.code -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) - #target_link_libraries(coopKernel.code hip::host hip::device) - set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS + #target_link_libraries(coopKernel.code hip::host hip::device) + else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc + -I${HIP_INCLUDE_DIR} + -o launch_kernel_module.code + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/launch_kernel_module.cc) + #target_link_libraries(launch_kernel_module.code hip::host hip::device) + add_custom_target(launch_kernel_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code) + + add_custom_target(coopKernel.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/coopKernel.cpp + -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/coopKernel.code + -I${HIP_INCLUDE_DIR} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) + endif() + set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/launch_kernel_module.code ${CMAKE_CURRENT_BINARY_DIR}/coopKernel.code) endif() - -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_global_test_module.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} +if (HIP_PLATFORM MATCHES "amd") + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_global_test_module.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/get_global_test_module.cc -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -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) -#target_link_libraries(get_global_test_module.code hip::host hip::device) + 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_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_tex_ref_module.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/get_tex_ref_module.cc -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -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) -#target_link_libraries(get_tex_ref_module.code hip::host hip::device) + add_custom_target(get_tex_ref_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/get_tex_ref_module.code) -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/not_a_module.txt ${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/not_a_module.txt) -add_custom_target(not_a_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt) -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt + add_custom_target(not_a_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/empty_file.txt ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/empty_file.txt) -add_custom_target(empty_file ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt) + add_custom_target(empty_file ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt) -add_custom_target(empty_module - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(empty_module + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/empty_module.cc -o ${CMAKE_CURRENT_BINARY_DIR}/empty_module.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) +else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/get_global_test_module.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/get_global_test_module.cc + -I${HIP_INCLUDE_DIR} + -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_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/get_tex_ref_module.cc + -I${HIP_INCLUDE_DIR} + -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) + + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/not_a_module.txt + ${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/not_a_module.txt) + add_custom_target(not_a_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/not_a_module.txt) + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/empty_file.txt + ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/empty_file.txt) + add_custom_target(empty_file ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/empty_file.txt) + + add_custom_target(empty_module + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/empty_module.cc + -o ${CMAKE_CURRENT_BINARY_DIR}/empty_module.code + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) +endif() set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/get_function_module.code ${CMAKE_CURRENT_BINARY_DIR}/get_global_test_module.code @@ -120,75 +163,70 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS # having space at the start/end of OFFLOAD_ARCH_STR can cause build failures if(HIP_PLATFORM MATCHES "amd") -set(TEST_SRC + set(TEST_SRC ${TEST_SRC} hipExtModuleLaunchKernel.cc hipHccModuleLaunchKernel.cc - hipLinkCreate.cc - hipModuleGetLoadingMode.cc) + hipLinkCreate.cc) -if(BUILD_SHARED_LIBS) - set(TEST_SRC + if(BUILD_SHARED_LIBS) + set(TEST_SRC ${TEST_SRC} hipGetProcAddressModuleApis.cc) -endif() + endif() -add_custom_target(copyKernel.code - COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=5 --cuda-device-only - ${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc + add_custom_target(copyKernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} -mcode-object-version=5 --cuda-device-only + -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernel.code -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -#target_link_libraries(copyKernel.code hip::host hip::device) -add_custom_target(copyKernel.s - COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=5 -S -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc + add_custom_target(copyKernel.s + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} -mcode-object-version=5 -S -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernel.s -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -#target_link_libraries(copyKernel.s hip::host hip::device) -add_custom_target(addKernel.code - COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=5 --cuda-device-only -x hip ${OFFLOAD_ARCH_LIST} + add_custom_target(addKernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} -mcode-object-version=5 --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/addKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/addKernel.code -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -#target_link_libraries(addKernel.code hip::host hip::device) -# TODO - Rock build failure from clang -if(NOT WIN32) - add_custom_target(addKernel.spv - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only --offload-arch=amdgcnspirv + # TODO - Rock build failure from clang + if(NOT WIN32) + add_custom_target(addKernel.spv + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} --cuda-device-only --offload-arch=amdgcnspirv --no-gpu-bundle-output -x hip ${CMAKE_CURRENT_SOURCE_DIR}/addKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/addKernel.spv -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) - #target_link_libraries(addKernel.spv hip::host hip::device) - add_custom_target(addKernel-bundle.spv - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only --offload-arch=amdgcnspirv + add_custom_target(addKernel-bundle.spv + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} --cuda-device-only --offload-arch=amdgcnspirv -x hip ${CMAKE_CURRENT_SOURCE_DIR}/addKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/addKernel-bundle.spv -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) - #target_link_libraries(addKernel-bundle.spv hip::host hip::device) - set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS + #target_link_libraries(addKernel-bundle.spv hip::host hip::device) + set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/addKernel.spv ${CMAKE_CURRENT_BINARY_DIR}/addKernel-bundle.spv) -endif() + endif() -add_custom_target(copyKernelCompressed.code - COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=5 --offload-compress --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(copyKernelCompressed.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} -mcode-object-version=5 --offload-compress --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernelCompressed.code -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -#target_link_libraries(copyKernelCompressed.code hip::host hip::device) + #target_link_libraries(copyKernelCompressed.code hip::host hip::device) -set(OFFLOAD_ARCH_GENERIC_STR + set(OFFLOAD_ARCH_GENERIC_STR --offload-arch=gfx9-generic --offload-arch=gfx9-4-generic:sramecc+:xnack- --offload-arch=gfx9-4-generic:sramecc-:xnack- @@ -198,24 +236,24 @@ set(OFFLOAD_ARCH_GENERIC_STR --offload-arch=gfx11-generic --offload-arch=gfx12-generic ) -#set(OFFLOAD_ARCH_GENERIC_STR "--offload-arch=gfx9-generic --offload-arch=gfx9-4-generic:sramecc+:xnack- --offload-arch=gfx9-4-generic:sramecc-:xnack- --offload-arch=gfx9-4-generic:xnack+ --offload-arch=gfx10-1-generic --offload-arch=gfx10-3-generic --offload-arch=gfx11-generic --offload-arch=gfx12-generic") -add_custom_target(copyKernelGenericTarget.code - COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=6 --cuda-device-only ${OFFLOAD_ARCH_GENERIC_STR} + #set(OFFLOAD_ARCH_GENERIC_STR "--offload-arch=gfx9-generic --offload-arch=gfx9-4-generic:sramecc+:xnack- --offload-arch=gfx9-4-generic:sramecc-:xnack- --offload-arch=gfx9-4-generic:xnack+ --offload-arch=gfx10-1-generic --offload-arch=gfx10-3-generic --offload-arch=gfx11-generic --offload-arch=gfx12-generic") + add_custom_target(copyKernelGenericTarget.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} -mcode-object-version=6 --cuda-device-only ${OFFLOAD_ARCH_GENERIC_STR} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernelGenericTarget.code -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -#target_link_libraries(copyKernelGenericTarget.code hip::host hip::device) + #target_link_libraries(copyKernelGenericTarget.code hip::host hip::device) -add_custom_target(copyKernelGenericTargetCompressed.code - COMMAND ${CMAKE_HIP_COMPILER} -mcode-object-version=6 --offload-compress --cuda-device-only + add_custom_target(copyKernelGenericTargetCompressed.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} -mcode-object-version=6 --offload-compress --cuda-device-only ${OFFLOAD_ARCH_GENERIC_STR} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copyKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copyKernelGenericTargetCompressed.code -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) -#target_link_libraries(copyKernelGenericTargetCompressed.code hip::host hip::device) -set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS + #target_link_libraries(copyKernelGenericTargetCompressed.code hip::host hip::device) + set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/copyKernel.code ${CMAKE_CURRENT_BINARY_DIR}/copyKernel.s ${CMAKE_CURRENT_BINARY_DIR}/addKernel.code @@ -224,67 +262,67 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/copyKernelGenericTargetCompressed.code ) -if(UNIX) -set(TEST_SRC + if(UNIX) + set(TEST_SRC ${TEST_SRC} hipKerArgOptimization.cc) -add_custom_target(copiousArgKernel.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(copiousArgKernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(copiousArgKernel.code hip::host hip::device) + #target_link_libraries(copiousArgKernel.code hip::host hip::device) -add_custom_target(copiousArgKernel0.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(copiousArgKernel0.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -mllvm -amdgpu-kernarg-preload-count=0 -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel0.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(copiousArgKernel0.code hip::host hip::device) + #target_link_libraries(copiousArgKernel0.code hip::host hip::device) -add_custom_target(copiousArgKernel1.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(copiousArgKernel1.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -mllvm -amdgpu-kernarg-preload-count=1 -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel1.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(copiousArgKernel1.code hip::host hip::device) + #target_link_libraries(copiousArgKernel1.code hip::host hip::device) -add_custom_target(copiousArgKernel2.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(copiousArgKernel2.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -mllvm -amdgpu-kernarg-preload-count=2 -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel2.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(copiousArgKernel2.code hip::host hip::device) + #target_link_libraries(copiousArgKernel2.code hip::host hip::device) -add_custom_target(copiousArgKernel3.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(copiousArgKernel3.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -mllvm -amdgpu-kernarg-preload-count=3 -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel3.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(copiousArgKernel3.code hip::host hip::device) + #target_link_libraries(copiousArgKernel3.code hip::host hip::device) -add_custom_target(copiousArgKernel16.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(copiousArgKernel16.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -mllvm -amdgpu-kernarg-preload-count=16 -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel16.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(copiousArgKernel16.code hip::host hip::device) + #target_link_libraries(copiousArgKernel16.code hip::host hip::device) -add_custom_target(copiousArgKernel17.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} + add_custom_target(copiousArgKernel17.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -mllvm -amdgpu-kernarg-preload-count=17 -x hip ${CMAKE_CURRENT_SOURCE_DIR}/copiousArgKernel.cc -o ${CMAKE_CURRENT_BINARY_DIR}/../../unit/module/copiousArgKernel17.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(copiousArgKernel17.code hip::host hip::device) + #target_link_libraries(copiousArgKernel17.code hip::host hip::device) -set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS + set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/copiousArgKernel.code ${CMAKE_CURRENT_BINARY_DIR}/copiousArgKernel0.code ${CMAKE_CURRENT_BINARY_DIR}/copiousArgKernel1.code @@ -293,13 +331,13 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/copiousArgKernel16.code ${CMAKE_CURRENT_BINARY_DIR}/copiousArgKernel17.code ) -endif() + endif() endif() if(HIP_PLATFORM MATCHES "amd") - set(RTCLIB "hiprtc::hiprtc") + set(RTCLIB "hiprtc::hiprtc") else() - set(RTCLIB "nvrtc") + set(RTCLIB "nvrtc") endif() hip_add_exe_to_target(NAME ModuleTest @@ -321,28 +359,27 @@ add_dependencies(ModuleTest empty_file) add_dependencies(ModuleTest empty_module) if(HIP_PLATFORM MATCHES "amd") -add_dependencies(build_tests copyKernel.code copyKernel.s) -add_dependencies(build_tests addKernel.code) -# TODO - Rock build failure from clang -if(NOT WIN32) - add_dependencies(build_tests addKernel.spv) - add_dependencies(build_tests addKernel-bundle.spv) -endif() -add_dependencies(build_tests copyKernelCompressed.code) -add_dependencies(build_tests copyKernelGenericTarget.code) -add_dependencies(build_tests copyKernelGenericTargetCompressed.code) - -if(UNIX) -add_dependencies(build_tests copiousArgKernel.code copiousArgKernel0.code copiousArgKernel1.code copiousArgKernel2.code + add_dependencies(build_tests copyKernel.code copyKernel.s) + add_dependencies(build_tests addKernel.code) + # TODO - Rock build failure from clang + if(NOT WIN32) + add_dependencies(build_tests addKernel.spv) + add_dependencies(build_tests addKernel-bundle.spv) + endif() + add_dependencies(build_tests copyKernelCompressed.code) + add_dependencies(build_tests copyKernelGenericTarget.code) + add_dependencies(build_tests copyKernelGenericTargetCompressed.code) + + if(UNIX) + add_dependencies(build_tests copiousArgKernel.code copiousArgKernel0.code copiousArgKernel1.code copiousArgKernel2.code copiousArgKernel3.code copiousArgKernel16.code copiousArgKernel17.code) -endif() + endif() endif() add_executable(hipGetFuncBySymbol_exe EXCLUDE_FROM_ALL hipGetFuncBySymbol_exe.cc) -set_source_files_properties(hipGetFuncBySymbol_exe.cc PROPERTIES LANGUAGE HIP) -set_target_properties(hipGetFuncBySymbol_exe PROPERTIES LINKER_LANGUAGE HIP) +set_source_files_properties(hipGetFuncBySymbol_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +target_link_libraries(hipGetFuncBySymbol_exe ${GPGPU_LINKER_LIBRARIES}) add_dependencies(build_tests hipGetFuncBySymbol_exe) -target_link_libraries(hipGetFuncBySymbol_exe hip::host hip::device) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipGetFuncBySymbol_exe) # Common Tests - Test independent of all platforms @@ -362,38 +399,71 @@ set(AMD_TEST_SRC if(HIP_PLATFORM MATCHES "amd") set(TEST_SRC ${TEST_SRC} ${AMD_TEST_SRC}) endif() + hip_add_exe_to_target(NAME module TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests) -add_custom_target(managed_kernel.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only - ${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/managed_kernel.cpp + +if (HIP_PLATFORM MATCHES "amd") + add_custom_target(managed_kernel.code COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only + -x hip ${CMAKE_CURRENT_SOURCE_DIR}/managed_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/managed_kernel.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(managed_kernel.code hip::host hip::device) + #target_link_libraries(managed_kernel.code hip::host hip::device) -add_custom_target(vcpy_kernel.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only - ${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp + add_custom_target(vcpy_kernel.code COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only + -x hip ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/vcpy_kernel.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(vcpy_kernel.code hip::host hip::device) + #target_link_libraries(vcpy_kernel.code hip::host hip::device) -add_custom_target(matmul.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only - -x hip ${OFFLOAD_ARCH_LIST} ${CMAKE_CURRENT_SOURCE_DIR}/matmul.cpp -o + add_custom_target(matmul.code COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only + -x hip ${CMAKE_CURRENT_SOURCE_DIR}/matmul.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/matmul.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(matmul.code hip::host hip::device) + #target_link_libraries(matmul.code hip::host hip::device) -add_custom_target(kernel_count.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only - ${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kernel_count.cpp -o + add_custom_target(kernel_count.code COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only + -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kernel_count.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/kernel_count.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(kernel_count.code hip::host hip::device) + #target_link_libraries(kernel_count.code hip::host hip::device) -add_custom_target(emptyModuleCount.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only - ${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/emptyModuleCount.cpp -o + add_custom_target(emptyModuleCount.code COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only + -x hip ${CMAKE_CURRENT_SOURCE_DIR}/emptyModuleCount.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/emptyModuleCount.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) -#target_link_libraries(emptyModuleCount.code hip::host hip::device) + #target_link_libraries(emptyModuleCount.code hip::host hip::device) +else() + add_custom_target(managed_kernel.code COMMAND ${CMAKE_HIP_COMPILER} --fatbin + ${OFFLOAD_ARCH_LIST} -x cu ${CMAKE_CURRENT_SOURCE_DIR}/managed_kernel.cpp + -o ${CMAKE_CURRENT_BINARY_DIR}/../module/managed_kernel.code + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${HIP_INCLUDE_DIR}) + #target_link_libraries(managed_kernel.code hip::host hip::device) + + add_custom_target(vcpy_kernel.code COMMAND ${CMAKE_HIP_COMPILER} --fatbin + ${OFFLOAD_ARCH_LIST} -x cu ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp + -o ${CMAKE_CURRENT_BINARY_DIR}/../module/vcpy_kernel.code + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${HIP_INCLUDE_DIR}) + #target_link_libraries(vcpy_kernel.code hip::host hip::device) + + add_custom_target(matmul.code COMMAND ${CMAKE_HIP_COMPILER} --fatbin + -x cu ${OFFLOAD_ARCH_LIST} ${CMAKE_CURRENT_SOURCE_DIR}/matmul.cpp -o + ${CMAKE_CURRENT_BINARY_DIR}/../module/matmul.code + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${HIP_INCLUDE_DIR}) + #target_link_libraries(matmul.code hip::host hip::device) + + add_custom_target(kernel_count.code COMMAND ${CMAKE_HIP_COMPILER} --fatbin + ${OFFLOAD_ARCH_LIST} -x cu ${CMAKE_CURRENT_SOURCE_DIR}/kernel_count.cpp -o + ${CMAKE_CURRENT_BINARY_DIR}/../module/kernel_count.code + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${HIP_INCLUDE_DIR}) + #target_link_libraries(kernel_count.code hip::host hip::device) + + add_custom_target(emptyModuleCount.code COMMAND ${CMAKE_HIP_COMPILER} --fatbin + ${OFFLOAD_ARCH_LIST} -x cu ${CMAKE_CURRENT_SOURCE_DIR}/emptyModuleCount.cpp -o + ${CMAKE_CURRENT_BINARY_DIR}/../module/emptyModuleCount.code + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${HIP_INCLUDE_DIR}) +endif() add_dependencies(ModuleTest managed_kernel.code) add_dependencies(ModuleTest vcpy_kernel.code) @@ -401,10 +471,17 @@ add_dependencies(ModuleTest matmul.code) add_dependencies(ModuleTest kernel_count.code) add_dependencies(ModuleTest emptyModuleCount.code) -add_custom_target(kernel_composite_test.code COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only - ${OFFLOAD_ARCH_LIST} -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kernel_composite_test.cpp -o +if (HIP_PLATFORM MATCHES "amd") + add_custom_target(kernel_composite_test.code COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only + -x hip ${CMAKE_CURRENT_SOURCE_DIR}/kernel_composite_test.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../module/kernel_composite_test.code -I${CMAKE_CURRENT_SOURCE_DIR}/../../include ${HIP_PATH_OPT}) +else() + add_custom_target(kernel_composite_test.code COMMAND ${CMAKE_HIP_COMPILER} --fatbin + ${OFFLOAD_ARCH_LIST} -x cu ${CMAKE_CURRENT_SOURCE_DIR}/kernel_composite_test.cpp -o + ${CMAKE_CURRENT_BINARY_DIR}/../module/kernel_composite_test.code + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include -I${HIP_INCLUDE_DIR}) +endif() #target_link_libraries(kernel_composite_test.code hip::host hip::device) set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/kernel_composite_test.code @@ -415,10 +492,9 @@ set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/emptyModuleCount.code ) add_executable(testhipModuleLoadUnloadFunc_exe EXCLUDE_FROM_ALL testhipModuleLoadUnloadFunc_exe.cc) -set_source_files_properties(testhipModuleLoadUnloadFunc_exe.cc PROPERTIES LANGUAGE HIP) -set_target_properties(testhipModuleLoadUnloadFunc_exe PROPERTIES LINKER_LANGUAGE HIP) +set_source_files_properties(testhipModuleLoadUnloadFunc_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +target_link_libraries(testhipModuleLoadUnloadFunc_exe ${GPGPU_LINKER_LIBRARIES}) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS testhipModuleLoadUnloadFunc_exe) -target_link_libraries(testhipModuleLoadUnloadFunc_exe hip::host hip::device) add_dependencies(module managed_kernel.code vcpy_kernel.code matmul.code kernel_composite_test.code testhipModuleLoadUnloadFunc_exe) diff --git a/catch/unit/module/addKernel.cc b/catch/unit/module/addKernel.cc index 14586469f..37571fb28 100644 --- a/catch/unit/module/addKernel.cc +++ b/catch/unit/module/addKernel.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/module/coopKernel.cpp b/catch/unit/module/coopKernel.cpp index df236ff5f..994e913ba 100644 --- a/catch/unit/module/coopKernel.cpp +++ b/catch/unit/module/coopKernel.cpp @@ -1,22 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/module/copiousArgKernel.cc b/catch/unit/module/copiousArgKernel.cc index b613b931a..c7bf4bdff 100644 --- a/catch/unit/module/copiousArgKernel.cc +++ b/catch/unit/module/copiousArgKernel.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/module/copyKernel.cc b/catch/unit/module/copyKernel.cc index 5e7699657..0ddedb391 100644 --- a/catch/unit/module/copyKernel.cc +++ b/catch/unit/module/copyKernel.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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 extern "C" __global__ void copy_ker(int* Ad, int* Bd, size_t size) { diff --git a/catch/unit/module/empty_module.cc b/catch/unit/module/empty_module.cc index d77f3e573..c46cfd77b 100644 --- a/catch/unit/module/empty_module.cc +++ b/catch/unit/module/empty_module.cc @@ -1,20 +1,5 @@ /* -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. -*/ \ No newline at end of file + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ diff --git a/catch/unit/module/get_function_module.cc b/catch/unit/module/get_function_module.cc index 2c5a8a563..71a52570c 100644 --- a/catch/unit/module/get_function_module.cc +++ b/catch/unit/module/get_function_module.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/module/get_global_test_module.cc b/catch/unit/module/get_global_test_module.cc index 461dbdef3..b09d1bd49 100644 --- a/catch/unit/module/get_global_test_module.cc +++ b/catch/unit/module/get_global_test_module.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "hip/hip_runtime_api.h" diff --git a/catch/unit/module/get_tex_ref_module.cc b/catch/unit/module/get_tex_ref_module.cc index de61d34d3..f0d318400 100644 --- a/catch/unit/module/get_tex_ref_module.cc +++ b/catch/unit/module/get_tex_ref_module.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/module/hipDrvLaunchKernelEx.cc b/catch/unit/module/hipDrvLaunchKernelEx.cc index e7bc85ce3..ac8d7ad29 100644 --- a/catch/unit/module/hipDrvLaunchKernelEx.cc +++ b/catch/unit/module/hipDrvLaunchKernelEx.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -46,7 +34,7 @@ static constexpr auto kernel_name = "cooperativeKernelEx"; * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDrvLaunchKernelEx_NegTsts") { +TEST_CASE(Unit_hipDrvLaunchKernelEx_NegTsts) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -216,7 +204,7 @@ bool runTestDrvLaunch(const char* testName, std::string kernelFunc, int totalThr * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDrvLaunchKernelEx_Functional") { +TEST_CASE(Unit_hipDrvLaunchKernelEx_Functional) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -239,7 +227,7 @@ TEST_CASE("Unit_hipDrvLaunchKernelEx_Functional") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDrvLaunchKernelEx_With_Different_Kernels") { +TEST_CASE(Unit_hipDrvLaunchKernelEx_With_Different_Kernels) { CTX_CREATE(); if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); @@ -319,7 +307,7 @@ TEST_CASE("Unit_hipDrvLaunchKernelEx_With_Different_Kernels") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDrvLaunchKernelEx_With_CooperativeKernelWithArgs") { +TEST_CASE(Unit_hipDrvLaunchKernelEx_With_CooperativeKernelWithArgs) { CTX_CREATE(); if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); @@ -395,7 +383,7 @@ TEST_CASE("Unit_hipDrvLaunchKernelEx_With_CooperativeKernelWithArgs") { * ------------------------ * - HIP_VERSION >= 6.5 */ -TEST_CASE("Unit_hipDrvLaunchKernelEx_With_MaxBlockDims") { +TEST_CASE(Unit_hipDrvLaunchKernelEx_With_MaxBlockDims) { CTX_CREATE(); if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); diff --git a/catch/unit/module/hipExtLaunchKernelGGL.cc b/catch/unit/module/hipExtLaunchKernelGGL.cc index 46af5a9e9..4257f1142 100644 --- a/catch/unit/module/hipExtLaunchKernelGGL.cc +++ b/catch/unit/module/hipExtLaunchKernelGGL.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include "hip/hip_ext.h" @@ -184,7 +172,7 @@ bool KernelTimeExecution() { return testStatus; } -TEST_CASE("Unit_hipExtLaunchKernelGGL_Functional") { +TEST_CASE(Unit_hipExtLaunchKernelGGL_Functional) { bool testStatus = true; // Disabled the concurency test as the firmware does not support concurrency // in the same stream diff --git a/catch/unit/module/hipExtLaunchMultiKernelMultiDevFunctional.cc b/catch/unit/module/hipExtLaunchMultiKernelMultiDevFunctional.cc index 24f5ae21f..e0a98badc 100644 --- a/catch/unit/module/hipExtLaunchMultiKernelMultiDevFunctional.cc +++ b/catch/unit/module/hipExtLaunchMultiKernelMultiDevFunctional.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -53,7 +41,7 @@ __global__ void vector_square(float* C_d, float* A_d, size_t N) { } } -TEST_CASE("Unit_hipExtLaunchMultiKernelMultiDevice_Functional", "[multigpu]") { +TEST_CASE(Unit_hipExtLaunchMultiKernelMultiDevice_Functional) { constexpr int MAX_GPUS = 8; float *A_d[MAX_GPUS], *C_d[MAX_GPUS]; float *A_h, *C_h; diff --git a/catch/unit/module/hipExtModuleLaunchKernel.cc b/catch/unit/module/hipExtModuleLaunchKernel.cc index b25617e7e..86cb75fd6 100644 --- a/catch/unit/module/hipExtModuleLaunchKernel.cc +++ b/catch/unit/module/hipExtModuleLaunchKernel.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2023-2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipExtModuleLaunchKernel hipExtModuleLaunchKernel @@ -94,7 +81,7 @@ static bool searchRegExpr(const std::regex& expr, const char* filename) { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipExtModuleLaunchKernel_CheckCodeObjAttr") { +TEST_CASE(Unit_hipExtModuleLaunchKernel_CheckCodeObjAttr) { // Open copyKernel.s and read the file const std::regex regexp("uniform_work_group_size\\s*:\\s*[0-1]"); REQUIRE(true == searchRegExpr(regexp, "copyKernel.s")); @@ -115,7 +102,7 @@ TEST_CASE("Unit_hipExtModuleLaunchKernel_CheckCodeObjAttr") { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipExtModuleLaunchKernel_NonUniformWorkGroup") { +TEST_CASE(Unit_hipExtModuleLaunchKernel_NonUniformWorkGroup) { // first check if uniform_work_group_size = 1. const std::regex regexp("uniform_work_group_size\\s*:\\s*1"); if (false == searchRegExpr(regexp, "copyKernel.s")) { @@ -185,7 +172,7 @@ TEST_CASE("Unit_hipExtModuleLaunchKernel_NonUniformWorkGroup") { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipExtModuleLaunchKernel_UniformWorkGroup") { +TEST_CASE(Unit_hipExtModuleLaunchKernel_UniformWorkGroup) { size_t arraylength = totalWorkGroups * localWorkSize; size_t sizeBytes{arraylength * sizeof(int)}; // Get module and function from module @@ -251,7 +238,7 @@ TEST_CASE("Unit_hipExtModuleLaunchKernel_UniformWorkGroup") { HIP_CHECK(hipModuleUnload(Module)); } -TEST_CASE("Unit_hipExtModuleLaunchKernel_Positive_Parameters") { +TEST_CASE(Unit_hipExtModuleLaunchKernel_Positive_Parameters) { ModuleLaunchKernelPositiveParameters(); auto mg = ModuleGuard::InitModule("launch_kernel_module.code"); SECTION("Pass only start event") { @@ -277,7 +264,7 @@ TEST_CASE("Unit_hipExtModuleLaunchKernel_Positive_Parameters") { } } -TEST_CASE("Unit_hipExtModuleLaunchKernel_Negative_Parameters", "[multigpu]") { +TEST_CASE(Unit_hipExtModuleLaunchKernel_Negative_Parameters) { ModuleLaunchKernelNegativeParameters(true); } /** @@ -744,7 +731,7 @@ bool ModuleLaunchKernel::Module_WorkGroup_Test() { return testStatus; } -TEST_CASE("Unit_hipExtModuleLaunchKernel_Functional") { +TEST_CASE(Unit_hipExtModuleLaunchKernel_Functional) { bool testStatus = true; ModuleLaunchKernel kernelLaunch; testStatus &= kernelLaunch.ExtModule_Negative_tests(); diff --git a/catch/unit/module/hipFuncGetAttribute.cc b/catch/unit/module/hipFuncGetAttribute.cc index 8071fee5d..b7f97d99e 100644 --- a/catch/unit/module/hipFuncGetAttribute.cc +++ b/catch/unit/module/hipFuncGetAttribute.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip_module_common.hh" @@ -32,7 +16,7 @@ static hipModule_t GetModule() { return mg.module(); } -TEST_CASE("Unit_hipFuncGetAttribute_Positive_Basic") { +TEST_CASE(Unit_hipFuncGetAttribute_Positive_Basic) { hipFunction_t kernel = GetKernel(GetModule(), "GlobalKernel"); int value; @@ -70,7 +54,7 @@ TEST_CASE("Unit_hipFuncGetAttribute_Positive_Basic") { } } -TEST_CASE("Unit_hipFuncGetAttribute_Negative_Parameters") { +TEST_CASE(Unit_hipFuncGetAttribute_Negative_Parameters) { hipFunction_t kernel = GetKernel(GetModule(), "GlobalKernel"); int value; diff --git a/catch/unit/module/hipFuncGetAttributes.cc b/catch/unit/module/hipFuncGetAttributes.cc index aff0a4681..35f59c2f5 100644 --- a/catch/unit/module/hipFuncGetAttributes.cc +++ b/catch/unit/module/hipFuncGetAttributes.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -45,7 +33,7 @@ __global__ void getAttrFn(float* px, float* py) { *py = *py + *px; } -TEST_CASE("Unit_hipFuncGetAttributes_basic") { +TEST_CASE(Unit_hipFuncGetAttributes_basic) { hipFuncAttributes attr{}; auto r = hipFuncGetAttributes(&attr, reinterpret_cast(&getAttrFn)); diff --git a/catch/unit/module/hipFuncSetAttribute.cc b/catch/unit/module/hipFuncSetAttribute.cc index 974f196c3..4d8508557 100644 --- a/catch/unit/module/hipFuncSetAttribute.cc +++ b/catch/unit/module/hipFuncSetAttribute.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -45,7 +33,7 @@ __global__ void fn(float* px, float* py) { *py = *py + *px; } -TEST_CASE("Unit_hipFuncSetAttribute_Basic") { +TEST_CASE(Unit_hipFuncSetAttribute_Basic) { HIP_CHECK(hipFuncSetAttribute(reinterpret_cast(&fn), hipFuncAttributeMaxDynamicSharedMemorySize, 0)); HIP_CHECK(hipFuncSetAttribute(reinterpret_cast(&fn), diff --git a/catch/unit/module/hipFuncSetSharedMemConfig.cc b/catch/unit/module/hipFuncSetSharedMemConfig.cc index 7925185e6..a13ab86f3 100644 --- a/catch/unit/module/hipFuncSetSharedMemConfig.cc +++ b/catch/unit/module/hipFuncSetSharedMemConfig.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -47,7 +35,7 @@ __global__ void ReverseSeq(int* A, int* B, int N) { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipFuncSetSharedMemConfig_functional") { +TEST_CASE(Unit_hipFuncSetSharedMemConfig_functional) { int *Ah = NULL, *RAh = NULL, NELMTS = 128; int *Ad = NULL, *RAd = NULL; Ah = reinterpret_cast(malloc(NELMTS * sizeof(int))); diff --git a/catch/unit/module/hipGetFuncBySymbol.cc b/catch/unit/module/hipGetFuncBySymbol.cc index becd95e0d..fb383c052 100644 --- a/catch/unit/module/hipGetFuncBySymbol.cc +++ b/catch/unit/module/hipGetFuncBySymbol.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipGetFuncBySymbol hipGetFuncBySymbol @@ -93,7 +80,7 @@ bool verifyResult(int* a, int* output_ref, int arrSize) { * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetFuncBySymbol_PositiveTest") { +TEST_CASE(Unit_hipGetFuncBySymbol_PositiveTest) { uint32_t *A_d, *C_d; uint32_t *A_h, *C_h; size_t N = 1000000; @@ -166,7 +153,7 @@ TEST_CASE("Unit_hipGetFuncBySymbol_PositiveTest") { * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetFuncBySymbol_NegativeTests") { +TEST_CASE(Unit_hipGetFuncBySymbol_NegativeTests) { hipFunction_t funcPointer; // Passing NULL as second parameter @@ -189,7 +176,7 @@ TEST_CASE("Unit_hipGetFuncBySymbol_NegativeTests") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetFuncBySymbol_InChildProcess") { +TEST_CASE(Unit_hipGetFuncBySymbol_InChildProcess) { hip::SpawnProc proc("hipGetFuncBySymbol_exe", true); REQUIRE(proc.run() == 0); } @@ -207,7 +194,7 @@ TEST_CASE("Unit_hipGetFuncBySymbol_InChildProcess") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetFuncBySymbol_MultiDev", "[multigpu]") { +TEST_CASE(Unit_hipGetFuncBySymbol_MultiDev) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount < 2) { @@ -323,7 +310,7 @@ void MultiThreadMultiDevFunc(int DevId) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetFuncBySymbol_MultiDevMultiThread", "[multigpu]") { +TEST_CASE(Unit_hipGetFuncBySymbol_MultiDevMultiThread) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount < 2) { diff --git a/catch/unit/module/hipGetFuncBySymbol_exe.cc b/catch/unit/module/hipGetFuncBySymbol_exe.cc index 67b0e663b..e39765a7e 100644 --- a/catch/unit/module/hipGetFuncBySymbol_exe.cc +++ b/catch/unit/module/hipGetFuncBySymbol_exe.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/module/hipGetProcAddressModuleApis.cc b/catch/unit/module/hipGetProcAddressModuleApis.cc index dbd883f6e..b96bcedfd 100644 --- a/catch/unit/module/hipGetProcAddressModuleApis.cc +++ b/catch/unit/module/hipGetProcAddressModuleApis.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -38,7 +25,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_ModuleApis") { +TEST_CASE(Unit_hipGetProcAddress_ModuleApis) { void* hipModuleLoad_ptr = nullptr; void* hipModuleUnload_ptr = nullptr; void* hipModuleGetFunction_ptr = nullptr; @@ -262,7 +249,7 @@ TEST_CASE("Unit_hipGetProcAddress_ModuleApis") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_ModuleApisLoadData") { +TEST_CASE(Unit_hipGetProcAddress_ModuleApisLoadData) { void* hipModuleLoadData_ptr = nullptr; void* hipModuleLoadDataEx_ptr = nullptr; @@ -328,7 +315,7 @@ TEST_CASE("Unit_hipGetProcAddress_ModuleApisLoadData") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_ModuleApisCooperativeKernels", "[multigpu]") { +TEST_CASE(Unit_hipGetProcAddress_ModuleApisCooperativeKernels) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; @@ -576,7 +563,7 @@ TEST_CASE("Unit_hipGetProcAddress_ModuleApisCooperativeKernels", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_ModuleApisOccupancy") { +TEST_CASE(Unit_hipGetProcAddress_ModuleApisOccupancy) { void* hipModuleOccupancyMaxPotentialBlockSize_ptr = nullptr; void* hipModuleOccupancyMaxPotentialBlockSizeWithFlags_ptr = nullptr; void* hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_ptr = nullptr; diff --git a/catch/unit/module/hipHccModuleLaunchKernel.cc b/catch/unit/module/hipHccModuleLaunchKernel.cc index 1121477cd..074b84095 100644 --- a/catch/unit/module/hipHccModuleLaunchKernel.cc +++ b/catch/unit/module/hipHccModuleLaunchKernel.cc @@ -1,22 +1,8 @@ -/*Copyright (c) 2024 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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipHccModuleLaunchKernel hipHccModuleLaunchKernel @@ -57,7 +43,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipHccModuleLaunchKernel_basic") { +TEST_CASE(Unit_hipHccModuleLaunchKernel_basic) { size_t width = GENERATE(3, 4, 100); size_t widthInBytes = width * sizeof(int); int *A_d, *B_d; @@ -99,7 +85,7 @@ TEST_CASE("Unit_hipHccModuleLaunchKernel_basic") { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipHccModuleLaunchKernel_NegTst") { +TEST_CASE(Unit_hipHccModuleLaunchKernel_NegTst) { size_t width = GENERATE(3, 4, 100); size_t widthInBytes = width * sizeof(int); int *A_d, *B_d; diff --git a/catch/unit/module/hipKerArgOptimization.cc b/catch/unit/module/hipKerArgOptimization.cc index 41cd93ba6..cbae43767 100644 --- a/catch/unit/module/hipKerArgOptimization.cc +++ b/catch/unit/module/hipKerArgOptimization.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "hip/hip_ext.h" @@ -48,7 +35,7 @@ static void verifyDevResult(int* hostBuf, int* devBuf, int coef1, int coef2, siz delete[] buf; } -TEST_CASE("Unit_KerArgOptimization_Saxpy") { +TEST_CASE(Unit_KerArgOptimization_Saxpy) { constexpr size_t arraylen = 1 << 16; constexpr size_t arraylenBytes = arraylen * sizeof(int); constexpr auto blocksize = 256; diff --git a/catch/unit/module/hipLinkCreate.cc b/catch/unit/module/hipLinkCreate.cc index 7c7f99895..e733a3849 100644 --- a/catch/unit/module/hipLinkCreate.cc +++ b/catch/unit/module/hipLinkCreate.cc @@ -1,23 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -101,7 +86,7 @@ static inline void JitLink(hipModule_t *Module, hipFunction_t *Kernel, hipLinkSt * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hip_linker_spirv_input") { +TEST_CASE(Unit_hip_linker_spirv_input) { size_t N = ARRAY_SIZE; size_t sizeBytes = N * sizeof(int); int *A_h = new int[sizeBytes]; @@ -165,7 +150,7 @@ TEST_CASE("Unit_hip_linker_spirv_input") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipLinkCreate_Negative") { +TEST_CASE(Unit_hipLinkCreate_Negative) { hipLinkState_t linkstate; hipJitOption options[4]; @@ -199,7 +184,7 @@ TEST_CASE("Unit_hipLinkCreate_Negative") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipLinkCreate_AddLinker_CUDA_only_options") { +TEST_CASE(Unit_hipLinkCreate_AddLinker_CUDA_only_options) { hipLinkState_t linkstate; // Random options so that it is not null const char* isaopts[] = {"-mllvm", "-inline-threshold=1", "-mllvm", "-inlinehint-threshold=1"}; @@ -254,7 +239,7 @@ TEST_CASE("Unit_hipLinkCreate_AddLinker_CUDA_only_options") { * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipLinkAddFile_Negative") { +TEST_CASE(Unit_hipLinkAddFile_Negative) { hipLinkState_t linkstate; HIP_CHECK(hipLinkCreate(0, nullptr, nullptr, &linkstate)); diff --git a/catch/unit/module/hipManagedKeywordBasic.cc b/catch/unit/module/hipManagedKeywordBasic.cc index 902a71bfc..1a8e72d4b 100644 --- a/catch/unit/module/hipManagedKeywordBasic.cc +++ b/catch/unit/module/hipManagedKeywordBasic.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include @@ -43,7 +31,7 @@ constexpr auto fileName = "managed_kernel.code"; * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipModuleGetGlobal_Functional", "[multigpu]") { +TEST_CASE(Unit_hipModuleGetGlobal_Functional) { bool testStatus = true; int numDevices = 0; hipDeviceptr_t x; diff --git a/catch/unit/module/hipModule.cc b/catch/unit/module/hipModule.cc index eed3759da..2057a4ed5 100644 --- a/catch/unit/module/hipModule.cc +++ b/catch/unit/module/hipModule.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -188,7 +176,7 @@ bool testMultiTargArchCodeObj() { return btestPassed; } -TEST_CASE("Unit_hipModule_Functional") { +TEST_CASE(Unit_hipModule_Functional) { bool TestPassed = true; SECTION("Code object file test on current GPU") { TestPassed &= testCodeObjFile(CODE_OBJ_SINGLEARCH); diff --git a/catch/unit/module/hipModuleGetFunction.cc b/catch/unit/module/hipModuleGetFunction.cc index 2ccf0b875..e8f71e47d 100644 --- a/catch/unit/module/hipModuleGetFunction.cc +++ b/catch/unit/module/hipModuleGetFunction.cc @@ -1,37 +1,22 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip_module_common.hh" #include #include -TEST_CASE("Unit_hipModuleGetFunction_Positive_Basic") { +TEST_CASE(Unit_hipModuleGetFunction_Positive_Basic) { auto mg = ModuleGuard::InitModule("get_function_module.code"); hipFunction_t kernel = nullptr; HIP_CHECK(hipModuleGetFunction(&kernel, mg.module(), "GlobalKernel")); REQUIRE(kernel != nullptr); } -TEST_CASE("Unit_hipModuleGetFunction_Negative_Parameters") { +TEST_CASE(Unit_hipModuleGetFunction_Negative_Parameters) { auto mg = ModuleGuard::InitModule("get_function_module.code"); hipFunction_t kernel = nullptr; @@ -71,7 +56,7 @@ TEST_CASE("Unit_hipModuleGetFunction_Negative_Parameters") { // Test description: Loading kernel function from different device than the one on which the module // is loaded -TEST_CASE("Unit_hipModuleGetFunction_DiffDevice", "[multigpu]") { +TEST_CASE(Unit_hipModuleGetFunction_DiffDevice) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); if (numDevices < 2) { diff --git a/catch/unit/module/hipModuleGetFunctionCount.cc b/catch/unit/module/hipModuleGetFunctionCount.cc index 2a5f298ff..717bde843 100644 --- a/catch/unit/module/hipModuleGetFunctionCount.cc +++ b/catch/unit/module/hipModuleGetFunctionCount.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "hip_module_common.hh" #include #include @@ -47,7 +35,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipModuleGetFunctionCount_Functional") { +TEST_CASE(Unit_hipModuleGetFunctionCount_Functional) { CTX_CREATE(); hipModule_t moduleSingleArch, moduleEmpty, doubleKernelModule, rtcModule; unsigned int count = 0; @@ -103,7 +91,7 @@ TEST_CASE("Unit_hipModuleGetFunctionCount_Functional") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipModuleGetFunctionCount_NegativeTsts") { +TEST_CASE(Unit_hipModuleGetFunctionCount_NegativeTsts) { unsigned int count = 0; SECTION("Input module as nullptr") { HIP_CHECK_ERROR(hipModuleGetFunctionCount(&count, nullptr), diff --git a/catch/unit/module/hipModuleGetGlobal.cc b/catch/unit/module/hipModuleGetGlobal.cc index c3dd06fd0..30f4a2c4c 100644 --- a/catch/unit/module/hipModuleGetGlobal.cc +++ b/catch/unit/module/hipModuleGetGlobal.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -82,7 +67,7 @@ static inline hipModule_t GetModule() { return mg.module(); } -TEST_CASE("Unit_hipModuleGetGlobal_Positive_Basic") { +TEST_CASE(Unit_hipModuleGetGlobal_Positive_Basic) { hipModule_t module = GetModule(); SECTION("int") { HIP_MODULE_GET_GLOBAL_TEST(int, module); } @@ -94,7 +79,7 @@ TEST_CASE("Unit_hipModuleGetGlobal_Positive_Basic") { SECTION("double") { HIP_MODULE_GET_GLOBAL_TEST(double, module); } } -TEST_CASE("Unit_hipModuleGetGlobal_Positive_Parameters") { +TEST_CASE(Unit_hipModuleGetGlobal_Positive_Parameters) { hipModule_t module = GetModule(); hipDeviceptr_t global = 0; size_t global_size = 0; @@ -108,7 +93,7 @@ TEST_CASE("Unit_hipModuleGetGlobal_Positive_Parameters") { } } -TEST_CASE("Unit_hipModuleGetGlobal_Negative_Parameters") { +TEST_CASE(Unit_hipModuleGetGlobal_Negative_Parameters) { hipModule_t module = GetModule(); hipDeviceptr_t global = 0; size_t global_size = 0; @@ -123,7 +108,7 @@ TEST_CASE("Unit_hipModuleGetGlobal_Negative_Parameters") { } } -TEST_CASE("Unit_hipModuleGetGlobal_Negative_Hmod_Is_Nullptr") { +TEST_CASE(Unit_hipModuleGetGlobal_Negative_Hmod_Is_Nullptr) { hipDeviceptr_t global = 0; size_t global_size = 0; @@ -133,7 +118,7 @@ TEST_CASE("Unit_hipModuleGetGlobal_Negative_Hmod_Is_Nullptr") { CTX_DESTROY(); } -TEST_CASE("Unit_hipModuleGetGlobal_Negative_Name_Is_Empty_String") { +TEST_CASE(Unit_hipModuleGetGlobal_Negative_Name_Is_Empty_String) { hipModule_t module = GetModule(); hipDeviceptr_t global = 0; size_t global_size = 0; @@ -141,14 +126,14 @@ TEST_CASE("Unit_hipModuleGetGlobal_Negative_Name_Is_Empty_String") { HIP_CHECK_ERROR(hipModuleGetGlobal(&global, &global_size, module, ""), hipErrorInvalidValue); } -TEST_CASE("Unit_hipModuleGetGlobal_Negative_Dptr_And_Bytes_Are_Nullptr") { +TEST_CASE(Unit_hipModuleGetGlobal_Negative_Dptr_And_Bytes_Are_Nullptr) { hipModule_t module = GetModule(); HIP_CHECK_ERROR(hipModuleGetGlobal(nullptr, nullptr, module, "int_var"), hipErrorInvalidValue); } // Test description: Loading device ptr from different device than the one on which the module // is loaded -TEST_CASE("Unit_hipModuleGetGlobal_DiffDevice", "[multigpu]") { +TEST_CASE(Unit_hipModuleGetGlobal_DiffDevice) { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); if (numDevices < 2) { diff --git a/catch/unit/module/hipModuleGetGlobal.hh b/catch/unit/module/hipModuleGetGlobal.hh index 8bd773f03..e210bbd58 100644 --- a/catch/unit/module/hipModuleGetGlobal.hh +++ b/catch/unit/module/hipModuleGetGlobal.hh @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/module/hipModuleGetLoadingMode.cc b/catch/unit/module/hipModuleGetLoadingMode.cc deleted file mode 100644 index 97f306080..000000000 --- a/catch/unit/module/hipModuleGetLoadingMode.cc +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -#include -#include -#ifdef __linux__ -#include -#endif -#ifdef _WIN64 -#include -#endif - -#ifdef _WIN64 -#define setenv(x, y, z) _putenv_s(x, y) -#define unsetenv(x) _putenv(x) -#endif - -constexpr int LEN = 64; -constexpr auto SIZE_BYTES = (LEN << 2); -constexpr auto codeObjFile = "copyKernel.code"; -constexpr auto kernel_name = "copy_ker"; -/** - * @addtogroup hipModuleGetLoadingMode hipModuleGetLoadingMode - * @{ - * @ingroup ModuleTest - * `hhipError_t hipModuleGetLoadingMode(hipModuleLoadingMode_t* mode)` - - * Function gets the current module load mode - */ - -/** - * Test Description - * ------------------------ - * - Test case verifies the positive case of hipModuleGetLoadingMode API. - * - Verifies the default mode. Default mode is Lazy. - * Test source - * ------------------------ - * - catch/unit/module/hipModuleGetLoadingMode.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 7.2 - */ -TEST_CASE("Unit_hipModuleGetLoadingMode_DefaultModeCheck") { - hipModuleLoadingMode_t mode; - HIP_CHECK(hipModuleGetLoadingMode(&mode)); - REQUIRE(mode == HIP_MODULE_LAZY_LOADING); -} -/** - * Test Description - * ------------------------ - * - Test case verifies the positive case of hipModuleGetLoadingMode API. - * - Verifies the Eager mode after setting the env var HIP_MODULE_LOADING. - * Test source - * ------------------------ - * - catch/unit/module/hipModuleGetLoadingMode.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 7.2 - */ -TEST_CASE("Unit_hipModuleGetLoadingMode_EagerModeCheck") { - hipModuleLoadingMode_t mode; - if (setenv("HIP_MODULE_LOADING", "EAGER", 1) != 0) { - HIP_CHECK(hipModuleGetLoadingMode(&mode)); - REQUIRE(mode == HIP_MODULE_LAZY_LOADING); // Default mode is lazy mode - } else { - HIP_CHECK(hipModuleGetLoadingMode(&mode)); - REQUIRE(mode == - HIP_MODULE_EAGER_LOADING); // if env var HIP_MODULE_LOADING = EAGER - } - unsetenv("HIP_MODULE_LOADING"); -} - -void kernelExecutionFunction(hipModule_t module) { - float *Ad, *Bd; - std::vector A(LEN, 1.0f), B(LEN, 0.0f); - HIP_CHECK(hipMalloc(&Ad, SIZE_BYTES)); - HIP_CHECK(hipMalloc(&Bd, SIZE_BYTES)); - HIP_CHECK(hipMemcpy(Ad, A.data(), SIZE_BYTES, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(Bd, B.data(), SIZE_BYTES, hipMemcpyHostToDevice)); - hipFunction_t Function = nullptr; - HIP_CHECK(hipModuleGetFunction(&Function, module, kernel_name)); - hipStream_t stream; - HIP_CHECK(hipStreamCreate(&stream)); - - struct { - void *_Ad; - void *_Bd; - } args; - args._Ad = reinterpret_cast(Ad); - args._Bd = reinterpret_cast(Bd); - size_t size = sizeof(args); - - void *config[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &args, - HIP_LAUNCH_PARAM_BUFFER_SIZE, &size, HIP_LAUNCH_PARAM_END}; - HIP_CHECK(hipModuleLaunchKernel(Function, 1, 1, 1, LEN, 1, 1, 0, stream, NULL, - reinterpret_cast(&config))); - HIP_CHECK(hipStreamDestroy(stream)); - - HIP_CHECK(hipMemcpy(B.data(), Bd, SIZE_BYTES, hipMemcpyDeviceToHost)); - - for (uint32_t i = 0; i < LEN; i++) { - REQUIRE(A[i] != B[i]); - } - HIP_CHECK(hipFree(Bd)); - HIP_CHECK(hipFree(Ad)); -} -/** - * Test Description - * ------------------------ - * - Test case verifies the positive case with kernel Launch. - * - Calcualtes the time taken for module load if the mode is Eager. - * Test source - * ------------------------ - * - catch/unit/module/hipModuleGetLoadingMode.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 7.2 - */ -TEST_CASE("Unit_hipModuleGetLoadingMode_EagerModeKernel") { - hipModuleLoadingMode_t mode; - hipModule_t module; - if (setenv("HIP_MODULE_LOADING", "EAGER", 1) == 0) { - HIP_CHECK(hipModuleGetLoadingMode(&mode)); - REQUIRE(mode == HIP_MODULE_EAGER_LOADING); - auto start = std::chrono::high_resolution_clock::now(); - HIP_CHECK(hipModuleLoad(&module, codeObjFile)); - auto stop = std::chrono::high_resolution_clock::now(); - auto result = std::chrono::duration(stop - start); - std::cout << "Time taken for Eager mode:" << result.count() - << " milliSeconds" << std::endl; - kernelExecutionFunction(module); - HIP_CHECK(hipModuleUnload(module)); - } - unsetenv("HIP_MODULE_LOADING"); -} -/** - * Test Description - * ------------------------ - * - Test case verifies the positive case with kernel Launch. - * - Calcualtes the time taken for module load if the mode is Lazy. - * Test source - * ------------------------ - * - catch/unit/module/hipModuleGetLoadingMode.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 7.2 - */ -TEST_CASE("Unit_hipModuleGetLoadingMode_LazyModeKernel") { - hipModuleLoadingMode_t mode; - hipModule_t module; - HIP_CHECK(hipModuleGetLoadingMode(&mode)); - REQUIRE(mode == HIP_MODULE_LAZY_LOADING); - auto start = std::chrono::high_resolution_clock::now(); - HIP_CHECK(hipModuleLoad(&module, codeObjFile)); - auto stop = std::chrono::high_resolution_clock::now(); - auto result = std::chrono::duration(stop - start); - std::cout << "Time taken for Lazy mode:" << result.count() << " milliSeconds" - << std::endl; - kernelExecutionFunction(module); - HIP_CHECK(hipModuleUnload(module)); -} -void setMode() { setenv("HIP_MODULE_LOADING", "EAGER", 1); } - -void ChkMode() { - hipModuleLoadingMode_t mode; - HIP_CHECK(hipModuleGetLoadingMode(&mode)); - REQUIRE(mode == HIP_MODULE_EAGER_LOADING); - unsetenv("HIP_MODULE_LOADING"); -} -/** - * Test Description - * ------------------------ - * - Test case verifies the multithread Scenario. - * - Set mode Env in one thread. Verify mode in another thread. - * Test source - * ------------------------ - * - catch/unit/module/hipModuleGetLoadingMode.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 7.2 - */ -TEST_CASE("Unit_hipModuleGetLoadingMode_MultiThread") { - // Create Thraed one. - std::thread t1(setMode); - t1.join(); - // Create Thread two - std::thread t2(ChkMode); - t2.join(); -} -/** - * End doxygen group ModuleTest. - * @} - */ diff --git a/catch/unit/module/hipModuleGetTexRef.cc b/catch/unit/module/hipModuleGetTexRef.cc index de95d78b6..fc2e0b33b 100644 --- a/catch/unit/module/hipModuleGetTexRef.cc +++ b/catch/unit/module/hipModuleGetTexRef.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip_module_common.hh" @@ -32,14 +17,14 @@ static hipModule_t GetModule() { return mg.module(); } -TEST_CASE("Unit_hipModuleGetTexRef_Positive_Basic") { +TEST_CASE(Unit_hipModuleGetTexRef_Positive_Basic) { CHECK_IMAGE_SUPPORT hipTexRef tex_ref = nullptr; HIP_CHECK(hipModuleGetTexRef(&tex_ref, GetModule(), "tex")); REQUIRE(tex_ref != nullptr); } -TEST_CASE("Unit_hipModuleGetTexRef_Negative_Parameters") { +TEST_CASE(Unit_hipModuleGetTexRef_Negative_Parameters) { CHECK_IMAGE_SUPPORT hipModule_t module = GetModule(); hipTexRef tex_ref = nullptr; @@ -57,7 +42,7 @@ TEST_CASE("Unit_hipModuleGetTexRef_Negative_Parameters") { } } -TEST_CASE("Unit_hipModuleGetTexRef_Negative_Hmod_Is_Nullptr") { +TEST_CASE(Unit_hipModuleGetTexRef_Negative_Hmod_Is_Nullptr) { CHECK_IMAGE_SUPPORT hipTexRef tex_ref = nullptr; @@ -66,7 +51,7 @@ TEST_CASE("Unit_hipModuleGetTexRef_Negative_Hmod_Is_Nullptr") { CTX_DESTROY(); } -TEST_CASE("Unit_hipModuleGetTexRef_Negative_Name_Is_Empty_String") { +TEST_CASE(Unit_hipModuleGetTexRef_Negative_Name_Is_Empty_String) { CHECK_IMAGE_SUPPORT hipModule_t module = GetModule(); hipTexRef tex_ref = nullptr; diff --git a/catch/unit/module/hipModuleLaunchCooperativeKernel.cc b/catch/unit/module/hipModuleLaunchCooperativeKernel.cc index 2c25b943a..4c679fdf8 100644 --- a/catch/unit/module/hipModuleLaunchCooperativeKernel.cc +++ b/catch/unit/module/hipModuleLaunchCooperativeKernel.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipModuleLaunchCooperativeKernel hipModuleLaunchCooperativeKernel @@ -49,7 +33,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Positive_Basic") { +TEST_CASE(Unit_hipModuleLaunchCooperativeKernel_Positive_Basic) { auto mg = ModuleGuard::InitModule("launch_kernel_module.code"); if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); @@ -89,7 +73,7 @@ TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Positive_Parameters") { +TEST_CASE(Unit_hipModuleLaunchCooperativeKernel_Positive_Parameters) { auto mg = ModuleGuard::InitModule("launch_kernel_module.code"); if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); @@ -125,7 +109,7 @@ TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Positive_Parameters") { * ------------------------ * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Negative_Parameters") { +TEST_CASE(Unit_hipModuleLaunchCooperativeKernel_Negative_Parameters) { auto mg = ModuleGuard::InitModule("launch_kernel_module.code"); if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); @@ -224,7 +208,7 @@ TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipModuleLaunchCooperativeKernel_Verify_Capture") { +TEST_CASE(Unit_hipModuleLaunchCooperativeKernel_Verify_Capture) { if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); return; diff --git a/catch/unit/module/hipModuleLaunchCooperativeKernelMultiDevice.cc b/catch/unit/module/hipModuleLaunchCooperativeKernelMultiDevice.cc index d92235693..99f0e7797 100644 --- a/catch/unit/module/hipModuleLaunchCooperativeKernelMultiDevice.cc +++ b/catch/unit/module/hipModuleLaunchCooperativeKernelMultiDevice.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipModuleLaunchCooperativeKernelMultiDevice @@ -48,8 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipModuleLaunchCooperativeKernelMultiDevice_Positive_Basic", - "[multigpu]") { +TEST_CASE(Unit_hipModuleLaunchCooperativeKernelMultiDevice_Positive_Basic) { auto mg = ModuleGuard::InitModule("launch_kernel_module.code"); if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); @@ -107,9 +90,7 @@ TEST_CASE("Unit_hipModuleLaunchCooperativeKernelMultiDevice_Positive_Basic", * ------------------------ * - HIP_VERSION >= 5.5 */ -TEST_CASE( - "Unit_hipModuleLaunchCooperativeKernelMultiDevice_Negative_Parameters", - "[multigpu]") { +TEST_CASE(Unit_hipModuleLaunchCooperativeKernelMultiDevice_Negative_Parameters) { auto mg = ModuleGuard::InitModule("launch_kernel_module.code"); if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); @@ -227,9 +208,7 @@ TEST_CASE( * ------------------------ * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipModuleLaunchCooperativeKernelMultiDevice_Negative_" - "MultiKernelSameDevice", - "[multigpu]") { +TEST_CASE(Unit_hipModuleLaunchCooperativeKernelMultiDevice_Negative_MultiKernelSameDevice) { auto mg = ModuleGuard::InitModule("launch_kernel_module.code"); if (!DeviceAttributesSupport(0, hipDeviceAttributeCooperativeLaunch)) { HipTest::HIP_SKIP_TEST("CooperativeLaunch not supported"); diff --git a/catch/unit/module/hipModuleLaunchKernel.cc b/catch/unit/module/hipModuleLaunchKernel.cc index f402de26e..7fabc1e8f 100644 --- a/catch/unit/module/hipModuleLaunchKernel.cc +++ b/catch/unit/module/hipModuleLaunchKernel.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2023-2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "hip_module_launch_kernel_common.hh" #include @@ -32,17 +20,17 @@ static hipError_t hipModuleLaunchKernelWrapper(hipFunction_t f, uint32_t gridX, hStream, kernelParams, extra); } -TEST_CASE("Unit_hipModuleLaunchKernel_Positive_Basic") { +TEST_CASE(Unit_hipModuleLaunchKernel_Positive_Basic) { HIP_CHECK(hipFree(nullptr)); ModuleLaunchKernelPositiveBasic(); } -TEST_CASE("Unit_hipModuleLaunchKernel_Positive_Parameters") { +TEST_CASE(Unit_hipModuleLaunchKernel_Positive_Parameters) { HIP_CHECK(hipFree(nullptr)); ModuleLaunchKernelPositiveParameters(); } -TEST_CASE("Unit_hipModuleLaunchKernel_Negative_Parameters", "[multigpu]") { +TEST_CASE(Unit_hipModuleLaunchKernel_Negative_Parameters) { HIP_CHECK(hipFree(nullptr)); ModuleLaunchKernelNegativeParameters(); } @@ -303,7 +291,7 @@ bool Module_WorkGroup_Test() { return testStatus; } -TEST_CASE("Unit_hipModuleLaunchKernel_Fntl") { +TEST_CASE(Unit_hipModuleLaunchKernel_Fntl) { bool testStatus = false; SECTION("Negative test scenarios") { testStatus = Module_Negative_tests(); @@ -319,7 +307,7 @@ TEST_CASE("Unit_hipModuleLaunchKernel_Fntl") { } } -TEST_CASE("Unit_hipModuleLaunchKernel_Verify_Capture") { +TEST_CASE(Unit_hipModuleLaunchKernel_Verify_Capture) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/module/hipModuleLoad.cc b/catch/unit/module/hipModuleLoad.cc index ef197ba5b..46c1e0fcd 100644 --- a/catch/unit/module/hipModuleLoad.cc +++ b/catch/unit/module/hipModuleLoad.cc @@ -1,28 +1,13 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include -TEST_CASE("Unit_hipModuleLoad_Positive_Basic") { +TEST_CASE(Unit_hipModuleLoad_Positive_Basic) { HIP_CHECK(hipFree(nullptr)); hipModule_t module = nullptr; HIP_CHECK(hipModuleLoad(&module, "empty_module.code")); @@ -30,7 +15,7 @@ TEST_CASE("Unit_hipModuleLoad_Positive_Basic") { HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipModuleLoad_Negative_Parameters") { +TEST_CASE(Unit_hipModuleLoad_Negative_Parameters) { HIP_CHECK(hipFree(nullptr)); hipModule_t module; @@ -51,7 +36,7 @@ TEST_CASE("Unit_hipModuleLoad_Negative_Parameters") { } } -TEST_CASE("Unit_hipModuleLoad_Negative_Load_From_A_File_That_Is_Not_A_Module") { +TEST_CASE(Unit_hipModuleLoad_Negative_Load_From_A_File_That_Is_Not_A_Module) { HIP_CHECK(hipFree(nullptr)); hipModule_t module; diff --git a/catch/unit/module/hipModuleLoadData.cc b/catch/unit/module/hipModuleLoadData.cc index 608d5dc84..f5f49796d 100644 --- a/catch/unit/module/hipModuleLoadData.cc +++ b/catch/unit/module/hipModuleLoadData.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2023-2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip_module_common.hh" @@ -25,7 +12,7 @@ THE SOFTWARE. #include #include -TEST_CASE("Unit_hipModuleLoadData_Positive_Basic") { +TEST_CASE(Unit_hipModuleLoadData_Positive_Basic) { HIP_CHECK(hipFree(nullptr)); hipModule_t module = nullptr; @@ -84,7 +71,7 @@ TEST_CASE("Unit_hipModuleLoadData_Positive_Basic") { } } -TEST_CASE("Unit_hipModuleLoadData_Negative_Parameters") { +TEST_CASE(Unit_hipModuleLoadData_Negative_Parameters) { HIP_CHECK(hipFree(nullptr)); hipModule_t module; @@ -123,7 +110,7 @@ TEST_CASE("Unit_hipModuleLoadData_Negative_Parameters") { */ #if HT_AMD // Below test disabled for NVIDIA due to the defect SWDEV-472385 -TEST_CASE("Unit_hipModuleLoadData_Functional") { +TEST_CASE(Unit_hipModuleLoadData_Functional) { constexpr int LEN = 64; constexpr int SIZE = LEN << 2; constexpr auto FILENAME = "vcpy_kernel.code"; diff --git a/catch/unit/module/hipModuleLoadDataEx.cc b/catch/unit/module/hipModuleLoadDataEx.cc index 243a3c496..623d656b6 100644 --- a/catch/unit/module/hipModuleLoadDataEx.cc +++ b/catch/unit/module/hipModuleLoadDataEx.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip_module_common.hh" @@ -25,7 +10,7 @@ THE SOFTWARE. #include -TEST_CASE("Unit_hipModuleLoadDataEx_Positive_Basic") { +TEST_CASE(Unit_hipModuleLoadDataEx_Positive_Basic) { HIP_CHECK(hipFree(nullptr)); hipModule_t module = nullptr; @@ -44,7 +29,7 @@ TEST_CASE("Unit_hipModuleLoadDataEx_Positive_Basic") { } } -TEST_CASE("Unit_hipModuleLoadDataEx_Negative_Parameters") { +TEST_CASE(Unit_hipModuleLoadDataEx_Negative_Parameters) { HIP_CHECK(hipFree(nullptr)); hipModule_t module = nullptr; diff --git a/catch/unit/module/hipModuleLoadFatBinary.cc b/catch/unit/module/hipModuleLoadFatBinary.cc index 801680646..540aed5c0 100644 --- a/catch/unit/module/hipModuleLoadFatBinary.cc +++ b/catch/unit/module/hipModuleLoadFatBinary.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "hip_module_common.hh" #include #include @@ -39,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipModuleLoadFatBinary_NegativeTsts") { +TEST_CASE(Unit_hipModuleLoadFatBinary_NegativeTsts) { CTX_CREATE(); hipModule_t Module; SECTION("fatCubin as nullptr") { @@ -118,7 +106,7 @@ void loadKernelData(hipFunction_t kernel) { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipModuleLoadFatBinary_PosiiveTsts") { +TEST_CASE(Unit_hipModuleLoadFatBinary_PosiiveTsts) { hipModule_t Module; SECTION("Compiled module with regular target in compressed fatbin") { const auto loaded_module = diff --git a/catch/unit/module/hipModuleLoadMultProcessOnMultGPU.cc b/catch/unit/module/hipModuleLoadMultProcessOnMultGPU.cc index 625549138..5e0ceacf5 100644 --- a/catch/unit/module/hipModuleLoadMultProcessOnMultGPU.cc +++ b/catch/unit/module/hipModuleLoadMultProcessOnMultGPU.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -44,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipModuleLoad_MultProcess_MultGPU", "[multigpu]") { +TEST_CASE(Unit_hipModuleLoad_MultProcess_MultGPU) { int deviceCount{0}; HIP_CHECK(hipGetDeviceCount(&deviceCount)); REQUIRE(deviceCount != 0); diff --git a/catch/unit/module/hipModuleUnload.cc b/catch/unit/module/hipModuleUnload.cc index b71b4b6ef..b3dd126b9 100644 --- a/catch/unit/module/hipModuleUnload.cc +++ b/catch/unit/module/hipModuleUnload.cc @@ -1,32 +1,20 @@ /* -Copyright (c) 2023-2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include -TEST_CASE("Unit_hipModuleUnload_Negative_Module_Is_Nullptr") { +TEST_CASE(Unit_hipModuleUnload_Negative_Module_Is_Nullptr) { HIP_CHECK(hipFree(nullptr)); HIP_CHECK_ERROR(hipModuleUnload(nullptr), hipErrorInvalidResourceHandle); } -TEST_CASE("Unit_hipModuleUnload_Negative_Double_Unload") { +TEST_CASE(Unit_hipModuleUnload_Negative_Double_Unload) { HIP_CHECK(hipFree(nullptr)); hipModule_t module = nullptr; @@ -57,7 +45,7 @@ TEST_CASE("Unit_hipModuleUnload_Negative_Double_Unload") { * ------------------------ * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipModuleLoad_basic") { +TEST_CASE("Unit_hipModuleUnload_basic") { CTX_CREATE(); constexpr auto fileName = "vcpy_kernel.code"; hipModule_t module; diff --git a/catch/unit/module/hip_module_common.cc b/catch/unit/module/hip_module_common.cc index 657f364f7..05eef81f5 100644 --- a/catch/unit/module/hip_module_common.cc +++ b/catch/unit/module/hip_module_common.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip_module_common.hh" diff --git a/catch/unit/module/hip_module_common.hh b/catch/unit/module/hip_module_common.hh index 165edd272..a1eac81ec 100644 --- a/catch/unit/module/hip_module_common.hh +++ b/catch/unit/module/hip_module_common.hh @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/module/hip_module_launch_kernel_common.hh b/catch/unit/module/hip_module_launch_kernel_common.hh index 72424322a..4a4939c59 100644 --- a/catch/unit/module/hip_module_launch_kernel_common.hh +++ b/catch/unit/module/hip_module_launch_kernel_common.hh @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/module/kernel_composite_test.cpp b/catch/unit/module/kernel_composite_test.cpp index 028c69d0c..acc74deed 100644 --- a/catch/unit/module/kernel_composite_test.cpp +++ b/catch/unit/module/kernel_composite_test.cpp @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include constexpr int GLOBAL_BUF_SIZE = 2048; diff --git a/catch/unit/module/kernel_count.cpp b/catch/unit/module/kernel_count.cpp index 7ee51600b..efe02dcae 100644 --- a/catch/unit/module/kernel_count.cpp +++ b/catch/unit/module/kernel_count.cpp @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include extern "C" __device__ void hello_world_2(float* a, float* b) { diff --git a/catch/unit/module/launch_kernel_module.cc b/catch/unit/module/launch_kernel_module.cc index 4ae3310c4..aaf97400b 100644 --- a/catch/unit/module/launch_kernel_module.cc +++ b/catch/unit/module/launch_kernel_module.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/module/managed_kernel.cpp b/catch/unit/module/managed_kernel.cpp index c8b19e738..534078567 100644 --- a/catch/unit/module/managed_kernel.cpp +++ b/catch/unit/module/managed_kernel.cpp @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include __managed__ int x = 10; diff --git a/catch/unit/module/matmul.cpp b/catch/unit/module/matmul.cpp index 833b69f19..4f7b233f7 100644 --- a/catch/unit/module/matmul.cpp +++ b/catch/unit/module/matmul.cpp @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include __device__ int deviceGlobal = 1; diff --git a/catch/unit/module/testhipModuleLoadUnloadFunc_exe.cc b/catch/unit/module/testhipModuleLoadUnloadFunc_exe.cc index 3718ca98f..6096e5b5d 100644 --- a/catch/unit/module/testhipModuleLoadUnloadFunc_exe.cc +++ b/catch/unit/module/testhipModuleLoadUnloadFunc_exe.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include diff --git a/catch/unit/module/vcpy_kernel.cpp b/catch/unit/module/vcpy_kernel.cpp index 2fe6d1ef1..9f4670e7b 100644 --- a/catch/unit/module/vcpy_kernel.cpp +++ b/catch/unit/module/vcpy_kernel.cpp @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include extern "C" __global__ void hello_world(float* a, float* b) { diff --git a/catch/unit/multiThread/CMakeLists.txt b/catch/unit/multiThread/CMakeLists.txt index 8c77831a7..43a6b36f9 100644 --- a/catch/unit/multiThread/CMakeLists.txt +++ b/catch/unit/multiThread/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC hipMemsetAsyncMultiThread.cc diff --git a/catch/unit/multiThread/hipMemsetAsyncMultiThread.cc b/catch/unit/multiThread/hipMemsetAsyncMultiThread.cc index 37a6f966f..7003baf20 100644 --- a/catch/unit/multiThread/hipMemsetAsyncMultiThread.cc +++ b/catch/unit/multiThread/hipMemsetAsyncMultiThread.cc @@ -1,20 +1,7 @@ /* - * 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 - * 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 WARRANNTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ #include @@ -143,7 +130,7 @@ template void launchThreads(Func f, TestType type) { } } -TEST_CASE("Unit_hipMemsetAsync_QueueJobsMultithreaded") { +TEST_CASE(Unit_hipMemsetAsync_QueueJobsMultithreaded) { using hipMemsetAsync_t = hipError_t (*)(void*, int, const size_t, hipStream_t); using hipMemsetAsyncD8_t = hipError_t (*)(hipDeviceptr_t, unsigned char, const size_t, hipStream_t); diff --git a/catch/unit/multiThread/hipMultiThreadDevice.cc b/catch/unit/multiThread/hipMultiThreadDevice.cc index 1cec0f9ce..c3691fe41 100644 --- a/catch/unit/multiThread/hipMultiThreadDevice.cc +++ b/catch/unit/multiThread/hipMultiThreadDevice.cc @@ -86,13 +86,13 @@ void multiThread_nearzero(bool serialize, int iters) { } } -TEST_CASE("Unit_hipMultiThreadDevice_Streams") { +TEST_CASE(Unit_hipMultiThreadDevice_Streams) { // Serial version, just call once: createThenDestroyStreams(10, 10); } -TEST_CASE("Unit_hipMultiThreadDevice_SerialPyramid") { multiThread_pyramid(true, 3); } +TEST_CASE(Unit_hipMultiThreadDevice_SerialPyramid) { multiThread_pyramid(true, 3); } -TEST_CASE("Unit_hipMultiThreadDevice_ParallelPyramid") { multiThread_pyramid(false, 3); } +TEST_CASE(Unit_hipMultiThreadDevice_ParallelPyramid) { multiThread_pyramid(false, 3); } -TEST_CASE("Unit_hipMultiThreadDevice_NearZero") { multiThread_nearzero(false, 1000); } +TEST_CASE(Unit_hipMultiThreadDevice_NearZero) { multiThread_nearzero(false, 1000); } diff --git a/catch/unit/multiThread/hipMultiThreadStreams1.cc b/catch/unit/multiThread/hipMultiThreadStreams1.cc index 1bfed446d..8f520a554 100644 --- a/catch/unit/multiThread/hipMultiThreadStreams1.cc +++ b/catch/unit/multiThread/hipMultiThreadStreams1.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -103,7 +87,7 @@ void test_multiThread_1(hipStream_t stream0, hipStream_t stream1, bool serialize HIPCHECK(hipDeviceSynchronize()); }; -TEST_CASE("Unit_hipMultiThreadStreams1_AsyncSync") { +TEST_CASE(Unit_hipMultiThreadStreams1_AsyncSync) { hipStream_t stream; HIPCHECK(hipStreamCreate(&stream)); @@ -113,7 +97,7 @@ TEST_CASE("Unit_hipMultiThreadStreams1_AsyncSync") { HIPCHECK(hipStreamDestroy(stream)); } -TEST_CASE("Unit_hipMultiThreadStreams1_AsyncAsync") { +TEST_CASE(Unit_hipMultiThreadStreams1_AsyncAsync) { hipStream_t stream0, stream1; HIPCHECK(hipStreamCreate(&stream0)); HIPCHECK(hipStreamCreate(&stream1)); @@ -125,7 +109,7 @@ TEST_CASE("Unit_hipMultiThreadStreams1_AsyncAsync") { HIPCHECK(hipStreamDestroy(stream0)); HIPCHECK(hipStreamDestroy(stream1)); } -TEST_CASE("Unit_hipMultiThreadStreams1_AsyncSame") { +TEST_CASE(Unit_hipMultiThreadStreams1_AsyncSame) { hipStream_t stream; HIPCHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/multiThread/hipMultiThreadStreams2.cc b/catch/unit/multiThread/hipMultiThreadStreams2.cc index 4bc1f876b..de3fbc545 100644 --- a/catch/unit/multiThread/hipMultiThreadStreams2.cc +++ b/catch/unit/multiThread/hipMultiThreadStreams2.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ // This file is a port from hiprocclrtests (hipMultiThreadStreams2) @@ -121,7 +105,7 @@ void run(size_t size, hipStream_t stream1, hipStream_t stream2) { HIPCHECK(hipFree(Cdd)); HIPCHECK(hipFree(Ddd)); } -TEST_CASE("Unit_hipMultiThreadStreams2") { +TEST_CASE(Unit_hipMultiThreadStreams2) { int iterations = 100; hipStream_t stream[3]; diff --git a/catch/unit/occupancy/CMakeLists.txt b/catch/unit/occupancy/CMakeLists.txt index df34c201b..22f72fab1 100644 --- a/catch/unit/occupancy/CMakeLists.txt +++ b/catch/unit/occupancy/CMakeLists.txt @@ -1,9 +1,11 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC hipOccupancyMaxActiveBlocksPerMultiprocessor.cc - hipOccupancyMaxActiveBlocksPerMultiprocessor_old.cc hipOccupancyMaxPotentialBlockSize.cc - hipOccupancyMaxPotentialBlockSize_old.cc hipModuleOccupancyMaxPotentialBlockSize.cc hipModuleOccupancyMaxPotentialBlockSizeWithFlags.cc hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc @@ -13,13 +15,21 @@ set(TEST_SRC hipOccupancyAvailableDynamicSMemPerBlock.cc ) -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} +if (HIP_PLATFORM MATCHES "amd") + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/simple_kernel.cc -o simple_kernel.code -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/simple_kernel.cc) - +else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/simple_kernel.cc + -o simple_kernel.code + -I${HIP_INCLUDE_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/simple_kernel.cc) +endif() add_custom_target(simple_kernel ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code) set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code) hip_add_exe_to_target(NAME OccupancyTest diff --git a/catch/unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc b/catch/unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc index 805f2abf5..5ffff3b81 100644 --- a/catch/unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc +++ b/catch/unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation - Test correct @@ -26,7 +14,7 @@ execution of hipModuleOccupancyMaxActiveBlocksPerMultiprocessor api when paramet #include #include "occupancy_common.hh" -TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters") { +TEST_CASE(Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters) { hipModule_t module; hipFunction_t function; int blockSize = 0; @@ -51,7 +39,7 @@ TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Para HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation") { +TEST_CASE(Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation) { hipDeviceProp_t devProp; hipModule_t module; hipFunction_t function; @@ -101,7 +89,7 @@ TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessor_Positive_Rang * ------------------------ * - unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc */ -TEST_CASE("Unit_OccupancyAPIs_StreamCapture") { +TEST_CASE(Unit_OccupancyAPIs_StreamCapture) { GENERATE_CAPTURE(); hipStream_t stream; diff --git a/catch/unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc b/catch/unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc index 8df78e448..869988b17 100644 --- a/catch/unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc +++ b/catch/unit/occupancy/hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Positive_RangeValidation - Test @@ -27,7 +15,7 @@ parameters are invalid */ #include "occupancy_common.hh" -TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Negative_Parameters") { +TEST_CASE(Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Negative_Parameters) { hipModule_t module; hipFunction_t function; int numBlocks = 0; @@ -60,8 +48,7 @@ TEST_CASE("Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Nega HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE( - "Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Positive_RangeValidation") { +TEST_CASE(Unit_hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_Positive_RangeValidation) { hipDeviceProp_t devProp; hipModule_t module; hipFunction_t function; diff --git a/catch/unit/occupancy/hipModuleOccupancyMaxPotentialBlockSize.cc b/catch/unit/occupancy/hipModuleOccupancyMaxPotentialBlockSize.cc index 6f49b9efe..6819e1528 100644 --- a/catch/unit/occupancy/hipModuleOccupancyMaxPotentialBlockSize.cc +++ b/catch/unit/occupancy/hipModuleOccupancyMaxPotentialBlockSize.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipModuleOccupancyMaxPotentialBlockSize_Positive_RangeValidation - Test correct execution of @@ -25,7 +13,7 @@ hipModuleOccupancyMaxPotentialBlockSize api when parameters are invalid */ #include "occupancy_common.hh" -TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSize_Negative_Parameters") { +TEST_CASE(Unit_hipModuleOccupancyMaxPotentialBlockSize_Negative_Parameters) { hipModule_t module; hipFunction_t function; @@ -42,7 +30,7 @@ TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSize_Negative_Parameters") { HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSize_Positive_RangeValidation") { +TEST_CASE(Unit_hipModuleOccupancyMaxPotentialBlockSize_Positive_RangeValidation) { hipDeviceProp_t devProp; hipModule_t module; hipFunction_t function; diff --git a/catch/unit/occupancy/hipModuleOccupancyMaxPotentialBlockSizeWithFlags.cc b/catch/unit/occupancy/hipModuleOccupancyMaxPotentialBlockSizeWithFlags.cc index 50107b465..0b320deea 100644 --- a/catch/unit/occupancy/hipModuleOccupancyMaxPotentialBlockSizeWithFlags.cc +++ b/catch/unit/occupancy/hipModuleOccupancyMaxPotentialBlockSizeWithFlags.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Positive_RangeValidation - Test correct @@ -25,7 +13,7 @@ execution of hipModuleOccupancyMaxPotentialBlockSizeWithFlags api when parameter */ #include "occupancy_common.hh" -TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Negative_Parameters") { +TEST_CASE(Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Negative_Parameters) { hipModule_t module; hipFunction_t function; int blockSize = 0; @@ -52,7 +40,7 @@ TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Negative_Parame HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Positive_RangeValidation") { +TEST_CASE(Unit_hipModuleOccupancyMaxPotentialBlockSizeWithFlags_Positive_RangeValidation) { hipDeviceProp_t devProp; hipModule_t module; hipFunction_t function; diff --git a/catch/unit/occupancy/hipOccupancyAvailableDynamicSMemPerBlock.cc b/catch/unit/occupancy/hipOccupancyAvailableDynamicSMemPerBlock.cc index 063e9057d..6b9a9c7d8 100644 --- a/catch/unit/occupancy/hipOccupancyAvailableDynamicSMemPerBlock.cc +++ b/catch/unit/occupancy/hipOccupancyAvailableDynamicSMemPerBlock.cc @@ -1,22 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @brief Returns dynamic shared memory available per block when launching @@ -67,7 +54,7 @@ static __global__ void f1(float *a) { *a = 1.0; } * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipOccupancyAvailableDynamicSMemPerBlock_Negative") { +TEST_CASE(Unit_hipOccupancyAvailableDynamicSMemPerBlock_Negative) { size_t dynamicSmemSize; int numBlocks = 1; SECTION("Number of blocks are zero") { @@ -108,7 +95,7 @@ TEST_CASE("Unit_hipOccupancyAvailableDynamicSMemPerBlock_Negative") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipOccupancyAvailableDynamicSMemPerBlock_Positive") { +TEST_CASE(Unit_hipOccupancyAvailableDynamicSMemPerBlock_Positive) { size_t dynamicSmemSize = 0; int numBlocks = 1; int inputArray[SIZE], expectedOutput[SIZE], actualOutput[SIZE]; diff --git a/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor.cc b/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor.cc index 6199f45c3..11b61637e 100644 --- a/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor.cc +++ b/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation - Test correct execution @@ -26,12 +14,13 @@ Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters - Test uns of hipOccupancyMaxActiveBlocksPerMultiprocessor api when parameters are invalid */ #include "occupancy_common.hh" +#include static __global__ void f1(float* a) { *a = 1.0; } template static __global__ void f2(T* a) { *a = 1; } -TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters") { +TEST_CASE(Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters) { int numBlocks = 0; int blockSize = 0; int gridSize = 0; @@ -51,9 +40,15 @@ TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Negative_Parameters HIP_CHECK_ERROR(hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks, NULL, blockSize, 0), hipErrorInvalidDeviceFunction); } + + SECTION("Block size is 0 and dynSharedMemPerBlk is max") { + const hipError_t ret = hipOccupancyMaxActiveBlocksPerMultiprocessor( + &numBlocks, f1, 0, std::numeric_limits::max()); + REQUIRE(ret != hipSuccess); + } } -TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation") { +TEST_CASE(Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValidation) { hipDeviceProp_t devProp; int blockSize = 0; int gridSize = 0; @@ -84,7 +79,7 @@ TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Positive_RangeValid } } -TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Positive_TemplateInvocation") { +TEST_CASE(Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Positive_TemplateInvocation) { hipDeviceProp_t devProp; int blockSize = 0; int gridSize = 0; diff --git a/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc b/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc index 12055a929..1f652a7ae 100644 --- a/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc +++ b/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -47,7 +34,7 @@ static __global__ void kern1(int* t) { *t = 1; } * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_ValidArgs") { +TEST_CASE(Unit_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_ValidArgs) { hipError_t err; SECTION("hipOccupancyDefault no shared memory") { @@ -98,7 +85,7 @@ TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_ValidArgs" * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_InvalidArgs") { +TEST_CASE(Unit_hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_InvalidArgs) { hipError_t err; SECTION("Zero block size") { diff --git a/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor_old.cc b/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor_old.cc deleted file mode 100644 index 0fe46b0cc..000000000 --- a/catch/unit/occupancy/hipOccupancyMaxActiveBlocksPerMultiprocessor_old.cc +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright (c) 2021 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 - -static __global__ void f1(float* a) { *a = 1.0; } - -template static __global__ void f2(T* a) { *a = 1; } - -/** - * Defines - */ -#define OccupancyDisableCachingOverride 0x01 - -TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_Negative") { - hipError_t ret; - int numBlock = 0, blockSize = 0; - int gridSize = 0, defBlkSize = 32; - - // Get potential blocksize - HIP_CHECK(hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, f1, 0, 0)); - - // Validate each argument - ret = hipOccupancyMaxActiveBlocksPerMultiprocessor(NULL, f1, blockSize, 0); - REQUIRE(ret != hipSuccess); - - ret = hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, NULL, blockSize, 0); - REQUIRE(ret != hipSuccess); - - ret = hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, f1, 0, 0); - REQUIRE(ret != hipSuccess); - - ret = hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, f1, 0, - std::numeric_limits::max()); - REQUIRE(ret != hipSuccess); - - ret = hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(&numBlock, f1, defBlkSize, 0, - OccupancyDisableCachingOverride); - REQUIRE(ret == hipSuccess); -} - -TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_rangeValidation") { - hipDeviceProp_t devProp; - int numBlock = 0, blockSize = 0; - int gridSize = 0; - - // Get potential blocksize - HIP_CHECK(hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, f1, 0, 0)); - - HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); - - HIP_CHECK(hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, f1, blockSize, 0)); - - // Check if numBlocks and blockSize are within limits - REQUIRE(numBlock > 0); - REQUIRE((numBlock * blockSize) <= devProp.maxThreadsPerMultiProcessor); - - // Validate numBlock after passing dynSharedMemPerBlk - HIP_CHECK(hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, f1, blockSize, - devProp.sharedMemPerBlock)); - - // Check if numBlocks and blockSize are within limits - REQUIRE(numBlock > 0); - REQUIRE((numBlock * blockSize) <= devProp.maxThreadsPerMultiProcessor); -} - -TEST_CASE("Unit_hipOccupancyMaxActiveBlocksPerMultiprocessor_templateInvocation") { - int blockSize = 32; - int numBlock = 0; - - HIP_CHECK( - hipOccupancyMaxActiveBlocksPerMultiprocessor(&numBlock, f2, blockSize, 0)); - REQUIRE(numBlock > 0); -} diff --git a/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSize.cc b/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSize.cc index c496694ae..5cd63fc23 100644 --- a/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSize.cc +++ b/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSize.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipOccupancyMaxPotentialBlockSize_Positive_RangeValidation - Test correct execution of @@ -31,7 +19,7 @@ static __global__ void f1(float* a) { *a = 1.0; } template static __global__ void f2(T* a) { *a = 1; } -TEST_CASE("Unit_hipOccupancyMaxPotentialBlockSize_Negative_Parameters") { +TEST_CASE(Unit_hipOccupancyMaxPotentialBlockSize_Negative_Parameters) { // Common negative tests MaxPotentialBlockSizeNegative([](int* gridSize, int* blockSize) { return hipOccupancyMaxPotentialBlockSize(gridSize, blockSize, f1, 0, 0); @@ -50,7 +38,7 @@ TEST_CASE("Unit_hipOccupancyMaxPotentialBlockSize_Negative_Parameters") { #endif } -TEST_CASE("Unit_hipOccupancyMaxPotentialBlockSize_Positive_RangeValidation") { +TEST_CASE(Unit_hipOccupancyMaxPotentialBlockSize_Positive_RangeValidation) { hipDeviceProp_t devProp; HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); @@ -73,7 +61,7 @@ TEST_CASE("Unit_hipOccupancyMaxPotentialBlockSize_Positive_RangeValidation") { } } -TEST_CASE("Unit_hipOccupancyMaxPotentialBlockSize_Positive_TemplateInvocation") { +TEST_CASE(Unit_hipOccupancyMaxPotentialBlockSize_Positive_TemplateInvocation) { hipDeviceProp_t devProp; HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); diff --git a/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags.cc b/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags.cc index 7ff7f7e7f..d24959689 100644 --- a/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags.cc +++ b/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2022 - 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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #define SHARED_MEM_CONST 256 @@ -81,7 +69,7 @@ void hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_chkRange(int block_size_limi - for 0 < block_size_limit < attr.maxThreadsPerBlock - for block_size_limit > attr.maxThreadsPerBlock */ -TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_chkRange") { +TEST_CASE(Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_chkRange) { hipDeviceProp_t devProp; // Get current device property HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); @@ -108,8 +96,7 @@ TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_chkRange") { - for 0 < block_size_limit < attr.maxThreadsPerBlock - for block_size_limit > attr.maxThreadsPerBlock */ -TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_mgpu", - "[multigpu]") { +TEST_CASE(Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_mgpu) { int devcount = 0; HIP_CHECK(hipGetDeviceCount(&devcount)); // If only single GPU is detected then return @@ -135,7 +122,7 @@ TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_mgpu", Check the basic functionality of hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags by passing a functor as 4th parameter. */ -TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_Functor") { +TEST_CASE(Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_Functor) { hipDeviceProp_t devProp; HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); functorBlockSizeToDynamicSMemSize testFunc(SHARED_MEM_CONST); @@ -155,7 +142,7 @@ TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_Functor") { Check the basic functionality of hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags by passing a lambda function as 4th parameter. */ -TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_Lambda") { +TEST_CASE(Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_Lambda) { hipDeviceProp_t devProp; HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); auto testFunc = [](const int blockSize) { @@ -189,7 +176,7 @@ TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_Lambda") { - null func - Invalid flag */ -TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_NegTst") { +TEST_CASE(Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_NegTst) { hipError_t ret; int minGridSize = 0, blockSize = 0; @@ -294,7 +281,7 @@ static size_t getMaxDynShMem(int blocksize) { Using the derived gridsize and blocksize launch the kernel and validate its output. */ -TEST_CASE("Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_Functional") { +TEST_CASE(Unit_hipOccupancyMaxPotBlkSizeVariableSMemWithFlags_Functional) { hipDeviceProp_t devProp; HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); SECTION("Non Dynamic Shared Kernel") { diff --git a/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSize_old.cc b/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSize_old.cc deleted file mode 100644 index e0dac155e..000000000 --- a/catch/unit/occupancy/hipOccupancyMaxPotentialBlockSize_old.cc +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright (c) 2021 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 - -static __global__ void f1(float* a) { *a = 1.0; } - -template static __global__ void f2(T* a) { *a = 1; } - -TEST_CASE("Unit_hipOccupancyMaxPotentialBlockSize_Negative") { - hipError_t ret; - int blockSize = 0; - int gridSize = 0; - - // Validate each argument - ret = hipOccupancyMaxPotentialBlockSize(NULL, &blockSize, f1, 0, 0); - REQUIRE(ret != hipSuccess); - - ret = hipOccupancyMaxPotentialBlockSize(&gridSize, NULL, f1, 0, 0); - REQUIRE(ret != hipSuccess); - -#ifndef __HIP_PLATFORM_NVIDIA__ - // nvcc doesnt support kernelfunc(NULL) for api - ret = hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, NULL, 0, 0); - REQUIRE(ret != hipSuccess); -#endif -} - -TEST_CASE("Unit_hipOccupancyMaxPotentialBlockSize_rangeValidation") { - hipDeviceProp_t devProp; - int blockSize = 0; - int gridSize = 0; - - // Get potential blocksize - HIP_CHECK(hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, f1, 0, 0)); - - HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); - - // Check if blockSize doen't exceed maxThreadsPerBlock - REQUIRE(gridSize > 0); - REQUIRE(blockSize > 0); - REQUIRE(blockSize <= devProp.maxThreadsPerBlock); - - // Pass dynSharedMemPerBlk, blockSizeLimit and check out param - blockSize = 0; - gridSize = 0; - - HIP_CHECK(hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, f1, devProp.sharedMemPerBlock, - devProp.maxThreadsPerBlock)); - - // Check if blockSize doen't exceed maxThreadsPerBlock - REQUIRE(gridSize > 0); - REQUIRE(blockSize > 0); - REQUIRE(blockSize <= devProp.maxThreadsPerBlock); -} - -TEST_CASE("Unit_hipOccupancyMaxPotentialBlockSize_templateInvocation") { - int gridSize = 0, blockSize = 0; - - HIP_CHECK(hipOccupancyMaxPotentialBlockSize(&gridSize, &blockSize, f2, 0, 0)); - REQUIRE(gridSize > 0); - REQUIRE(blockSize > 0); -} diff --git a/catch/unit/occupancy/occupancy_common.hh b/catch/unit/occupancy/occupancy_common.hh index 5d71c7dac..8bfedc375 100644 --- a/catch/unit/occupancy/occupancy_common.hh +++ b/catch/unit/occupancy/occupancy_common.hh @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #pragma once #include diff --git a/catch/unit/occupancy/simple_kernel.cc b/catch/unit/occupancy/simple_kernel.cc index 2b7b1e5f0..89ab4af5e 100644 --- a/catch/unit/occupancy/simple_kernel.cc +++ b/catch/unit/occupancy/simple_kernel.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/p2p/CMakeLists.txt b/catch/unit/p2p/CMakeLists.txt index e19dffd17..448ccb2d5 100644 --- a/catch/unit/p2p/CMakeLists.txt +++ b/catch/unit/p2p/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms # moved hipDeviceGetP2PAttribute.cc from /catch/unit/device to # /catch/unit/p2p folder and its dependent files. @@ -14,9 +18,7 @@ if(HIP_PLATFORM MATCHES "amd") endif() add_executable(hipDeviceGetP2PAttribute_exe EXCLUDE_FROM_ALL hipDeviceGetP2PAttribute_exe.cc) -set_source_files_properties(hipDeviceGetP2PAttribute_exe.cc PROPERTIES LANGUAGE HIP) -set_target_properties(hipDeviceGetP2PAttribute_exe PROPERTIES LINKER_LANGUAGE HIP) -target_link_libraries(hipDeviceGetP2PAttribute_exe hip::host hip::device) +set_source_files_properties(hipDeviceGetP2PAttribute_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipDeviceGetP2PAttribute_exe) diff --git a/catch/unit/p2p/hipDeviceGetP2PAttribute.cc b/catch/unit/p2p/hipDeviceGetP2PAttribute.cc index 6c0168e98..8a1fd4890 100644 --- a/catch/unit/p2p/hipDeviceGetP2PAttribute.cc +++ b/catch/unit/p2p/hipDeviceGetP2PAttribute.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022 - 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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -60,7 +47,7 @@ THE SOFTWARE. * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipDeviceGetP2PAttribute_Basic") { +TEST_CASE(Unit_hipDeviceGetP2PAttribute_Basic) { #if HT_AMD HipTest::HIP_SKIP_TEST("EXSWCPHIPT-119"); return; @@ -120,7 +107,7 @@ TEST_CASE("Unit_hipDeviceGetP2PAttribute_Basic") { * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDeviceGetP2PAttribute_Negative") { +TEST_CASE(Unit_hipDeviceGetP2PAttribute_Negative) { #if HT_AMD HipTest::HIP_SKIP_TEST("EXSWCPHIPT-122"); return; diff --git a/catch/unit/p2p/hipDeviceGetP2PAttribute_exe.cc b/catch/unit/p2p/hipDeviceGetP2PAttribute_exe.cc index ff97b83bf..b8614f824 100644 --- a/catch/unit/p2p/hipDeviceGetP2PAttribute_exe.cc +++ b/catch/unit/p2p/hipDeviceGetP2PAttribute_exe.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "hip/hip_runtime_api.h" diff --git a/catch/unit/p2p/hipP2pLinkTypeAndHopFunc.cc b/catch/unit/p2p/hipP2pLinkTypeAndHopFunc.cc index 70dd8ce15..27e7e8bd6 100644 --- a/catch/unit/p2p/hipP2pLinkTypeAndHopFunc.cc +++ b/catch/unit/p2p/hipP2pLinkTypeAndHopFunc.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hipP2pLinkTypeAndHopFunc.h" #include @@ -297,7 +284,7 @@ bool testhipLinkTypeHopcountDevice(int numDevices) { * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_hipP2pLinkTypeAndHopFunc") { +TEST_CASE(Unit_hipP2pLinkTypeAndHopFunc) { int numDevices = 0; bool TestPassed = true; HIP_CHECK(hipGetDeviceCount(&numDevices)); diff --git a/catch/unit/p2p/hipP2pLinkTypeAndHopFunc.h b/catch/unit/p2p/hipP2pLinkTypeAndHopFunc.h index 16f903fb7..bb90efc6f 100644 --- a/catch/unit/p2p/hipP2pLinkTypeAndHopFunc.h +++ b/catch/unit/p2p/hipP2pLinkTypeAndHopFunc.h @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #ifndef _HIP_DIRTEST_P2PLINKTYPEHOP_H_ #define _HIP_DIRTEST_P2PLINKTYPEHOP_H_ diff --git a/catch/unit/printf/CMakeLists.txt b/catch/unit/printf/CMakeLists.txt index 4e8d12b40..4032ff4da 100644 --- a/catch/unit/printf/CMakeLists.txt +++ b/catch/unit/printf/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # AMD Tests set(TEST_SRC printfFlags.cc @@ -29,35 +33,28 @@ if(HIP_PLATFORM MATCHES "amd") endif() if(HIP_PLATFORM MATCHES "amd") - set_source_files_properties(printfFlagsNonHost.cc PROPERTIES COMPILE_OPTIONS "-mprintf-kind=buffered") - set_source_files_properties(printfSpecifiersNonHost.cc PROPERTIES COMPILE_OPTIONS "-mprintf-kind=buffered") - set_source_files_properties(printfNonHost.cc PROPERTIES COMPILE_OPTIONS "-mprintf-kind=buffered") + set_source_files_properties(printfFlagsNonHost.cc PROPERTIES COMPILE_OPTIONS "-mprintf-kind=buffered") + set_source_files_properties(printfSpecifiersNonHost.cc PROPERTIES COMPILE_OPTIONS "-mprintf-kind=buffered") + set_source_files_properties(printfNonHost.cc PROPERTIES COMPILE_OPTIONS "-mprintf-kind=buffered") endif() -if(HIP_PLATFORM MATCHES "amd") - hip_add_exe_to_target(NAME PrintfTest +hip_add_exe_to_target(NAME PrintfTest TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests LINKER_LIBS ${LINKER_LIBS} PROPERTY CXX_STANDARD 17) -elseif (HIP_PLATFORM MATCHES "nvidia") - hip_add_exe_to_target(NAME PrintfTest - TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests - LINKER_LIBS ${LINKER_LIBS}) -endif() if(UNIX) -file(GLOB NEGATIVE_TEST_SRC + file(GLOB NEGATIVE_TEST_SRC printf_negative_kernels.cc) -file(COPY ${NEGATIVE_TEST_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src) -set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC}) + file(COPY ${NEGATIVE_TEST_SRC} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src) + set_property(GLOBAL APPEND PROPERTY G_INSTALL_SRC_FILES ${NEGATIVE_TEST_SRC}) -#add_test(NAME Unit_Printf_Negative -# COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py -# ./src ${HIP_PLATFORM} ${HIP_PATH} -# printf_negative_kernels.cc 11) + #add_test(NAME Unit_Printf_Negative + # COMMAND ${Python3_EXECUTABLE} ../compileAndCaptureOutput.py + # ./src ${HIP_PLATFORM} ${HIP_PATH} + # printf_negative_kernels.cc 11) endif() # Standalone exes @@ -67,21 +64,11 @@ add_executable(printfSpecifiers_exe EXCLUDE_FROM_ALL printfSpecifiers_exe.cc) add_executable(printfFlagsNonHost_exe EXCLUDE_FROM_ALL printfFlagsNonHost_exe.cc) add_executable(printfSpecifiersNonHost_exe EXCLUDE_FROM_ALL printfSpecifiersNonHost_exe.cc) -set_source_files_properties(printfFlags_exe.cc PROPERTIES LANGUAGE HIP) -set_source_files_properties(printfLength_exe.cc PROPERTIES LANGUAGE HIP) -set_source_files_properties(printfSpecifiers_exe.cc PROPERTIES LANGUAGE HIP) -set_source_files_properties(printfFlagsNonHost_exe.cc PROPERTIES LANGUAGE HIP) -set_source_files_properties(printfSpecifiersNonHost_exe.cc PROPERTIES LANGUAGE HIP) -set_target_properties(printfFlags_exe PROPERTIES LINKER_LANGUAGE HIP) -set_target_properties(printfLength_exe PROPERTIES LINKER_LANGUAGE HIP) -set_target_properties(printfSpecifiers_exe PROPERTIES LINKER_LANGUAGE HIP) -set_target_properties(printfFlagsNonHost_exe PROPERTIES LINKER_LANGUAGE HIP) -set_target_properties(printfSpecifiersNonHost_exe PROPERTIES LINKER_LANGUAGE HIP) -target_link_libraries(printfFlags_exe hip::host hip::device) -target_link_libraries(printfLength_exe hip::host hip::device) -target_link_libraries(printfSpecifiers_exe hip::host hip::device) -target_link_libraries(printfFlagsNonHost_exe hip::host hip::device) -target_link_libraries(printfSpecifiersNonHost_exe hip::host hip::device) +set_source_files_properties(printfFlags_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +set_source_files_properties(printfLength_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +set_source_files_properties(printfSpecifiers_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +set_source_files_properties(printfFlagsNonHost_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) +set_source_files_properties(printfSpecifiersNonHost_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS printfFlags_exe diff --git a/catch/unit/printf/hipPrintfAltForms.cc b/catch/unit/printf/hipPrintfAltForms.cc index 5aaf5ec77..bdade2dc2 100644 --- a/catch/unit/printf/hipPrintfAltForms.cc +++ b/catch/unit/printf/hipPrintfAltForms.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include "printf_common.h" // NOLINT @@ -55,7 +43,7 @@ __global__ void test_kernel() { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_Printf_PrintfAltFormsTsts") { +TEST_CASE(Unit_Printf_PrintfAltFormsTsts) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/hipPrintfBasic.cc b/catch/unit/printf/hipPrintfBasic.cc index f1a74dd54..f0b39c3cc 100644 --- a/catch/unit/printf/hipPrintfBasic.cc +++ b/catch/unit/printf/hipPrintfBasic.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -190,7 +178,7 @@ static void test_series(int* retval, uint num_blocks, uint threads_per_block) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_Printf_PrintfBasicTsts") { +TEST_CASE(Unit_Printf_PrintfBasicTsts) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/hipPrintfManyDevices.cc b/catch/unit/printf/hipPrintfManyDevices.cc index f5441121e..4109d6472 100644 --- a/catch/unit/printf/hipPrintfManyDevices.cc +++ b/catch/unit/printf/hipPrintfManyDevices.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -47,7 +35,7 @@ __global__ void print_things() { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_Printf_ManyDevicesTest", "[multigpu]") { +TEST_CASE(Unit_Printf_ManyDevicesTest) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/hipPrintfManyWaves.cc b/catch/unit/printf/hipPrintfManyWaves.cc index 0136e5d8c..07775d918 100644 --- a/catch/unit/printf/hipPrintfManyWaves.cc +++ b/catch/unit/printf/hipPrintfManyWaves.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -234,7 +222,7 @@ static void test_numbers(uint num_blocks, uint threads_per_block) { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_Printf_PrintfManyWaves") { +TEST_CASE(Unit_Printf_PrintfManyWaves) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/hipPrintfStar.cc b/catch/unit/printf/hipPrintfStar.cc index 1acff5049..355e1074e 100644 --- a/catch/unit/printf/hipPrintfStar.cc +++ b/catch/unit/printf/hipPrintfStar.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include "printf_common.h" // NOLINT @@ -44,7 +32,7 @@ __global__ void test_kernel_star() { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_Printf_PrintfStar") { +TEST_CASE(Unit_Printf_PrintfStar) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/hipPrintfWidthPrecision.cc b/catch/unit/printf/hipPrintfWidthPrecision.cc index 0e26421e2..c5603713c 100644 --- a/catch/unit/printf/hipPrintfWidthPrecision.cc +++ b/catch/unit/printf/hipPrintfWidthPrecision.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include "printf_common.h" // NOLINT @@ -54,7 +42,7 @@ __global__ void test_kernel_width() { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_Printf_PrintfWidthPrecision") { +TEST_CASE(Unit_Printf_PrintfWidthPrecision) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/printfFlags.cc b/catch/unit/printf/printfFlags.cc index bd3831dbb..2b6192a6a 100644 --- a/catch/unit/printf/printfFlags.cc +++ b/catch/unit/printf/printfFlags.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Printf_flags_Sanity_Positive") { +TEST_CASE(Unit_Printf_flags_Sanity_Positive) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/printfFlagsNonHost.cc b/catch/unit/printf/printfFlagsNonHost.cc index e926b0fc5..d90eb9dcd 100644 --- a/catch/unit/printf/printfFlagsNonHost.cc +++ b/catch/unit/printf/printfFlagsNonHost.cc @@ -1,20 +1,8 @@ -/*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 -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. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -41,7 +29,7 @@ THE SOFTWARE. * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_Buffered_Printf_Flags") { +TEST_CASE(Unit_Buffered_Printf_Flags) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/printfFlagsNonHost_exe.cc b/catch/unit/printf/printfFlagsNonHost_exe.cc index 23f4e87d3..c10d784d0 100644 --- a/catch/unit/printf/printfFlagsNonHost_exe.cc +++ b/catch/unit/printf/printfFlagsNonHost_exe.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/printf/printfFlags_exe.cc b/catch/unit/printf/printfFlags_exe.cc index 957b2415c..fc62e6b85 100644 --- a/catch/unit/printf/printfFlags_exe.cc +++ b/catch/unit/printf/printfFlags_exe.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/printf/printfHost.cc b/catch/unit/printf/printfHost.cc index 82900e55d..9fb17f37e 100644 --- a/catch/unit/printf/printfHost.cc +++ b/catch/unit/printf/printfHost.cc @@ -1,23 +1,9 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + #include @@ -41,7 +27,7 @@ __global__ void run_printf(int* count) { *count = printf("Hello World"); } * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_Host_Printf") { +TEST_CASE(Unit_Host_Printf) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/printfLength.cc b/catch/unit/printf/printfLength.cc index 9309cb264..c34310e28 100644 --- a/catch/unit/printf/printfLength.cc +++ b/catch/unit/printf/printfLength.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -43,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Printf_length_Sanity_Positive") { +TEST_CASE(Unit_Printf_length_Sanity_Positive) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/printfLength_exe.cc b/catch/unit/printf/printfLength_exe.cc index cde36d4ba..6cb932609 100644 --- a/catch/unit/printf/printfLength_exe.cc +++ b/catch/unit/printf/printfLength_exe.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/printf/printfNonHost.cc b/catch/unit/printf/printfNonHost.cc index 445877e2d..ddab18d2f 100644 --- a/catch/unit/printf/printfNonHost.cc +++ b/catch/unit/printf/printfNonHost.cc @@ -1,23 +1,9 @@ /* - 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 - 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT */ + #include #define KERNEL_ITERATIONS 15 @@ -67,7 +53,7 @@ __global__ void kernel_printf_thread(int* count) { * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_NonHost_Printf_basic") { +TEST_CASE(Unit_NonHost_Printf_basic) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -102,7 +88,7 @@ TEST_CASE("Unit_NonHost_Printf_basic") { * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_NonHost_Printf_loop") { +TEST_CASE(Unit_NonHost_Printf_loop) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -144,7 +130,7 @@ TEST_CASE("Unit_NonHost_Printf_loop") { * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_NonHost_Printf_multiple_Threads") { +TEST_CASE(Unit_NonHost_Printf_multiple_Threads) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -189,7 +175,7 @@ TEST_CASE("Unit_NonHost_Printf_multiple_Threads") { * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_NonHost_Printf_BufferAvailability") { +TEST_CASE(Unit_NonHost_Printf_BufferAvailability) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/printfSpecifiers.cc b/catch/unit/printf/printfSpecifiers.cc index 3688eccc6..03f54f59f 100644 --- a/catch/unit/printf/printfSpecifiers.cc +++ b/catch/unit/printf/printfSpecifiers.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "printf_negative_kernels_rtc.hh" @@ -46,7 +30,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Printf_specifier_Sanity_Positive") { +TEST_CASE(Unit_Printf_specifier_Sanity_Positive) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { @@ -152,7 +136,7 @@ x * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Printf_Negative_Parameters_RTC") { +TEST_CASE(Unit_Printf_Negative_Parameters_RTC) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/printfSpecifiersNonHost.cc b/catch/unit/printf/printfSpecifiersNonHost.cc index 2e966c405..c8ea81adb 100644 --- a/catch/unit/printf/printfSpecifiersNonHost.cc +++ b/catch/unit/printf/printfSpecifiersNonHost.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -45,7 +29,7 @@ THE SOFTWARE. * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_Buffered_Printf_Specifier") { +TEST_CASE(Unit_Buffered_Printf_Specifier) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/printf/printfSpecifiersNonHost_exe.cc b/catch/unit/printf/printfSpecifiersNonHost_exe.cc index 675f9d5ee..e56f3bead 100644 --- a/catch/unit/printf/printfSpecifiersNonHost_exe.cc +++ b/catch/unit/printf/printfSpecifiersNonHost_exe.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/printf/printfSpecifiers_exe.cc b/catch/unit/printf/printfSpecifiers_exe.cc index f107b7f85..fbdc1e315 100644 --- a/catch/unit/printf/printfSpecifiers_exe.cc +++ b/catch/unit/printf/printfSpecifiers_exe.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/printf/printf_common.h b/catch/unit/printf/printf_common.h index 0d7b7bb05..bb615981f 100644 --- a/catch/unit/printf/printf_common.h +++ b/catch/unit/printf/printf_common.h @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #pragma once #ifdef __linux__ #include diff --git a/catch/unit/printf/printf_negative_kernels.cc b/catch/unit/printf/printf_negative_kernels.cc index 0fe89ec21..b49f39007 100644 --- a/catch/unit/printf/printf_negative_kernels.cc +++ b/catch/unit/printf/printf_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/printf/printf_negative_kernels_rtc.hh b/catch/unit/printf/printf_negative_kernels_rtc.hh index a264e00f9..8fdf3d070 100644 --- a/catch/unit/printf/printf_negative_kernels_rtc.hh +++ b/catch/unit/printf/printf_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/rtc/CMakeLists.txt b/catch/unit/rtc/CMakeLists.txt index f5bf7b692..cfb6b656a 100644 --- a/catch/unit/rtc/CMakeLists.txt +++ b/catch/unit/rtc/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC saxpy.cc @@ -37,12 +41,18 @@ add_custom_target(copyRtcHeaders ALL ${CMAKE_CURRENT_SOURCE_DIR}/headers ${CMAKE_CURRENT_BINARY_DIR}/headers) +add_custom_target(copyTstJson ALL + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/RtcConfig.json + ${CMAKE_CURRENT_BINARY_DIR}/RtcConfig.json) + file(GLOB INSTALL_HEADER_FILES "./headers/*") set_property(GLOBAL APPEND PROPERTY G_INSTALL_HEADER_FILES ${INSTALL_HEADER_FILES}) set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/saxpy.h) +set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/RtcConfig.json) if(UNIX) - set(AMD_TEST_SRC ${AMD_TEST_SRC} + set(AMD_TEST_SRC ${AMD_TEST_SRC} RtcFunctions.cpp RtcUtility.cpp hiprtcComplrOptnTesting.cc) @@ -61,9 +71,9 @@ elseif(HIP_PLATFORM MATCHES "amd") LINKER_LIBS hiprtc::hiprtc) endif() -set_source_files_properties(ChkPtrdiff_t_Exe.cc PROPERTIES LANGUAGE HIP) +set_source_files_properties(ChkPtrdiff_t_Exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) add_executable(ChkPtrdiff_t_Exe EXCLUDE_FROM_ALL ChkPtrdiff_t_Exe.cc) -set_target_properties(ChkPtrdiff_t_Exe PROPERTIES LINKER_LANGUAGE HIP) +target_link_libraries(ChkPtrdiff_t_Exe ${GPGPU_LINKER_LIBRARIES}) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS ChkPtrdiff_t_Exe) if(HIP_PLATFORM MATCHES "nvidia") @@ -72,4 +82,4 @@ elseif(HIP_PLATFORM MATCHES "amd") target_link_libraries(ChkPtrdiff_t_Exe hiprtc::hiprtc hip::host hip::device) endif() -add_dependencies(RTC copyRtcHeaders ChkPtrdiff_t_Exe) +add_dependencies(RTC copyRtcHeaders copyTstJson ChkPtrdiff_t_Exe) diff --git a/catch/unit/rtc/ChkPtrdiff_t_Exe.cc b/catch/unit/rtc/ChkPtrdiff_t_Exe.cc index 85ada1935..b67ff5cd6 100644 --- a/catch/unit/rtc/ChkPtrdiff_t_Exe.cc +++ b/catch/unit/rtc/ChkPtrdiff_t_Exe.cc @@ -1,20 +1,9 @@ -/*Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include diff --git a/catch/unit/rtc/RtcConfig.json b/catch/unit/rtc/RtcConfig.json index f0d00f704..d3b9c5aff 100644 --- a/catch/unit/rtc/RtcConfig.json +++ b/catch/unit/rtc/RtcConfig.json @@ -51,7 +51,7 @@ "block_name" : "denormals", "compiler_option" : "-fgpu-flush-denormals-to-zero", "reverse_compiler_option" : "-fno-gpu-flush-denormals-to-zero", - "Input_Vals" : [2, -125, 2, -126, 2, -149, 2, -150, 2, -1000, 2, -2000, 2, -128], + "Input_Vals" : [2, -125, 2, -130, 2, -149, 2, -150, 2, -1000, 2, -2000, 2, -128], "Expected_Results" : [1, 0, 0, 0, 0, 0, 0 ], "Expected_Results_for_no" : [1, 1, 1, 0, 0, 0, 1 ], "kernel_name" : "denormals" diff --git a/catch/unit/rtc/RtcFunctions.cpp b/catch/unit/rtc/RtcFunctions.cpp index cf012e1d2..cb516213c 100644 --- a/catch/unit/rtc/RtcFunctions.cpp +++ b/catch/unit/rtc/RtcFunctions.cpp @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This file contains functions for idividual HIPRTC supported compiler options @@ -79,6 +66,7 @@ bool check_architecture(const char** Combination_CO, int Combination_CO_size, in HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -94,9 +82,11 @@ bool check_architecture(const char** Combination_CO, int Combination_CO_size, in HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } @@ -119,12 +109,8 @@ bool check_rdc(const char** Combination_CO, int Combination_CO_size, int max_thr } const char* compiler_opt = CO.c_str(); float *A_d, *B_d, *C_d; - float *A_h, *B_h, *C_h, *result; + std::vector A_h(1), B_h(1), C_h(1), result(1); float Nbytes = sizeof(float); - A_h = new float[1]; - B_h = new float[1]; - C_h = new float[1]; - result = new float[1]; for (int i = 0; i < 1; i++) { A_h[i] = 4; B_h[i] = 4; @@ -133,8 +119,8 @@ bool check_rdc(const char** Combination_CO, int Combination_CO_size, int max_thr HIP_CHECK(hipMalloc(&A_d, Nbytes)); HIP_CHECK(hipMalloc(&B_d, Nbytes)); HIP_CHECK(hipMalloc(&C_d, Nbytes)); - HIP_CHECK(hipMemcpy(A_d, A_h, Nbytes, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(B_d, B_h, Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(A_d, A_h.data(), Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(B_d, B_h.data(), Nbytes, hipMemcpyHostToDevice)); hiprtcProgram prog; HIPRTC_CHECK(hiprtcCreateProgram(&prog, rdc_string, kername, 0, NULL, NULL)); if (Combination_CO_size != -1) { @@ -154,6 +140,7 @@ bool check_rdc(const char** Combination_CO, int Combination_CO_size, int max_thr HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -169,6 +156,7 @@ bool check_rdc(const char** Combination_CO, int Combination_CO_size, int max_thr HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -180,6 +168,7 @@ bool check_rdc(const char** Combination_CO, int Combination_CO_size, int max_thr HIPRTC_CHECK(hiprtcGetBitcodeSize(prog, &codeSize)); std::vector codec(codeSize); HIPRTC_CHECK(hiprtcGetBitcode(prog, codec.data())); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); float wall_time; int reg_count = 2; int max_thread = 1; @@ -216,6 +205,9 @@ bool check_rdc(const char** Combination_CO, int Combination_CO_size, int max_thr HIP_CHECK( hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, nullptr, kernel_parameter)); pass_count++; + HIP_CHECK(hipDeviceSynchronize()); + HIP_CHECK(hipModuleUnload(module)); + HIPRTC_CHECK(hiprtcLinkDestroy(rtc_link_state)); break; case 1: HIPRTC_CHECK(hiprtcLinkCreate(8, jit_options.data(), reinterpret_cast(&lopts), @@ -227,6 +219,9 @@ bool check_rdc(const char** Combination_CO, int Combination_CO_size, int max_thr HIP_CHECK(hipModuleGetFunction(&function, module, kername)); HIP_CHECK( hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, nullptr, kernel_parameter)); + HIP_CHECK(hipDeviceSynchronize()); + HIP_CHECK(hipModuleUnload(module)); + HIPRTC_CHECK(hiprtcLinkDestroy(rtc_link_state)); pass_count++; break; default: @@ -234,7 +229,10 @@ bool check_rdc(const char** Combination_CO, int Combination_CO_size, int max_thr break; } } - HIP_CHECK(hipMemcpy(result, C_d, Nbytes, hipMemcpyDeviceToHost)); + HIP_CHECK(hipMemcpy(result.data(), C_d, Nbytes, hipMemcpyDeviceToHost)); + HIP_CHECK(hipFree(A_d)); + HIP_CHECK(hipFree(B_d)); + HIP_CHECK(hipFree(C_d)); for (int i = 0; i < 1; i++) { if (result[i] != ((A_h[i] * B_h[i]))) { WARN("Compiler Option : " << compiler_opt); @@ -293,21 +291,18 @@ bool check_denormals_enabled(const char** Combination_CO, int Combination_CO_siz for (test_case = 0, res_inc = 0; test_case < Input_Vals_int.size() && res_inc < Expected_Results_int.size(); test_case += 2, res_inc++) { - double *base_h, *power_h, *result_h; + std::vector base_h(1), power_h(1), result_h(1); double *base_d, *power_d, *result_d; double Nbytes = sizeof(double); - base_h = new double[1]; - power_h = new double[1]; - result_h = new double[1]; - *base_h = Input_Vals_int[test_case]; - *power_h = Input_Vals_int[test_case + 1]; - *result_h = 1; + base_h[0] = Input_Vals_int[test_case]; + power_h[0] = Input_Vals_int[test_case + 1]; + result_h[0] = 1; HIP_CHECK(hipMalloc(&base_d, Nbytes)); HIP_CHECK(hipMalloc(&power_d, Nbytes)); HIP_CHECK(hipMalloc(&result_d, Nbytes)); - HIP_CHECK(hipMemcpy(base_d, base_h, Nbytes, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(power_d, power_h, Nbytes, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(result_d, result_h, Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(base_d, base_h.data(), Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(power_d, power_h.data(), Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(result_d, result_h.data(), Nbytes, hipMemcpyHostToDevice)); hiprtcProgram program; HIPRTC_CHECK(hiprtcCreateProgram(&program, denormals_string, "denormals", 0, NULL, NULL)); if (Combination_CO_size != -1) { @@ -328,6 +323,7 @@ bool check_denormals_enabled(const char** Combination_CO, int Combination_CO_siz HIPRTC_CHECK(hiprtcGetProgramLog(program, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&program)); return 0; } } else { @@ -343,6 +339,7 @@ bool check_denormals_enabled(const char** Combination_CO, int Combination_CO_siz HIPRTC_CHECK(hiprtcGetProgramLog(program, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&program)); return 0; } } @@ -359,11 +356,11 @@ bool check_denormals_enabled(const char** Combination_CO, int Combination_CO_siz HIP_CHECK(hipModuleLoadData(&module, codec.data())); HIP_CHECK(hipModuleGetFunction(&function, module, kername)); HIP_CHECK(hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, nullptr, kernel_parameter)); - HIP_CHECK(hipMemcpy(result_h, result_d, sizeof(double), hipMemcpyDeviceToHost)); + HIP_CHECK(hipMemcpy(result_h.data(), result_d, sizeof(double), hipMemcpyDeviceToHost)); HIP_CHECK(hipDeviceSynchronize()); HIP_CHECK(hipModuleUnload(module)); HIPRTC_CHECK(hiprtcDestroyProgram(&program)); - if (*result_h != Expected_Results_int[res_inc]) { + if (result_h[0] != Expected_Results_int[res_inc]) { WARN("Compiler Option : " << compiler_option); if (Combination_CO_size != -1) { WARN("FAILED IN COMBINATION :"); @@ -373,11 +370,14 @@ bool check_denormals_enabled(const char** Combination_CO, int Combination_CO_siz } WARN("EXPECTED RESULT DOES NOT MATCH FOR " << res_inc); WARN("th ITERATION (start iteration is 0 ) "); - WARN("INPUT : pow(2, " << *power_h << ") "); + WARN("INPUT : pow(2, " << power_h[0] << ") "); WARN("EXPECTED OP: " << Expected_Results_int[res_inc]); - WARN("OBTAINED OP: " << *result_h); + WARN("OBTAINED OP: " << result_h[0]); return 0; } + HIP_CHECK(hipFree(base_d)); + HIP_CHECK(hipFree(power_d)); + HIP_CHECK(hipFree(result_d)); } return 1; } @@ -423,21 +423,18 @@ bool check_denormals_disabled(const char** Combination_CO, int Combination_CO_si for (test_case = 0, res_inc = 0; test_case < Input_Vals_int.size() && res_inc < Expected_Results_for_no_int.size(); test_case += 2, res_inc++) { - double *base_h, *power_h, *result_h; + std::vector base_h(1), power_h(1), result_h(1); double *base_d, *power_d, *result_d; double Nbytes = sizeof(double); - base_h = new double[1]; - power_h = new double[1]; - result_h = new double[1]; - *base_h = Input_Vals_int[test_case]; - *power_h = Input_Vals_int[test_case + 1]; - *result_h = 0; + base_h[0] = Input_Vals_int[test_case]; + power_h[0] = Input_Vals_int[test_case + 1]; + result_h[0] = 0; HIP_CHECK(hipMalloc(&base_d, Nbytes)); HIP_CHECK(hipMalloc(&power_d, Nbytes)); HIP_CHECK(hipMalloc(&result_d, Nbytes)); - HIP_CHECK(hipMemcpy(base_d, base_h, Nbytes, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(power_d, power_h, Nbytes, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(result_d, result_h, Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(base_d, base_h.data(), Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(power_d, power_h.data(), Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(result_d, result_h.data(), Nbytes, hipMemcpyHostToDevice)); hiprtcProgram program; HIPRTC_CHECK(hiprtcCreateProgram(&program, denormals_string, "denormals", 0, NULL, NULL)); if (Combination_CO_size != -1) { @@ -458,6 +455,7 @@ bool check_denormals_disabled(const char** Combination_CO, int Combination_CO_si HIPRTC_CHECK(hiprtcGetProgramLog(program, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&program)); return 0; } } else { @@ -473,6 +471,7 @@ bool check_denormals_disabled(const char** Combination_CO, int Combination_CO_si HIPRTC_CHECK(hiprtcGetProgramLog(program, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&program)); return 0; } } @@ -489,11 +488,11 @@ bool check_denormals_disabled(const char** Combination_CO, int Combination_CO_si HIP_CHECK(hipModuleLoadData(&module, codec.data())); HIP_CHECK(hipModuleGetFunction(&function, module, kername)); HIP_CHECK(hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, nullptr, kernel_parameter)); - HIP_CHECK(hipMemcpy(result_h, result_d, sizeof(double), hipMemcpyDeviceToHost)); + HIP_CHECK(hipMemcpy(result_h.data(), result_d, sizeof(double), hipMemcpyDeviceToHost)); HIP_CHECK(hipDeviceSynchronize()); HIP_CHECK(hipModuleUnload(module)); HIPRTC_CHECK(hiprtcDestroyProgram(&program)); - if (*result_h != Expected_Results_for_no_int[res_inc]) { + if (result_h[0] != Expected_Results_for_no_int[res_inc]) { WARN("Compiler Option : " << compiler_option); if (Combination_CO_size != -1) { WARN("FAILED IN COMBINATION :"); @@ -503,11 +502,14 @@ bool check_denormals_disabled(const char** Combination_CO, int Combination_CO_si } WARN("EXPECTED RESULT DOES NOT MATCH FOR " << res_inc); WARN("th ITERATION (start iteration is 0 ) "); - WARN("INPUT : pow(2, " << *power_h << ") "); + WARN("INPUT : pow(2, " << power_h[0] << ") "); WARN("EXPECTED OP: " << Expected_Results_for_no_int[res_inc]); - WARN("OBTAINED OP: " << *result_h); + WARN("OBTAINED OP: " << result_h[0]); return 0; } + HIP_CHECK(hipFree(base_d)); + HIP_CHECK(hipFree(power_d)); + HIP_CHECK(hipFree(result_d)); } return 1; } @@ -534,13 +536,13 @@ bool check_ffp_contract_off(const char** Combination_CO, int Combination_CO_size CO_vec.push_back(indx.get()); } int CO_IRadded_size = 3; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); std::string hold = CO_vec[0]; CO_IRadded[0] = hold.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO[0]); if (Combination_CO_size != -1) { @@ -591,13 +593,13 @@ bool check_ffp_contract_on(const char** Combination_CO, int Combination_CO_size, CO_vec.push_back(indx.get()); } int CO_IRadded_size = 3; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); std::string hold = CO_vec[1]; CO_IRadded[0] = hold.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO[1]); if (Combination_CO_size != -1) { @@ -662,13 +664,13 @@ bool check_ffp_contract_fast(const char** Combination_CO, int Combination_CO_siz CO_vec.push_back(indx.get()); } int CO_IRadded_size = 3; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); std::string hold = CO_vec[2]; CO_IRadded[0] = hold.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO[2]); if (Combination_CO_size != -1) { @@ -729,12 +731,12 @@ bool check_fast_math_enabled(const char** Combination_CO, int Combination_CO_siz return 0; } int CO_IRadded_size = 3; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -779,12 +781,12 @@ bool check_fast_math_disabled(const char** Combination_CO, int Combination_CO_si return 0; } int CO_IRadded_size = 3; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -828,47 +830,44 @@ bool check_slp_vectorize_enabled(const char** Combination_CO, int Combination_CO } std::string kernel_name = get_string_parameters("kernel_name", block_name); const char* kername = kernel_name.c_str(); - int CO_IRadded_size = 3; - const char** CO_IRadded = new const char*[3]; + CaptureIR ir_capture; + auto dump_dir = ir_capture.CreateDumpDir(); + std::string ir_dump_option = "-ir-dump-directory=" + dump_dir.string(); + int CO_IRadded_size = 5; + std::vector CO_IRadded(5); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; - __half2 *a_d, *x_d, *y_d; - __half2 a_h, x_h; - a_h.data.x = 1.5; - x_h.data.y = 3.0; - CaptureStream capture(stderr); - HIP_CHECK(hipMalloc(&a_d, sizeof(__half2))); - HIP_CHECK(hipMalloc(&x_d, sizeof(__half2))); - HIP_CHECK(hipMalloc(&y_d, sizeof(__half2))); - HIP_CHECK(hipMemcpy(a_d, &a_h, sizeof(__half2), hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(x_d, &x_h, sizeof(__half2), hipMemcpyHostToDevice)); + CO_IRadded[3] = "-mllvm"; + CO_IRadded[4] = ir_dump_option.c_str(); hiprtcProgram prog; HIPRTC_CHECK(hiprtcCreateProgram(&prog, slp_vectorize_string, kername, 0, NULL, NULL)); if (Combination_CO_size != -1) { - int Combination_CO_IRadded_size = Combination_CO_size + 3; + int Combination_CO_IRadded_size = Combination_CO_size + 5; int b = 0; - std::vector add_ir_forcombi(Combination_CO_size + 3, ""); - const char** Combination_CO_IRadded = new const char*[Combination_CO_size + 3]; - for (int i = 0; i < Combination_CO_size + 3; ++i) { + std::vector add_ir_forcombi(Combination_CO_size + 5, ""); + std::vector Combination_CO_IRadded(Combination_CO_size + 5); + for (int i = 0; i < Combination_CO_size + 5; ++i) { if (i == Combination_CO_size) { Combination_CO_IRadded[i] = "-fno-signed-zeros"; Combination_CO_IRadded[i + 1] = "-mllvm"; Combination_CO_IRadded[i + 2] = "-print-after=constmerge"; + Combination_CO_IRadded[i + 3] = "-mllvm"; + add_ir_forcombi[i + 4] = ir_dump_option; + Combination_CO_IRadded[i + 4] = add_ir_forcombi[i + 4].c_str(); break; } add_ir_forcombi[i] = Combination_CO[b]; Combination_CO_IRadded[i] = add_ir_forcombi[i].c_str(); b++; } - capture.Begin(); hiprtcResult compileResult{ - hiprtcCompileProgram(prog, Combination_CO_IRadded_size, Combination_CO_IRadded)}; - capture.End(); + hiprtcCompileProgram(prog, Combination_CO_IRadded_size, Combination_CO_IRadded.data())}; if (!(compileResult == HIPRTC_SUCCESS)) { + ir_capture.Cleanup(dump_dir); WARN("Compiler option : " << retrieved_CO); WARN("FAILED IN COMBINATION :"); - for (int i = 0; i < Combination_CO_size + 3; i++) { + for (int i = 0; i < Combination_CO_size + 5; i++) { WARN(Combination_CO_IRadded[i]); } WARN("hiprtcCompileProgram() api failed!! with error code: "); @@ -880,13 +879,13 @@ bool check_slp_vectorize_enabled(const char** Combination_CO, int Combination_CO HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { - capture.Begin(); - hiprtcResult compileResult{hiprtcCompileProgram(prog, CO_IRadded_size, CO_IRadded)}; - capture.End(); + hiprtcResult compileResult{hiprtcCompileProgram(prog, CO_IRadded_size, CO_IRadded.data())}; if (!(compileResult == HIPRTC_SUCCESS)) { + ir_capture.Cleanup(dump_dir); WARN("Compiler option : " << retrieved_CO); WARN("hiprtcCompileProgram() api failed!! with error code: "); WARN(compileResult); @@ -897,29 +896,13 @@ bool check_slp_vectorize_enabled(const char** Combination_CO, int Combination_CO HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } - std::string data = capture.getData(); - std::stringstream dataStream; - size_t codeSize; - HIPRTC_CHECK(hiprtcGetCodeSize(prog, &codeSize)); - std::vector codec(codeSize); - HIPRTC_CHECK(hiprtcGetCode(prog, codec.data())); - void* kernelParam[] = {reinterpret_cast(a_d), reinterpret_cast(x_d), - reinterpret_cast(y_d)}; - auto size = sizeof(kernelParam); - void* kernel_parameter[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &kernelParam, - HIP_LAUNCH_PARAM_BUFFER_SIZE, &size, HIP_LAUNCH_PARAM_END}; - hipModule_t module; - hipFunction_t function; - HIP_CHECK(hipModuleLoadData(&module, codec.data())); - HIP_CHECK(hipModuleGetFunction(&function, module, kername)); - HIP_CHECK(hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, nullptr, kernel_parameter)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipModuleUnload(module)); + std::string data = ir_capture.ReadDumpFile(dump_dir); HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); - if (data == "") { + if (data.empty()) { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { WARN("FAILED IN COMBINATION :"); @@ -931,13 +914,11 @@ bool check_slp_vectorize_enabled(const char** Combination_CO, int Combination_CO return 0; } int times = 0; - if (data.find("contract <2 x half>", 0) != -1) { - times++; - } - int start = data.find("contract <2 x half>", 0) + 1; - while (data.find("contract <2 x half>", start) != -1) { - times++; - start = data.find("contract <2 x half>", start) + 1; + const std::string search_string = "contract <2 x half>"; + size_t start = 0; + while ((start = data.find(search_string, start)) != std::string::npos) { + ++times; + ++start; } if (times == 1) { return 1; @@ -981,47 +962,48 @@ bool check_slp_vectorize_disabled(const char** Combination_CO, int Combination_C } std::string kernel_name = get_string_parameters("kernel_name", block_name); const char* kername = kernel_name.c_str(); - int CO_IRadded_size = 3; - const char** CO_IRadded = new const char*[3]; + CaptureIR ir_capture; + auto dump_dir = ir_capture.CreateDumpDir(); + std::string ir_dump_option = "-ir-dump-directory=" + dump_dir.string(); + int CO_IRadded_size = 7; + std::vector CO_IRadded(7); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; - __half2 *a_d, *x_d, *y_d; - __half2 a_h, x_h; - a_h.data.x = 1.5; - x_h.data.y = 3.0; - CaptureStream capture(stderr); - HIP_CHECK(hipMalloc(&a_d, sizeof(__half2))); - HIP_CHECK(hipMalloc(&x_d, sizeof(__half2))); - HIP_CHECK(hipMalloc(&y_d, sizeof(__half2))); - HIP_CHECK(hipMemcpy(a_d, &a_h, sizeof(__half2), hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(x_d, &x_h, sizeof(__half2), hipMemcpyHostToDevice)); + CO_IRadded[3] = "-mllvm"; + CO_IRadded[4] = ir_dump_option.c_str(); + CO_IRadded[5] = "-mllvm"; + CO_IRadded[6] = "-disable-vector-combine"; hiprtcProgram prog; HIPRTC_CHECK(hiprtcCreateProgram(&prog, slp_vectorize_string, kername, 0, NULL, NULL)); if (Combination_CO_size != -1) { - int Combination_CO_IRadded_size = Combination_CO_size + 3; + int Combination_CO_IRadded_size = Combination_CO_size + 7; int b = 0; - std::vector add_ir_forcombi(Combination_CO_size + 3, ""); - const char** Combination_CO_IRadded = new const char*[Combination_CO_size + 3]; - for (int i = 0; i < Combination_CO_size + 3; ++i) { + std::vector add_ir_forcombi(Combination_CO_IRadded_size, ""); + std::vector Combination_CO_IRadded(Combination_CO_IRadded_size); + for (int i = 0; i < Combination_CO_IRadded_size; ++i) { if (i == Combination_CO_size) { Combination_CO_IRadded[i] = "-fno-signed-zeros"; Combination_CO_IRadded[i + 1] = "-mllvm"; Combination_CO_IRadded[i + 2] = "-print-after=constmerge"; + Combination_CO_IRadded[i + 3] = "-mllvm"; + add_ir_forcombi[i + 4] = ir_dump_option; + Combination_CO_IRadded[i + 4] = add_ir_forcombi[i + 4].c_str(); + Combination_CO_IRadded[i + 5] = "-mllvm"; + Combination_CO_IRadded[i + 6] = "-disable-vector-combine"; break; } add_ir_forcombi[i] = Combination_CO[b]; Combination_CO_IRadded[i] = add_ir_forcombi[i].c_str(); b++; } - capture.Begin(); hiprtcResult compileResult{ - hiprtcCompileProgram(prog, Combination_CO_IRadded_size, Combination_CO_IRadded)}; - capture.End(); + hiprtcCompileProgram(prog, Combination_CO_IRadded_size, Combination_CO_IRadded.data())}; if (!(compileResult == HIPRTC_SUCCESS)) { + ir_capture.Cleanup(dump_dir); WARN("Compiler option : " << retrieved_CO); WARN("FAILED IN COMBINATION :"); - for (int i = 0; i < Combination_CO_size + 3; i++) { + for (int i = 0; i < Combination_CO_size + 7; i++) { WARN(Combination_CO_IRadded[i]); } WARN("hiprtcCompileProgram() api failed!! with error code: "); @@ -1033,13 +1015,13 @@ bool check_slp_vectorize_disabled(const char** Combination_CO, int Combination_C HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { - capture.Begin(); - hiprtcResult compileResult{hiprtcCompileProgram(prog, CO_IRadded_size, CO_IRadded)}; - capture.End(); + hiprtcResult compileResult{hiprtcCompileProgram(prog, CO_IRadded_size, CO_IRadded.data())}; if (!(compileResult == HIPRTC_SUCCESS)) { + ir_capture.Cleanup(dump_dir); WARN("Compiler option : " << retrieved_CO); WARN("hiprtcCompileProgram() api failed!! with error code: "); WARN(compileResult); @@ -1050,40 +1032,22 @@ bool check_slp_vectorize_disabled(const char** Combination_CO, int Combination_C HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } - std::string data = capture.getData(); - std::stringstream dataStream; - size_t codeSize; - HIPRTC_CHECK(hiprtcGetCodeSize(prog, &codeSize)); - std::vector codec(codeSize); - HIPRTC_CHECK(hiprtcGetCode(prog, codec.data())); - void* kernelParam[] = {reinterpret_cast(a_d), reinterpret_cast(x_d), - reinterpret_cast(y_d)}; - auto size = sizeof(kernelParam); - void* kernel_parameter[] = {HIP_LAUNCH_PARAM_BUFFER_POINTER, &kernelParam, - HIP_LAUNCH_PARAM_BUFFER_SIZE, &size, HIP_LAUNCH_PARAM_END}; - hipModule_t module; - hipFunction_t function; - HIP_CHECK(hipModuleLoadData(&module, codec.data())); - HIP_CHECK(hipModuleGetFunction(&function, module, kername)); - HIP_CHECK(hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, nullptr, kernel_parameter)); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipModuleUnload(module)); + std::string data = ir_capture.ReadDumpFile(dump_dir); HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); int times = 0; - if (data.find("contract <2 x half>", 0) != -1) { - times++; - } - int start = data.find("contract <2 x half>", 0) + 1; - while (data.find("contract <2 x half>", start) != -1) { - times++; - start = data.find("contract <2 x half>", start) + 1; + const std::string search_string = "contract half"; + size_t start = 0; + while ((start = data.find(search_string, start)) != std::string::npos) { + ++times; + ++start; } if (times == 2) { return 1; - } else if (times < 2) { + } else if (times < 1) { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { WARN("FAILED IN COMBINATION :"); @@ -1091,7 +1055,7 @@ bool check_slp_vectorize_disabled(const char** Combination_CO, int Combination_C WARN(Combination_CO[i]); } } - WARN("IR CONTAIN 'fadd contract <2 x half>' " << times << "times"); + WARN("IR CONTAIN '" << search_string << "' " << times << "times"); WARN(" WHICH IS NOT EXPECTED(IT SHOULD BE PRESENT TWICE)"); return 0; } else { @@ -1102,7 +1066,7 @@ bool check_slp_vectorize_disabled(const char** Combination_CO, int Combination_C WARN(Combination_CO[i]); } } - WARN("IR CONTAIN 'fadd contract <2 x half>' " << times << "times"); + WARN("IR CONTAIN '" << search_string << "' " << times << "times"); WARN(" WHICH IS NOT EXPECTED(IT SHOULD BE PRESENT TWICE)"); return 0; } @@ -1152,6 +1116,7 @@ bool check_macro(const char** Combination_CO, int Combination_CO_size, int max_t HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -1166,15 +1131,15 @@ bool check_macro(const char** Combination_CO, int Combination_CO_size, int max_t HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } - int* macro_value_h; + std::vector macro_value_h(1); int* macro_value_d; - macro_value_h = new int[1]; HIP_CHECK(hipMalloc(¯o_value_d, sizeof(int))); - *macro_value_h = 0; - HIP_CHECK(hipMemcpy(macro_value_d, macro_value_h, sizeof(int), hipMemcpyHostToDevice)); + macro_value_h[0] = 0; + HIP_CHECK(hipMemcpy(macro_value_d, macro_value_h.data(), sizeof(int), hipMemcpyHostToDevice)); size_t codeSize; HIPRTC_CHECK(hiprtcGetCodeSize(prog, &codeSize)); std::vector codec(codeSize); @@ -1188,11 +1153,12 @@ bool check_macro(const char** Combination_CO, int Combination_CO_size, int max_t HIP_CHECK(hipModuleLoadData(&module, codec.data())); HIP_CHECK(hipModuleGetFunction(&function, module, kername)); HIP_CHECK(hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, nullptr, kernel_parameter)); - HIP_CHECK(hipMemcpy(macro_value_h, macro_value_d, sizeof(int), hipMemcpyDeviceToHost)); + HIP_CHECK(hipMemcpy(macro_value_h.data(), macro_value_d, sizeof(int), hipMemcpyDeviceToHost)); HIP_CHECK(hipDeviceSynchronize()); HIP_CHECK(hipModuleUnload(module)); + HIP_CHECK(hipFree(macro_value_d)); HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); - if (*macro_value_h != Expected_Results_int[0]) { + if (macro_value_h[0] != Expected_Results_int[0]) { WARN("Compiler Option : " << compiler_option); if (Combination_CO_size != -1) { WARN("FAILED IN COMBINATION :"); @@ -1203,7 +1169,7 @@ bool check_macro(const char** Combination_CO, int Combination_CO_size, int max_t WARN("EXPECTED RESULT DOES NOT MATCH"); WARN("INPUT: " << compiler_option); WARN("EXPECTED OP : " << Expected_Results_int[0]); - WARN("OBTAINED OP: " << *macro_value_h); + WARN("OBTAINED OP: " << macro_value_h[0]); return 0; } else { return 1; @@ -1231,7 +1197,7 @@ bool check_undef_macro(const char** Combination_CO, int Combination_CO_size, int compiler_option.push_back(indx.get()); } std::vector variable(compiler_option.size(), ""); - const char** appended_compiler_options = new const char*[compiler_option.size()]; + std::vector appended_compiler_options(compiler_option.size()); for (int i = 0; i < compiler_option.size(); ++i) { variable[i] = compiler_option[i]; appended_compiler_options[i] = variable[i].c_str(); @@ -1247,6 +1213,7 @@ bool check_undef_macro(const char** Combination_CO, int Combination_CO_size, int std::string log(logSize, '\0'); HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); if (log.find("undeclared identifier")) { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } } else { @@ -1256,19 +1223,21 @@ bool check_undef_macro(const char** Combination_CO, int Combination_CO_size, int WARN(Combination_CO[i]); } WARN("Expected error : 'undeclared identifier' NOT GENERATED"); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } } else { hiprtcResult compileResult{ - hiprtcCompileProgram(prog, compiler_option.size(), appended_compiler_options)}; + hiprtcCompileProgram(prog, compiler_option.size(), appended_compiler_options.data())}; if (!(compileResult == HIPRTC_SUCCESS)) { size_t logSize; HIPRTC_CHECK(hiprtcGetProgramLogSize(prog, &logSize)); if (logSize) { std::string log(logSize, '\0'); HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); - if (log.find("undeclared identifier")) { + if (log.find("undeclared identifier") != std::string::npos) { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } } else { @@ -1280,6 +1249,7 @@ bool check_undef_macro(const char** Combination_CO, int Combination_CO_size, int } } WARN("Expected error : 'undeclared identifier' NOT GENERATED"); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -1292,6 +1262,7 @@ bool check_undef_macro(const char** Combination_CO, int Combination_CO_size, int } } WARN("EXPECTED ERROR WAS NOT GENERATED"); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } @@ -1357,13 +1328,13 @@ bool check_header_dir(const char** Combination_CO, int Combination_CO_size, int Expected_Results_int.push_back(static_cast(indx)); } std::vector src_var_hdr_lst(Src_headers_list.size(), ""); - const char** src_hder_lst = new const char*[Src_headers_list.size()]; + std::vector src_hder_lst(Src_headers_list.size()); for (int i = 0; i < Src_headers_list.size(); ++i) { src_var_hdr_lst[i] = Src_headers_list[i]; src_hder_lst[i] = src_var_hdr_lst[i].c_str(); } std::vector var_hdr_lst(Headers_list.size(), ""); - const char** hder_lst = new const char*[Headers_list.size()]; + std::vector hder_lst(Headers_list.size()); for (int i = 0; i < Headers_list.size(); ++i) { var_hdr_lst[i] = Headers_list[i]; hder_lst[i] = var_hdr_lst[i].c_str(); @@ -1371,7 +1342,7 @@ bool check_header_dir(const char** Combination_CO, int Combination_CO_size, int for (int senario = 0; senario < Input_Thrd_Vals_int.size(); senario++) { hiprtcProgram prog; HIPRTC_CHECK(hiprtcCreateProgram(&prog, header_dir_string, kername, Headers_list.size(), - src_hder_lst, hder_lst)); + src_hder_lst.data(), hder_lst.data())); if (Combination_CO_size != -1) { hiprtcResult compileResult{hiprtcCompileProgram(prog, Combination_CO_size, Combination_CO)}; if (!(compileResult == HIPRTC_SUCCESS)) { @@ -1389,6 +1360,7 @@ bool check_header_dir(const char** Combination_CO, int Combination_CO_size, int HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -1404,6 +1376,7 @@ bool check_header_dir(const char** Combination_CO, int Combination_CO_size, int HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -1431,6 +1404,8 @@ bool check_header_dir(const char** Combination_CO, int Combination_CO_size, int HIP_CHECK(hipModuleGetFunction(&function, module, kername)); HIP_CHECK(hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, nullptr, kernel_parameter)); HIP_CHECK(hipMemcpy(ptr_value_h, value_d, sizeof(int), hipMemcpyDeviceToHost)); + HIP_CHECK(hipFree(value_d)); + HIP_CHECK(hipFree(input_d)); if (*ptr_value_h != Expected_Results_int[senario]) { WARN("Compiler Option : " << appended_CO); if (Combination_CO_size != -1) { @@ -1489,6 +1464,7 @@ bool check_warning(const char** Combination_CO, int Combination_CO_size, int max HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -1504,6 +1480,7 @@ bool check_warning(const char** Combination_CO, int Combination_CO_size, int max HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -1521,11 +1498,14 @@ bool check_warning(const char** Combination_CO, int Combination_CO_size, int max } } WARN(" WARNING MESSAGE IS PRINTING WHICH IS NOT SUPRESSED "); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } else { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } } else { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } } @@ -1566,6 +1546,7 @@ bool check_Rpass_inline(const char** Combination_CO, int Combination_CO_size, in HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -1581,6 +1562,7 @@ bool check_Rpass_inline(const char** Combination_CO, int Combination_CO_size, in HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -1589,6 +1571,7 @@ bool check_Rpass_inline(const char** Combination_CO, int Combination_CO_size, in if (logSize) { std::string log(logSize, '\0'); HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); if (log.find("inlined into")) { return 1; } else { @@ -1652,6 +1635,7 @@ bool check_conversionerror_enabled(const char** Combination_CO, int Combination_ HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); std::string variable = "error"; if (-1 != log.find(variable)) { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } else { WARN("Compiler Option : " << compiler_option); @@ -1662,6 +1646,7 @@ bool check_conversionerror_enabled(const char** Combination_CO, int Combination_ } } WARN("ERROR MSG : '" << variable << "' NOT FOUND"); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -1674,6 +1659,7 @@ bool check_conversionerror_enabled(const char** Combination_CO, int Combination_ } WARN("LOG IS NOT GENERATED"); WARN("maybe due to presence of '-w' compiler option"); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -1723,11 +1709,14 @@ bool check_conversionerror_disabled(const char** Combination_CO, int Combination } WARN("LOG IS PRESENT WITH ERROR WHICH IS NOT EXPECTED : "); WARN("maybe due to presence of '-w' compiler option"); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } else { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } } else { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } } @@ -1769,6 +1758,7 @@ bool check_conversionwarning_enabled(const char** Combination_CO, int Combinatio HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); std::string variable = "warning"; if (-1 != log.find(variable)) { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } else { WARN("Compiler Option : " << compiler_option); @@ -1779,6 +1769,7 @@ bool check_conversionwarning_enabled(const char** Combination_CO, int Combinatio } } WARN("LOG DOESN'T CONTAIN WARNING AS EXP : " << compiler_option); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -1790,6 +1781,7 @@ bool check_conversionwarning_enabled(const char** Combination_CO, int Combinatio } } WARN("LOG IS NOT GENERATED"); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -1839,11 +1831,14 @@ bool check_conversionwarning_disabled(const char** Combination_CO, int Combinati } WARN("WARNING IS GENERATED WHICH IS NOT EXPECTED"); WARN(compiler_option); + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } else { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } } else { + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 1; } } @@ -1879,7 +1874,7 @@ bool check_max_thread(const char** Combination_CO, int Combination_CO_size, int } int a = 0; std::vector variable(Target_Thrd_Vals_int.size(), ""); - const char** appended_compiler_options = new const char*[Target_Thrd_Vals_int.size()]; + std::vector appended_compiler_options(Target_Thrd_Vals_int.size()); for (int i = 0; i < Target_Thrd_Vals_int.size(); i++) { variable[i] = compiler_option + std::to_string(Target_Thrd_Vals_int[i]); appended_compiler_options[i] = variable[i].c_str(); @@ -1936,6 +1931,7 @@ bool check_max_thread(const char** Combination_CO, int Combination_CO_size, int HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -1952,6 +1948,7 @@ bool check_max_thread(const char** Combination_CO, int Combination_CO_size, int HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -1976,6 +1973,7 @@ bool check_max_thread(const char** Combination_CO, int Combination_CO_size, int hipError_t status = hipModuleLaunchKernel(function, 1, 1, 1, Input_Thrd_Vals_int[test_case], 1, 1, 0, 0, nullptr, kernel_parameter); HIP_CHECK(hipMemcpy(ptr_num_threads_h, Thread_count_d, sizeof(int), hipMemcpyDeviceToHost)); + HIP_CHECK(hipFree(Thread_count_d)); if ((status == hipSuccess) && (num_threads_h <= Target_Thrd_Vals_int[senario])) { check = 1; } else { @@ -2056,6 +2054,7 @@ bool check_unsafe_atomic_enabled(const char** Combination_CO, int Combination_CO HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -2071,6 +2070,7 @@ bool check_unsafe_atomic_enabled(const char** Combination_CO, int Combination_CO HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -2099,6 +2099,7 @@ bool check_unsafe_atomic_enabled(const char** Combination_CO, int Combination_CO HIP_CHECK(hipModuleUnload(module)); HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); } + HIP_CHECK(hipFree(A_d)); if (sum_w != sum_tocheck) { return 1; } else { @@ -2162,6 +2163,7 @@ bool check_unsafe_atomic_disabled(const char** Combination_CO, int Combination_C HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } else { @@ -2177,6 +2179,7 @@ bool check_unsafe_atomic_disabled(const char** Combination_CO, int Combination_C HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return 0; } } @@ -2194,6 +2197,7 @@ bool check_unsafe_atomic_disabled(const char** Combination_CO, int Combination_C HIP_CHECK(hipModuleGetFunction(&function, module, kername)); HIP_CHECK(hipModuleLaunchKernel(function, N, 1, 1, N, 1, 1, 0, 0, nullptr, kernel_parameter)); HIP_CHECK(hipMemcpy(A_h, A_d, Nbytes, hipMemcpyDeviceToHost)); + HIP_CHECK(hipFree(A_d)); for (int i = 0; i < N; i++) { sum += A_h[i]; } @@ -2235,12 +2239,12 @@ bool check_infinite_num_enabled(const char** Combination_CO, int Combination_CO_ return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -2301,12 +2305,12 @@ bool check_infinite_num_disabled(const char** Combination_CO, int Combination_CO return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -2367,12 +2371,12 @@ bool check_NAN_num_enabled(const char** Combination_CO, int Combination_CO_size, return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -2432,12 +2436,12 @@ bool check_NAN_num_disabled(const char** Combination_CO, int Combination_CO_size return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -2497,12 +2501,12 @@ bool check_finite_math_enabled(const char** Combination_CO, int Combination_CO_s return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -2562,12 +2566,12 @@ bool check_finite_math_disabled(const char** Combination_CO, int Combination_CO_ return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -2627,7 +2631,7 @@ bool check_associative_math_enabled(const char** Combination_CO, int Combination return 0; } int CO_IRadded_size = 4, a = 0; - const char** CO_IRadded = new const char*[4]; + std::vector CO_IRadded(4); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-fno-signed-zeros"; CO_IRadded[2] = "-mllvm"; @@ -2637,7 +2641,7 @@ bool check_associative_math_enabled(const char** Combination_CO, int Combination int Combination_CO_IRadded_size = Combination_CO_size + 1; int b = 0; std::vector add_ir_forcombi(Combination_CO_size + 1, ""); - const char** Combination_CO_IRadded = new const char*[Combination_CO_size + 1]; + std::vector Combination_CO_IRadded(Combination_CO_size + 1); for (int i = 0; i < Combination_CO_size + 1; ++i) { if (i == Combination_CO_size) { Combination_CO_IRadded[i] = "-fno-signed-zeros"; @@ -2647,10 +2651,10 @@ bool check_associative_math_enabled(const char** Combination_CO, int Combination Combination_CO_IRadded[i] = add_ir_forcombi[i].c_str(); b++; } - data = checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO_IRadded, + data = checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO_IRadded.data(), Combination_CO_IRadded_size); } else { - data = checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + data = checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); } if (data == "") { WARN("Compiler option : " << retrieved_CO); @@ -2712,7 +2716,7 @@ bool check_associative_math_disabled(const char** Combination_CO, int Combinatio return 0; } int CO_IRadded_size = 4, a = 0; - const char** CO_IRadded = new const char*[4]; + std::vector CO_IRadded(4); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-fno-signed-zeros"; CO_IRadded[2] = "-mllvm"; @@ -2722,7 +2726,7 @@ bool check_associative_math_disabled(const char** Combination_CO, int Combinatio int Combination_CO_IRadded_size = Combination_CO_size + 1; int b = 0; std::vector add_ir_forcombi(Combination_CO_size + 1, ""); - const char** Combination_CO_IRadded = new const char*[Combination_CO_size + 1]; + std::vector Combination_CO_IRadded(Combination_CO_size + 1); for (int i = 0; i < Combination_CO_size + 1; ++i) { if (i == Combination_CO_size) { Combination_CO_IRadded[i] = "-fno-signed-zeros"; @@ -2732,10 +2736,10 @@ bool check_associative_math_disabled(const char** Combination_CO, int Combinatio Combination_CO_IRadded[i] = add_ir_forcombi[i].c_str(); b++; } - data = checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO_IRadded, + data = checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO_IRadded.data(), Combination_CO_IRadded_size); } else { - data = checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + data = checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); } if (data == "") { WARN("Compiler option : " << retrieved_CO); @@ -2796,12 +2800,12 @@ bool check_signed_zeros_enabled(const char** Combination_CO, int Combination_CO_ return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -2861,12 +2865,12 @@ bool check_signed_zeros_disabled(const char** Combination_CO, int Combination_CO return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -2926,12 +2930,12 @@ bool check_trapping_math_enabled(const char** Combination_CO, int Combination_CO return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -2975,12 +2979,12 @@ bool check_trapping_math_disabled(const char** Combination_CO, int Combination_C return 0; } int CO_IRadded_size = 3, a = 0; - const char** CO_IRadded = new const char*[3]; + std::vector CO_IRadded(3); CO_IRadded[0] = retrieved_CO.c_str(); CO_IRadded[1] = "-mllvm"; CO_IRadded[2] = "-print-after=constmerge"; std::string data = - checking_IR(kername, CO_IRadded, CO_IRadded_size, Combination_CO, Combination_CO_size); + checking_IR(kername, CO_IRadded.data(), CO_IRadded_size, Combination_CO, Combination_CO_size); if (data == "") { WARN("Compiler option : " << retrieved_CO); if (Combination_CO_size != -1) { @@ -3011,12 +3015,8 @@ std::string checking_IR(const char* kername, const char** extra_CO_IRadded, int extra_CO_IRadded_size, const char** Combination_CO, int Combination_CO_size) { float *A_d, *B_d, *C_d; - float *A_h, *B_h, *C_h, *result; + std::vector A_h(1), B_h(1), C_h(1), result(1); float Nbytes = sizeof(float); - A_h = new float[1]; - B_h = new float[1]; - C_h = new float[1]; - result = new float[1]; for (int i = 0; i < 1; i++) { A_h[i] = 0.1f; B_h[i] = 0.1f; @@ -3026,33 +3026,37 @@ std::string checking_IR(const char* kername, const char** extra_CO_IRadded, HIP_CHECK(hipMalloc(&A_d, Nbytes)); HIP_CHECK(hipMalloc(&B_d, Nbytes)); HIP_CHECK(hipMalloc(&C_d, Nbytes)); - HIP_CHECK(hipMemcpy(A_d, A_h, Nbytes, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(B_d, B_h, Nbytes, hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(C_d, C_h, Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(A_d, A_h.data(), Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(B_d, B_h.data(), Nbytes, hipMemcpyHostToDevice)); + HIP_CHECK(hipMemcpy(C_d, C_h.data(), Nbytes, hipMemcpyHostToDevice)); hiprtcProgram prog; HIPRTC_CHECK(hiprtcCreateProgram(&prog, ffp_contract_string, kername, 0, NULL, NULL)); + CaptureIR ir_capture; + auto dump_dir = ir_capture.CreateDumpDir(); + std::string ir_dump_option = "-ir-dump-directory=" + dump_dir.string(); int Combination_CO_IRadded_size; - CaptureStream capture(stderr); if (Combination_CO_size != -1) { - Combination_CO_IRadded_size = Combination_CO_size + 2; + Combination_CO_IRadded_size = Combination_CO_size + 4; int b = 0; - std::vector add_ir_forcombi(Combination_CO_size + 2, ""); - const char** Combination_CO_IRadded = new const char*[Combination_CO_size + 2]; - for (int i = 0; i < Combination_CO_size + 2; ++i) { + std::vector add_ir_forcombi(Combination_CO_size + 4, ""); + std::vector Combination_CO_IRadded(Combination_CO_size + 4); + for (int i = 0; i < Combination_CO_size + 4; ++i) { if (i == Combination_CO_size) { Combination_CO_IRadded[i] = "-mllvm"; Combination_CO_IRadded[i + 1] = "-print-after=constmerge"; + Combination_CO_IRadded[i + 2] = "-mllvm"; + add_ir_forcombi[i + 3] = ir_dump_option; + Combination_CO_IRadded[i + 3] = add_ir_forcombi[i + 3].c_str(); break; } add_ir_forcombi[i] = Combination_CO[b]; Combination_CO_IRadded[i] = add_ir_forcombi[i].c_str(); b++; } - capture.Begin(); hiprtcResult compileResult{ - hiprtcCompileProgram(prog, Combination_CO_IRadded_size, Combination_CO_IRadded)}; - capture.End(); + hiprtcCompileProgram(prog, Combination_CO_IRadded_size, Combination_CO_IRadded.data())}; if (!(compileResult == HIPRTC_SUCCESS)) { + ir_capture.Cleanup(dump_dir); WARN("Compiler option : " << extra_CO_IRadded[0]); WARN("FAILED IN COMBINATION :"); for (int i = 0; i < Combination_CO_size; i++) { @@ -3067,13 +3071,24 @@ std::string checking_IR(const char* kername, const char** extra_CO_IRadded, HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return ""; } } else { - capture.Begin(); - hiprtcResult compileResult{hiprtcCompileProgram(prog, extra_CO_IRadded_size, extra_CO_IRadded)}; - capture.End(); + std::vector extra_ir_options(extra_CO_IRadded_size + 2, ""); + std::vector extra_CO_IRadded_with_dump(extra_CO_IRadded_size + 2); + for (int i = 0; i < extra_CO_IRadded_size; ++i) { + extra_ir_options[i] = extra_CO_IRadded[i]; + extra_CO_IRadded_with_dump[i] = extra_ir_options[i].c_str(); + } + extra_CO_IRadded_with_dump[extra_CO_IRadded_size] = "-mllvm"; + extra_ir_options[extra_CO_IRadded_size + 1] = ir_dump_option; + extra_CO_IRadded_with_dump[extra_CO_IRadded_size + 1] = + extra_ir_options[extra_CO_IRadded_size + 1].c_str(); + hiprtcResult compileResult{ + hiprtcCompileProgram(prog, extra_CO_IRadded_size + 2, extra_CO_IRadded_with_dump.data())}; if (!(compileResult == HIPRTC_SUCCESS)) { + ir_capture.Cleanup(dump_dir); WARN("hiprtcCompileProgram() api failed!! with error code: "); WARN(compileResult); size_t logSize; @@ -3083,9 +3098,11 @@ std::string checking_IR(const char* kername, const char** extra_CO_IRadded, HIPRTC_CHECK(hiprtcGetProgramLog(prog, &log[0])); WARN(log); } + HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); return ""; } } + std::string data = ir_capture.ReadDumpFile(dump_dir); size_t codeSize; HIPRTC_CHECK(hiprtcGetCodeSize(prog, &codeSize)); std::vector codec(codeSize); @@ -3099,15 +3116,17 @@ std::string checking_IR(const char* kername, const char** extra_CO_IRadded, HIP_CHECK(hipModuleLoadData(&module, codec.data())); HIP_CHECK(hipModuleGetFunction(&function, module, kername)); HIP_CHECK(hipModuleLaunchKernel(function, 1, 1, 1, 1, 1, 1, 0, 0, nullptr, kernel_parameter)); - HIP_CHECK(hipMemcpy(result, C_d, Nbytes, hipMemcpyDeviceToHost)); + HIP_CHECK(hipMemcpy(result.data(), C_d, Nbytes, hipMemcpyDeviceToHost)); for (int i = 0; i < 1; i++) { if (result[i] != ((A_h[i] * B_h[i]) + C_h[i])) { return ""; } } - std::string data = capture.getData(); std::stringstream dataStream; HIP_CHECK(hipModuleUnload(module)); HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); + HIP_CHECK(hipFree(A_d)); + HIP_CHECK(hipFree(B_d)); + HIP_CHECK(hipFree(C_d)); return data; } diff --git a/catch/unit/rtc/RtcUtility.cpp b/catch/unit/rtc/RtcUtility.cpp index bc31565fb..f5ab8aad5 100644 --- a/catch/unit/rtc/RtcUtility.cpp +++ b/catch/unit/rtc/RtcUtility.cpp @@ -1,21 +1,8 @@ /* -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 -to use, copy, modify, merge, publish, distribute, sublicense, and/or sindxl -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This file has definition of functions for the following functinality: @@ -107,16 +94,9 @@ int calling_combination_function(std::vector combi_vec_list) { } } else if (combi_vec_list[i] == "header_dir") { std::string retrived_CO = get_string_parameters("compiler_option", "header_dir"); - std::string str = "pwd"; - const char* cmd = str.c_str(); - CaptureStream capture(stdout); - capture.Begin(); - system(cmd); - capture.End(); - std::string wor_dir = capture.getData(); - std::string break_dir = wor_dir.substr(0, wor_dir.find("build")); - std::string append_str = "catch/unit/rtc/headers"; - std::string CO = retrived_CO + " " + break_dir + append_str; + std::string wor_dir = std::filesystem::current_path().string(); + std::string append_str = "/headers"; + std::string CO = retrived_CO + " " + wor_dir + append_str; hold_CO[i] = CO; } else if (combi_vec_list[i] == "architecture") { std::string retrived_CO = get_string_parameters("compiler_option", "architecture"); @@ -186,6 +166,7 @@ int calling_combination_function(std::vector combi_vec_list) { } Combination_CO[j] = hold_CO[j].c_str(); } + delete[] Combination_CO; return errors; } @@ -326,32 +307,26 @@ bool calling_resp_function(const std::string block_name, const char** Combinatio } picojson::array getblock_fromconfig() { - std::string str = "pwd"; - const char* cmd = str.c_str(); - CaptureStream capture(stdout); - capture.Begin(); - system(cmd); - capture.End(); - std::string wor_dir = capture.getData(); - std::string break_dir = wor_dir.substr(0, wor_dir.find("build")); - std::string append_str = "catch/unit/rtc/RtcConfig.json"; - std::string config_path = break_dir + append_str; - std::string returnValue = ""; - std::ifstream json_file(config_path.c_str()); - if (!json_file.is_open()) { - WARN("Error loading config.jason"); - exit(0); - } - std::string json_str((std::istreambuf_iterator(json_file)), - std::istreambuf_iterator()); - picojson::value v; - std::string err = picojson::parse(v, json_str); - if (!err.empty()) { - WARN("empty config.jason"); - exit(0); + static picojson::array cached_blocks; + static bool initialized = false; + if (!initialized) { + std::string wor_dir = std::filesystem::current_path().string(); + std::string config_path = wor_dir + "/RtcConfig.json"; + std::ifstream json_file(config_path.c_str()); + if (!json_file.is_open()) { + FAIL("Error loading config.json"); + } + std::string json_str((std::istreambuf_iterator(json_file)), + std::istreambuf_iterator()); + picojson::value v; + std::string err = picojson::parse(v, json_str); + if (!err.empty()) { + FAIL("empty config.json"); + } + cached_blocks = v.get(); + initialized = true; } - picojson::array& blocks = v.get(); - return blocks; + return cached_blocks; } std::string get_string_parameters(std::string para_name_to_retrieve, std::string block_name) { diff --git a/catch/unit/rtc/customOptions.cc b/catch/unit/rtc/customOptions.cc index 609c6ac5a..bd65b6594 100644 --- a/catch/unit/rtc/customOptions.cc +++ b/catch/unit/rtc/customOptions.cc @@ -24,7 +24,7 @@ __global__ void kernel(int* a) { } )"}; -TEST_CASE("Unit_hiprtc_cpp17") { +TEST_CASE(Unit_hiprtc_cpp17) { using namespace std; hiprtcProgram prog; hiprtcCreateProgram(&prog, // prog @@ -93,7 +93,7 @@ template __global__ void my_sqrt(T* input, int N) { } )"}; -TEST_CASE("Unit_hiprtc_namehandling") { +TEST_CASE(Unit_hiprtc_namehandling) { using namespace std; hiprtcProgram prog; hiprtcCreateProgram(&prog, // prog @@ -148,7 +148,7 @@ TEST_CASE("Unit_hiprtc_namehandling") { REQUIRE(compileResult == HIPRTC_SUCCESS); } -TEST_CASE("Unit_hiprtc_getloweredname") { +TEST_CASE(Unit_hiprtc_getloweredname) { using namespace std; hiprtcProgram prog; hiprtcCreateProgram(&prog, // prog diff --git a/catch/unit/rtc/headers/RtcFact.h b/catch/unit/rtc/headers/RtcFact.h index 43e19bff4..a761f028d 100644 --- a/catch/unit/rtc/headers/RtcFact.h +++ b/catch/unit/rtc/headers/RtcFact.h @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This file is being read by a function defined check_headers which is present in diff --git a/catch/unit/rtc/headers/RtcFunctions.h b/catch/unit/rtc/headers/RtcFunctions.h index 8fc7ac04b..70652fc28 100644 --- a/catch/unit/rtc/headers/RtcFunctions.h +++ b/catch/unit/rtc/headers/RtcFunctions.h @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* The Functions defined in RtcFunctions.cpp are declared here in RtcFunctions.h. diff --git a/catch/unit/rtc/headers/RtcKernels.h b/catch/unit/rtc/headers/RtcKernels.h index 2aab8af92..c8778bc3d 100644 --- a/catch/unit/rtc/headers/RtcKernels.h +++ b/catch/unit/rtc/headers/RtcKernels.h @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* RtcKernels.h contains the string's with the which includes the kernel code. diff --git a/catch/unit/rtc/headers/RtcUtility.h b/catch/unit/rtc/headers/RtcUtility.h index 9327f1b5a..438946ebd 100644 --- a/catch/unit/rtc/headers/RtcUtility.h +++ b/catch/unit/rtc/headers/RtcUtility.h @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* The Functions defined in RtcUtility.cpp are declared here in RtcUtility.h. diff --git a/catch/unit/rtc/headers/printf_common.h b/catch/unit/rtc/headers/printf_common.h index d3979cf3c..cef1d5928 100644 --- a/catch/unit/rtc/headers/printf_common.h +++ b/catch/unit/rtc/headers/printf_common.h @@ -1,31 +1,21 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #ifndef CATCH_UNIT_RTC_HEADERS_PRINTF_COMMON_H_ #define CATCH_UNIT_RTC_HEADERS_PRINTF_COMMON_H_ #include #include #include #include +#include #include #include #include #include +#include #if defined(_WIN32) #include @@ -173,6 +163,53 @@ struct CaptureStream { }; #endif +struct CaptureIR { + std::filesystem::path CreateDumpDir() { + std::error_code ec; + const std::filesystem::path base = std::filesystem::current_path(ec); + if (ec) return {}; + + std::string template_path = (base / "ir_dumps_XXXXXX").string(); + std::vector buffer(template_path.begin(), template_path.end()); + buffer.push_back('\0'); + char* result = mkdtemp(buffer.data()); + return result ? std::filesystem::path(result) : std::filesystem::path{}; + } + + void Cleanup(const std::filesystem::path& dir) { + if (dir.empty()) return; + std::error_code ec; + std::filesystem::remove_all(dir, ec); + } + + std::string ReadDumpFile(const std::filesystem::path& dir) { + if (dir.empty()) return ""; + + std::error_code ec; + std::filesystem::path dump_file; + for (const auto& entry : std::filesystem::directory_iterator(dir, ec)) { + if (ec) break; + if (!entry.is_regular_file(ec)) continue; + if (!dump_file.empty()) { + dump_file.clear(); + break; + } + dump_file = entry.path(); + } + + std::string data; + if (!dump_file.empty()) { + std::ifstream file(dump_file, std::ios::binary); + if (file) { + data.assign((std::istreambuf_iterator(file)), std::istreambuf_iterator()); + } + } + + Cleanup(dir); + return data; + } +}; + #define DECLARE_DATA() \ const char* msg_short = "Carpe diem."; \ const char* msg_long1 = \ diff --git a/catch/unit/rtc/headers/test_header1.h b/catch/unit/rtc/headers/test_header1.h index 29f2eeea7..5c7acd02f 100644 --- a/catch/unit/rtc/headers/test_header1.h +++ b/catch/unit/rtc/headers/test_header1.h @@ -1,3 +1,9 @@ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #ifndef HIPRTC_TEST_HEADER1_H #define HIPRTC_TEST_HEADER1_H typedef float real; diff --git a/catch/unit/rtc/headers/test_header2.h b/catch/unit/rtc/headers/test_header2.h index f98ade21c..f6e1a6f0c 100644 --- a/catch/unit/rtc/headers/test_header2.h +++ b/catch/unit/rtc/headers/test_header2.h @@ -1,3 +1,9 @@ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #ifndef HIPRTC_TEST_HEADER2_H #define HIPRTC_TEST_HEADER2_H typedef float* realptr; diff --git a/catch/unit/rtc/hipRTCDeviceMalloc.cc b/catch/unit/rtc/hipRTCDeviceMalloc.cc index ecccaeaba..0d988f888 100644 --- a/catch/unit/rtc/hipRTCDeviceMalloc.cc +++ b/catch/unit/rtc/hipRTCDeviceMalloc.cc @@ -36,7 +36,7 @@ void devicemalloc(float* x, float* y, float* out, float** px, float** py, size_t } )"}; -TEST_CASE("Unit_hiprtc_devicemalloc") { +TEST_CASE(Unit_hiprtc_devicemalloc) { int pcieAtomic = 0; HIP_CHECK(hipDeviceGetAttribute(&pcieAtomic, hipDeviceAttributeHostNativeAtomicSupported, 0)); if (!pcieAtomic) { diff --git a/catch/unit/rtc/hipRtcBfloat16.cc b/catch/unit/rtc/hipRtcBfloat16.cc index ff7625c2d..8fddb9d84 100644 --- a/catch/unit/rtc/hipRtcBfloat16.cc +++ b/catch/unit/rtc/hipRtcBfloat16.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ // This test verifies the accuracy of hip_bfloat16 and its usage with hiprtc @@ -52,7 +39,7 @@ void test_hip_bfloat16(float* f, bool* result) } )"}; -TEST_CASE("Unit_hiprtc_test_hip_bfloat16") { +TEST_CASE(Unit_hiprtc_test_hip_bfloat16) { using namespace std; hiprtcProgram prog; HIPRTC_CHECK(hiprtcCreateProgram(&prog, code, "code.cu", 0, nullptr, nullptr)); diff --git a/catch/unit/rtc/hipRtcComplexHeader.cc b/catch/unit/rtc/hipRtcComplexHeader.cc index 5c237ff0d..b8068ab70 100644 --- a/catch/unit/rtc/hipRtcComplexHeader.cc +++ b/catch/unit/rtc/hipRtcComplexHeader.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hiprtc_Complex_HeaderTst hiprtc_Complex_HeaderTst @@ -153,7 +140,7 @@ __global__ void hip_complex_corner_double_kernel(int *res) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_Rtc_HipComplex_header") { +TEST_CASE(Unit_Rtc_HipComplex_header) { int n = 0; hipDeviceProp_t prop; HIP_CHECK(hipGetDeviceProperties(&prop, 0)); diff --git a/catch/unit/rtc/hipRtcFunctional.cc b/catch/unit/rtc/hipRtcFunctional.cc index 4dc6e086a..a5d16e60b 100644 --- a/catch/unit/rtc/hipRtcFunctional.cc +++ b/catch/unit/rtc/hipRtcFunctional.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This test verifies few functional scenarios of hiprtc * hipRTC program should be created even if the name passed is empty or null @@ -43,7 +27,7 @@ __global__ void testinline() } )"}; -TEST_CASE("Unit_hiprtc_functional") { +TEST_CASE(Unit_hiprtc_functional) { using namespace std; hiprtcProgram prog; HIPRTC_CHECK(hiprtcCreateProgram(&prog, code, nullptr, 0, nullptr, nullptr)); diff --git a/catch/unit/rtc/hipRtcPtrdiff_t.cc b/catch/unit/rtc/hipRtcPtrdiff_t.cc index 78b8fa525..d123addc4 100644 --- a/catch/unit/rtc/hipRtcPtrdiff_t.cc +++ b/catch/unit/rtc/hipRtcPtrdiff_t.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -57,7 +45,7 @@ __global__ void ptrdiff_Kernel(unsigned int *res, int platformVar) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipRTC_Ptrdiff_t_Check") { +TEST_CASE(Unit_hipRTC_Ptrdiff_t_Check) { std::string kernel_name = "ptrdiff_Kernel"; const char* kername = kernel_name.c_str(); unsigned int* result_h; @@ -134,7 +122,7 @@ TEST_CASE("Unit_hipRTC_Ptrdiff_t_Check") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipRTC_Check_Ptrdiff_t_FrmChildProcess") { +TEST_CASE(Unit_hipRTC_Check_Ptrdiff_t_FrmChildProcess) { // Spawn a process hip::SpawnProc proc("ChkPtrdiff_t_Exe", true); if ((proc.run("HIPRTC_PTRDIFF_T_IS_LONG_LONG 1") == 1) && diff --git a/catch/unit/rtc/hipStreamCaptureRtc.cc b/catch/unit/rtc/hipStreamCaptureRtc.cc index c7adcdd74..c1527812a 100644 --- a/catch/unit/rtc/hipStreamCaptureRtc.cc +++ b/catch/unit/rtc/hipStreamCaptureRtc.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -31,7 +18,7 @@ static constexpr auto kernel_src{ )_KERN_EMBED_"}; -TEST_CASE("Unit_hipStreamCaptureRtc") { +TEST_CASE(Unit_hipStreamCaptureRtc) { hipStream_t stream = nullptr; hipGraph_t graph = nullptr; hipGraphExec_t graph_exec = nullptr; diff --git a/catch/unit/rtc/hiprtcComplrOptnTesting.cc b/catch/unit/rtc/hiprtcComplrOptnTesting.cc index fccc842c8..bcce331e4 100644 --- a/catch/unit/rtc/hiprtcComplrOptnTesting.cc +++ b/catch/unit/rtc/hiprtcComplrOptnTesting.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -36,177 +23,177 @@ HIPRTC supported compiler option idividually. */ // SINGLE COMPILER OPTION TESTING const char** null = {}; -TEST_CASE("Unit_hiprtcGpuArchComplrOptnTst") { + TEST_CASE(Unit_hiprtcGpuArchComplrOptnTst) { INFO("Testing '--gpu-architecture=gfx906:sramecc+:xnack-' compiler opt"); REQUIRE(check_architecture(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcGpuRdcComplrOptnTst") { + TEST_CASE(Unit_hiprtcGpuRdcComplrOptnTst) { INFO("Testing '-fgpu-rdc' compiler option"); REQUIRE(check_rdc(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledDenormalsComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledDenormalsComplrOptnTst) { INFO("Testing '-fgpu-flush-denormals-to-zero' compiler option"); REQUIRE(check_denormals_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledDenormalsComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledDenormalsComplrOptnTst) { INFO("Testing '-fno-gpu-flush-denormals-to-zero' compiler option"); REQUIRE(check_denormals_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcOff_ffpContractComplrOptnTst") { + TEST_CASE(Unit_hiprtcOff_ffpContractComplrOptnTst) { INFO("Testing '-ffp-contract=off' compiler option"); REQUIRE(check_ffp_contract_off(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcOnffpContractComplrOptnTst") { + TEST_CASE(Unit_hiprtcOnffpContractComplrOptnTst) { INFO("Testing '-ffp-contract=on' compiler option"); REQUIRE(check_ffp_contract_on(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcFastffpContractComplrOptnTst") { + TEST_CASE(Unit_hiprtcFastffpContractComplrOptnTst) { INFO("Testing '-ffp-contract=fast' compiler option"); REQUIRE(check_ffp_contract_fast(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledFastMathComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledFastMathComplrOptnTst) { INFO("Testing '-ffast-math' compiler option"); REQUIRE(check_fast_math_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledFastMathComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledFastMathComplrOptnTst) { INFO("Testing '-fno-fast-math' compiler option"); REQUIRE(check_fast_math_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledSlpVectorizeComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledSlpVectorizeComplrOptnTst) { INFO("Testing '-fslp-vectorize' compiler option"); REQUIRE(check_slp_vectorize_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledSlpVectorizeComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledSlpVectorizeComplrOptnTst) { INFO("Testing '-fno-slp-vectorize' compiler option"); REQUIRE(check_slp_vectorize_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDefineMacroComplrOptnTst") { + TEST_CASE(Unit_hiprtcDefineMacroComplrOptnTst) { INFO("Testing '-D' compiler option"); REQUIRE(check_macro(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcUndefMacroComplrOptnTst") { + TEST_CASE(Unit_hiprtcUndefMacroComplrOptnTst) { INFO("Testing '-U' compiler option"); REQUIRE(check_undef_macro(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcHeaderDirectoryComplrOptnTst") { + TEST_CASE(Unit_hiprtcHeaderDirectoryComplrOptnTst) { INFO("Testing '-I' compiler option"); REQUIRE(check_header_dir(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcWarningComplrOptnTst") { + TEST_CASE(Unit_hiprtcWarningComplrOptnTst) { INFO("Testing '-w' compiler option"); REQUIRE(check_warning(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcRpassInlineComplrOptnTst") { + TEST_CASE(Unit_hiprtcRpassInlineComplrOptnTst) { INFO("Testing '-Rpass=inline' compiler option"); REQUIRE(check_Rpass_inline(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledConversionErrComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledConversionErrComplrOptnTst) { INFO("Testing '-Werror=conversion' compiler option"); REQUIRE(check_conversionerror_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledConversionErrComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledConversionErrComplrOptnTst) { INFO("Testing '-Wno-error=conversion' compiler option"); REQUIRE(check_conversionerror_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledConversionWarningComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledConversionWarningComplrOptnTst) { INFO("Testing '-Wconversion' compiler option"); REQUIRE(check_conversionwarning_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledConversionWarningComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledConversionWarningComplrOptnTst) { INFO("Testing '-Wno-conversion' compiler option"); REQUIRE(check_conversionwarning_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcGpuMaxThreadPerBlockComplrOptnTst") { + TEST_CASE(Unit_hiprtcGpuMaxThreadPerBlockComplrOptnTst) { INFO("Testing '--gpu-max-threads-per-block=n' compiler option"); REQUIRE(check_max_thread(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledUnsafeAtomicComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledUnsafeAtomicComplrOptnTst) { INFO("Testing '-munsafe-fp-atomics' compiler option"); REQUIRE(check_unsafe_atomic_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledUnsafeAtomicComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledUnsafeAtomicComplrOptnTst) { INFO("Testing '-mno-unsafe-fp-atomics' compiler option"); REQUIRE(check_unsafe_atomic_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledInfiniteNumComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledInfiniteNumComplrOptnTst) { INFO("Testing '-fhonor-infinities' compiler option"); REQUIRE(check_infinite_num_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledInfiniteNumComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledInfiniteNumComplrOptnTst) { INFO("Testing '-fno-honor-infinities' compiler option"); REQUIRE(check_infinite_num_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledNANComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledNANComplrOptnTst) { INFO("Testing '-fhonor-nans' compiler option"); REQUIRE(check_NAN_num_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledNANComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledNANComplrOptnTst) { INFO("Testing '-fno-honor-nans' compiler option"); REQUIRE(check_NAN_num_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledFiniteMathComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledFiniteMathComplrOptnTst) { INFO("Testing '-ffinite-math-only' compiler option"); REQUIRE(check_finite_math_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledFiniteMathComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledFiniteMathComplrOptnTst) { INFO("Testing '-fno-finite-math-only' compiler option"); REQUIRE(check_finite_math_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledAssociativeMathComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledAssociativeMathComplrOptnTst) { INFO("Testing '-fassociative-math' compiler option"); REQUIRE(check_associative_math_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledAssociativeMathComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledAssociativeMathComplrOptnTst) { INFO("Testing '-fno-associative-math' compiler option"); REQUIRE(check_associative_math_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledSignedZerosComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledSignedZerosComplrOptnTst) { INFO("Testing '-fsigned-zeros' compiler option"); REQUIRE(check_signed_zeros_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledSignedZerosComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledSignedZerosComplrOptnTst) { INFO("Testing '-fno-signed-zeros' compiler option"); REQUIRE(check_signed_zeros_disabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcEnabledTrappingMathComplrOptnTst") { + TEST_CASE(Unit_hiprtcEnabledTrappingMathComplrOptnTst) { INFO("Testing '-ftrapping-math' compiler option"); REQUIRE(check_trapping_math_enabled(null, -1, -1, -1)); } -TEST_CASE("Unit_hiprtcDisabledTrappingMathComplrOptnTst") { + TEST_CASE(Unit_hiprtcDisabledTrappingMathComplrOptnTst) { INFO("Testing '-fno-trapping-math' compiler option"); REQUIRE(check_trapping_math_disabled(null, -1, -1, -1)); } @@ -217,7 +204,7 @@ a combination of HIPRTC supported compiler options which a retrieved from RtcConfig.jason file. */ -TEST_CASE("Unit_hiprtcCombiComplrOptnTst") { +TEST_CASE(Unit_hiprtcCombiComplrOptnTst) { // COMBINATION COMPILER OPTIONS std::vector CombiCompOptions = get_combi_string_vec(); int TotalCombos = CombiCompOptions.size(); diff --git a/catch/unit/rtc/hiprtcGetLoweredName.cc b/catch/unit/rtc/hiprtcGetLoweredName.cc index 93d65b04d..ea4815d8f 100644 --- a/catch/unit/rtc/hiprtcGetLoweredName.cc +++ b/catch/unit/rtc/hiprtcGetLoweredName.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -157,7 +144,7 @@ bool Test(int CaseNum, const char* GpuProgram) { } -TEST_CASE("Unit_hiprtcGetLoweredName_templateKrnls") { +TEST_CASE(Unit_hiprtcGetLoweredName_templateKrnls) { REQUIRE(Test(1, gpuProgram1)); REQUIRE(Test(2, gpuProgram2)); REQUIRE(Test(3, gpuProgram3)); diff --git a/catch/unit/rtc/hiprtc_Bitcode_UndefinedFn.cc b/catch/unit/rtc/hiprtc_Bitcode_UndefinedFn.cc index 4f9a6624c..1f5f04dc3 100644 --- a/catch/unit/rtc/hiprtc_Bitcode_UndefinedFn.cc +++ b/catch/unit/rtc/hiprtc_Bitcode_UndefinedFn.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -32,7 +19,7 @@ THE SOFTWARE. // hiprtc kernel has an undefined function which will be linked in the later stages using hiprtc // linker APIs -TEST_CASE("Unit_hiprtc_bitcode_undefined_function") { +TEST_CASE(Unit_hiprtc_bitcode_undefined_function) { using namespace std; static constexpr auto kernel{ diff --git a/catch/unit/rtc/hiprtc_MathConstants_HeaderTst.cc b/catch/unit/rtc/hiprtc_MathConstants_HeaderTst.cc index 5ba6c3d76..cf5a50a80 100644 --- a/catch/unit/rtc/hiprtc_MathConstants_HeaderTst.cc +++ b/catch/unit/rtc/hiprtc_MathConstants_HeaderTst.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hiprtc_MathConstants_HeaderTst hiprtc_MathConstants_HeaderTst @@ -145,7 +132,7 @@ __global__ void mathConstants(float *res) { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_Rtc_MathConstants_header") { +TEST_CASE(Unit_Rtc_MathConstants_header) { std::string kernel_name = "mathConstants"; const char* kername = kernel_name.c_str(); float* result_h; diff --git a/catch/unit/rtc/hiprtc_MathFunctions_HeaderTst.cc b/catch/unit/rtc/hiprtc_MathFunctions_HeaderTst.cc index fb876e5bb..23c0ffae5 100644 --- a/catch/unit/rtc/hiprtc_MathFunctions_HeaderTst.cc +++ b/catch/unit/rtc/hiprtc_MathFunctions_HeaderTst.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hiprtc_MathFunctions_HeaderTst hiprtc_MathFunctions_HeaderTst @@ -59,7 +46,7 @@ __global__ void mathFuntn(float *res) { * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_Rtc_MathFunctions_header") { +TEST_CASE(Unit_Rtc_MathFunctions_header) { std::string kernel_name = "mathFuntn"; const char* kername = kernel_name.c_str(); float* result_h; diff --git a/catch/unit/rtc/hiprtc_TextureTypes_HeaderTst.cc b/catch/unit/rtc/hiprtc_TextureTypes_HeaderTst.cc index bd8aea1c0..54902fad9 100644 --- a/catch/unit/rtc/hiprtc_TextureTypes_HeaderTst.cc +++ b/catch/unit/rtc/hiprtc_TextureTypes_HeaderTst.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hiprtc_TextureTypes_HeaderTst hiprtc_TextureTypes_HeaderTst @@ -67,7 +54,7 @@ __global__ void TextureTypes(float *res) { * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_Rtc_TextureTypes_header") { +TEST_CASE(Unit_Rtc_TextureTypes_header) { std::string kernel_name = "TextureTypes"; const char* kername = kernel_name.c_str(); float* result_h; diff --git a/catch/unit/rtc/hiprtc_VectorTypes_HeaderTst.cc b/catch/unit/rtc/hiprtc_VectorTypes_HeaderTst.cc index c4aa8767d..db474ab06 100644 --- a/catch/unit/rtc/hiprtc_VectorTypes_HeaderTst.cc +++ b/catch/unit/rtc/hiprtc_VectorTypes_HeaderTst.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hiprtc_VectorTypes_HeaderTst hiprtc_VectorTypes_HeaderTst @@ -1359,7 +1346,7 @@ __global__ void vectorTypes(int *res) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_Rtc_VectorTypes_header") { +TEST_CASE(Unit_Rtc_VectorTypes_header) { std::string kernel_name = "vectorTypes"; const char* kername = kernel_name.c_str(); int* result_h; diff --git a/catch/unit/rtc/hiprtc_bfloat16_HeaderTst.cc b/catch/unit/rtc/hiprtc_bfloat16_HeaderTst.cc index 61ef7e4ee..d77f1f82a 100644 --- a/catch/unit/rtc/hiprtc_bfloat16_HeaderTst.cc +++ b/catch/unit/rtc/hiprtc_bfloat16_HeaderTst.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hiprtc_bfloat16_HeaderTst hiprtc_bfloat16_HeaderTst @@ -81,7 +68,7 @@ __global__ void bfloat16(float *res) { * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_Rtc_bfloat16_header") { +TEST_CASE(Unit_Rtc_bfloat16_header) { std::string kernel_name = "bfloat16"; const char* kername = kernel_name.c_str(); float* result_h; diff --git a/catch/unit/rtc/hiprtc_fp16_HeaderTst.cc b/catch/unit/rtc/hiprtc_fp16_HeaderTst.cc index 5b2e0e82f..1c17b36e1 100644 --- a/catch/unit/rtc/hiprtc_fp16_HeaderTst.cc +++ b/catch/unit/rtc/hiprtc_fp16_HeaderTst.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hiprtc_fp16_HeaderTst hiprtc_fp16_HeaderTst @@ -289,7 +276,7 @@ __global__ void fp16(float *res) { * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_Rtc_fp16_header") { +TEST_CASE(Unit_Rtc_fp16_header) { std::string kernel_name = "fp16"; const char* kername = kernel_name.c_str(); float* result_h; diff --git a/catch/unit/rtc/includepath.cc b/catch/unit/rtc/includepath.cc index 675c56bbc..ebc0a3480 100644 --- a/catch/unit/rtc/includepath.cc +++ b/catch/unit/rtc/includepath.cc @@ -17,7 +17,7 @@ static constexpr auto NUM_BLOCKS{32}; // This test verifies hiprtc compilation by passing include path option using -I with spaces // before the path. eg: -I ../ or -I /path/to/headers etc. -TEST_CASE("Unit_hiprtc_includepath") { +TEST_CASE(Unit_hiprtc_includepath) { using namespace std; string saxpy = ""; diff --git a/catch/unit/rtc/linker.cc b/catch/unit/rtc/linker.cc index e75e859cb..ec46ac5a5 100644 --- a/catch/unit/rtc/linker.cc +++ b/catch/unit/rtc/linker.cc @@ -28,7 +28,7 @@ void saxpy(float a, float* x, float* y, float* out, size_t n) } )"}; -TEST_CASE("Unit_RTC_LinkerAPI_Negative") { +TEST_CASE(Unit_RTC_LinkerAPI_Negative) { SECTION("get bitcode - nullptr size and code") { hiprtcProgram program; REQUIRE(hiprtcGetBitcodeSize(program, nullptr) == HIPRTC_ERROR_INVALID_INPUT); @@ -49,14 +49,14 @@ TEST_CASE("Unit_RTC_LinkerAPI_Negative") { } } -TEST_CASE("Unit_RTC_LinkDestroy_Negative") { +TEST_CASE(Unit_RTC_LinkDestroy_Negative) { SECTION("link destroy - incorrect hiprtcLinkState") { hiprtcLinkState linkstate; REQUIRE(hiprtcLinkDestroy(linkstate) == HIPRTC_ERROR_INVALID_INPUT); } } -TEST_CASE("Unit_RTC_LinkDestroy_Default") { +TEST_CASE(Unit_RTC_LinkDestroy_Default) { SECTION("link destroy - nullptr") { REQUIRE(hiprtcLinkDestroy(nullptr) == HIPRTC_ERROR_INVALID_INPUT); } @@ -80,7 +80,7 @@ std::vector createBitcodeFromSource(const char* src, const char* name, int return code; } -TEST_CASE("Unit_RTC_LinkerAPI") { +TEST_CASE(Unit_RTC_LinkerAPI) { const char* options[]{"-fgpu-rdc"}; std::vector code = createBitcodeFromSource(src, "saxpy", 1, options); @@ -151,7 +151,7 @@ TEST_CASE("Unit_RTC_LinkerAPI") { } } -TEST_CASE("Unit_RTC_LinkAddFile_Negative") { +TEST_CASE(Unit_RTC_LinkAddFile_Negative) { static constexpr hiprtcJITInputType input_type = HIPRTC_JIT_INPUT_LLVM_BITCODE; static constexpr const char* file_name = "bitcode_file"; @@ -184,7 +184,7 @@ TEST_CASE("Unit_RTC_LinkAddFile_Negative") { } } -TEST_CASE("Unit_RTC_LinkAddFile_Default") { +TEST_CASE(Unit_RTC_LinkAddFile_Default) { // Create bitcode and save it to file const char* options[]{"-fgpu-rdc"}; std::vector code = createBitcodeFromSource(src, "saxpy", 1, options); diff --git a/catch/unit/rtc/rtc_reduce.cc b/catch/unit/rtc/rtc_reduce.cc index 1f5b26e21..8ad0400cf 100644 --- a/catch/unit/rtc/rtc_reduce.cc +++ b/catch/unit/rtc/rtc_reduce.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #define HIP_ENABLE_WARP_SYNC_BUILTINS #define HIP_ENABLE_EXTRA_WARP_SYNC_TYPES @@ -172,7 +160,7 @@ void runAndCompileTest(const std::tuple types) { HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); } -TEST_CASE("Unit_Rtc_ReduceRandom") { +TEST_CASE(Unit_Rtc_ReduceRandom) { const std::tuple allTypes; const std::tuple integralTypes; diff --git a/catch/unit/rtc/saxpy.cc b/catch/unit/rtc/saxpy.cc index 10d4968c7..93541dece 100644 --- a/catch/unit/rtc/saxpy.cc +++ b/catch/unit/rtc/saxpy.cc @@ -27,7 +27,7 @@ void saxpy(float a, float* x, float* y, float* out, size_t n) } )"}; -TEST_CASE("Unit_hiprtc_saxpy") { +TEST_CASE(Unit_hiprtc_saxpy) { using namespace std; hiprtcProgram prog; hiprtcCreateProgram(&prog, // prog diff --git a/catch/unit/rtc/saxpy.h b/catch/unit/rtc/saxpy.h index bee66c22e..a44eafe68 100644 --- a/catch/unit/rtc/saxpy.h +++ b/catch/unit/rtc/saxpy.h @@ -1,3 +1,9 @@ +/* + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include "test_header1.h" #include "test_header2.h" diff --git a/catch/unit/rtc/shfl.cc b/catch/unit/rtc/shfl.cc index 63513bff5..dff022df4 100644 --- a/catch/unit/rtc/shfl.cc +++ b/catch/unit/rtc/shfl.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -153,7 +137,7 @@ template void runTestShfl(int option) { HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); } -TEST_CASE("Unit_hiprtc_half_shuffle") { +TEST_CASE(Unit_hiprtc_half_shuffle) { runTestShfl<__half>(1); runTestShfl<__half>(2); runTestShfl<__half>(3); diff --git a/catch/unit/rtc/shfl.hh b/catch/unit/rtc/shfl.hh index b21674f6d..dc7f55dbf 100644 --- a/catch/unit/rtc/shfl.hh +++ b/catch/unit/rtc/shfl.hh @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/rtc/shfl_sync.cc b/catch/unit/rtc/shfl_sync.cc index 49afb9a02..3a9ae6100 100644 --- a/catch/unit/rtc/shfl_sync.cc +++ b/catch/unit/rtc/shfl_sync.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -157,7 +141,7 @@ template void runTestShflSync(int option) { HIPRTC_CHECK(hiprtcDestroyProgram(&prog)); } -TEST_CASE("Unit_hiprtc_half_shuffle_sync") { +TEST_CASE(Unit_hiprtc_half_shuffle_sync) { runTestShflSync<__half>(1); runTestShflSync<__half>(2); runTestShflSync<__half>(3); diff --git a/catch/unit/rtc/stdheaders.cc b/catch/unit/rtc/stdheaders.cc index ebe8e67f7..bcdae6949 100644 --- a/catch/unit/rtc/stdheaders.cc +++ b/catch/unit/rtc/stdheaders.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hiprtc_std_headers hiprtc_std_headers @@ -76,7 +60,7 @@ template __global__ void stdheader(T a, bool* passed) { * ------------------------ * - ROCM_VERSION >= 7.0 */ -TEST_CASE("Unit_hiprtc_stdheaders") { +TEST_CASE(Unit_hiprtc_stdheaders) { HipTest::HIP_SKIP_TEST("Test disabled due to incorrect ROCm version"); return; diff --git a/catch/unit/rtc/warpsize.cc b/catch/unit/rtc/warpsize.cc index 344adceb9..b76bcdb26 100644 --- a/catch/unit/rtc/warpsize.cc +++ b/catch/unit/rtc/warpsize.cc @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -43,7 +27,7 @@ void getWarpSize(int* warpSizePtr) } )"}; -TEST_CASE("Unit_hiprtc_warpsize") { +TEST_CASE(Unit_hiprtc_warpsize) { using namespace std; hiprtcProgram prog; HIPRTC_CHECK(hiprtcCreateProgram(&prog, code, "code.cu", 0, nullptr, nullptr)); diff --git a/catch/unit/stream/CMakeLists.txt b/catch/unit/stream/CMakeLists.txt index 68c60c2dc..faa2e698a 100644 --- a/catch/unit/stream/CMakeLists.txt +++ b/catch/unit/stream/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + set(COMMON_SHARED_SRC streamCommon.cc) set(TEST_SRC @@ -9,8 +13,6 @@ set(TEST_SRC hipStreamCreateWithFlags.cc hipStreamCreateWithPriority.cc hipStreamDestroy.cc - hipAPIStreamDisable.cc - hipStreamLegacy.cc hipStreamValue.cc hipStreamSynchronize.cc hipStreamQuery.cc @@ -22,8 +24,10 @@ set(TEST_SRC hipStreamLegacy_compiler_options.cc hipStreamGetId.cc hipStreamSetGetAttributes.cc + hipStreamAttachMemAsync.cc # TODO renable it TheRock is not finding it - hipStreamCopyAttributes.cc) + hipStreamCopyAttributes.cc + ) if(HIP_PLATFORM MATCHES "amd") set(TEST_SRC ${TEST_SRC} hipStreamGetCUMask.cc hipStreamWithCUMask.cc @@ -32,13 +36,14 @@ if(HIP_PLATFORM MATCHES "amd") hipStreamGetPriority_spt.cc hipStreamQuery_spt.cc hipStreamSynchronize_spt.cc - hipStreamBatchMemOp.cc) + hipStreamBatchMemOp.cc + # disabled on NVIDIA due to lack of hipStreamGetCaptureInfo_v2 in cuda 13.0+ + hipStreamLegacy.cc + + ) else() set(TEST_SRC ${TEST_SRC} - # hipStreamAttachMemAsync_old.cc # Disabling it on nvidia due to issue - # in function definition of hipStreamAttachMemAsync - # Fixing would break ABI, to be re-enabled when the fix is made. hipStreamACb_MultiThread.cc) endif() @@ -55,9 +60,7 @@ hip_add_exe_to_target( COMMON_SHARED_SRC ${COMMON_SHARED_SRC}) add_executable(hipStreamLegacy_exe EXCLUDE_FROM_ALL hipStreamLegacy_exe.cc) -set_source_files_properties(hipStreamLegacy_exe.cc PROPERTIES LANGUAGE HIP) -set_target_properties(hipStreamLegacy_exe PROPERTIES LINKER_LANGUAGE HIP) -target_link_libraries(hipStreamLegacy_exe hip::host hip::device) +set_source_files_properties(hipStreamLegacy_exe.cc PROPERTIES LANGUAGE ${GPGPU_LANGUAGE}) add_dependencies(StreamTest hipStreamLegacy_exe) set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipStreamLegacy_exe) diff --git a/catch/unit/stream/hipAPIStreamDisable.cc b/catch/unit/stream/hipAPIStreamDisable.cc deleted file mode 100644 index b8704a2f5..000000000 --- a/catch/unit/stream/hipAPIStreamDisable.cc +++ /dev/null @@ -1,75 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -#include -#include "hip/math_functions.h" - -#define NUM_STREAMS 8 - -namespace hipAPIStreamDisableTest { -const int NN = 1 << 21; - -__global__ void kernel(float* x, float* y, int n) { - int tid = threadIdx.x; - if (tid < 1) { - for (int i = 0; i < n; i++) { - x[i] = sqrt(powf(3.14159, i)); - } - y[tid] = y[tid] + 1.0f; - } -} - -__global__ void nKernel(float* y) { - int tid = threadIdx.x; - y[tid] = y[tid] + 1.0f; -} -} // namespace hipAPIStreamDisableTest - -/** - * Validate basic multistream functionalities - */ -TEST_CASE("Unit_hipStreamCreate_MultistreamBasicFunctionalities") { - hipStream_t streams[NUM_STREAMS]; - float *data[NUM_STREAMS], *yd, *xd; - float y = 1.0f, x = 1.0f; - HIP_CHECK(hipMalloc(reinterpret_cast(&yd), sizeof(float))); - HIP_CHECK(hipMalloc(reinterpret_cast(&xd), sizeof(float))); - HIP_CHECK(hipMemcpy(yd, &y, sizeof(float), hipMemcpyHostToDevice)); - HIP_CHECK(hipMemcpy(xd, &x, sizeof(float), hipMemcpyHostToDevice)); - - for (int i = 0; i < NUM_STREAMS; i++) { - HIP_CHECK(hipStreamCreate(&streams[i])); - HIP_CHECK(hipMalloc(&data[i], (hipAPIStreamDisableTest::NN) * sizeof(float))); - hipLaunchKernelGGL(HIP_KERNEL_NAME(hipAPIStreamDisableTest::kernel), dim3(1), dim3(1), 0, - streams[i], data[i], xd, hipAPIStreamDisableTest::NN); - HIP_CHECK(hipGetLastError()); - hipLaunchKernelGGL(HIP_KERNEL_NAME(hipAPIStreamDisableTest::nKernel), dim3(1), dim3(1), 0, 0, - yd); - HIP_CHECK(hipGetLastError()); - HIP_CHECK(hipStreamDestroy(streams[i])); - } - HIP_CHECK(hipMemcpy(&x, xd, sizeof(float), hipMemcpyDeviceToHost)); - HIP_CHECK(hipMemcpy(&y, yd, sizeof(float), hipMemcpyDeviceToHost)); - REQUIRE(x == y); - - HIP_CHECK(hipFree(yd)); - HIP_CHECK(hipFree(xd)); - for (int i = 0; i < NUM_STREAMS; ++i) { - HIP_CHECK(hipFree(data[i])); - } -} diff --git a/catch/unit/stream/hipDeviceGetStreamPriorityRange.cc b/catch/unit/stream/hipDeviceGetStreamPriorityRange.cc index eb813f908..d251ade48 100644 --- a/catch/unit/stream/hipDeviceGetStreamPriorityRange.cc +++ b/catch/unit/stream/hipDeviceGetStreamPriorityRange.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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. -*/ /* Testcase Scenarios : Unit_hipDeviceGetStreamPriorityRange_Default - Check if device stream piority range is valid @@ -26,7 +11,7 @@ Unit_hipDeviceGetStreamPriorityRange_Default - Check if device stream piority ra #include -TEST_CASE("Unit_hipDeviceGetStreamPriorityRange_Default") { +TEST_CASE(Unit_hipDeviceGetStreamPriorityRange_Default) { int priority_low = 0; int priority_high = 0; int devID = GENERATE(range(0, HipTest::getDeviceCount())); diff --git a/catch/unit/stream/hipLaunchHostFunc.cc b/catch/unit/stream/hipLaunchHostFunc.cc index cb474e57a..c43ef5371 100644 --- a/catch/unit/stream/hipLaunchHostFunc.cc +++ b/catch/unit/stream/hipLaunchHostFunc.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -97,7 +84,7 @@ static void Fn_ChkUserdataPtr(void* userData) { } } -TEST_CASE("Unit_hipLaunchHostFunc_basic") { +TEST_CASE(Unit_hipLaunchHostFunc_basic) { hipStream_t mystream; HIP_CHECK(hipStreamCreate(&mystream)); gusrptr = ptr0xff; @@ -109,7 +96,7 @@ TEST_CASE("Unit_hipLaunchHostFunc_basic") { } // Negative test scenario for hipLaunchHostFunc -TEST_CASE("Unit_hipLaunchHostFunc_Negative") { +TEST_CASE(Unit_hipLaunchHostFunc_Negative) { hipStream_t mystream; HIP_CHECK(hipStreamCreate(&mystream)); @@ -140,7 +127,7 @@ static void launchOperationOnStrm(usrDataS* usrDataptr, hipStream_t stream) { // Test scenario 2 // scenario that validates the host launch function on 3 different streams, // created stream, default/null stream and hipStreamPerThread. -TEST_CASE("Unit_hipLaunchHostFunc_streams") { +TEST_CASE(Unit_hipLaunchHostFunc_streams) { hipStream_t stream[NUM_OF_STREAM]; HIP_CHECK(hipStreamCreate(&stream[0])); stream[1] = 0; // Null stream @@ -178,7 +165,7 @@ static void Fn_validateMul_stream(void* userData) { ptrUsrData->isPassed = true; } -TEST_CASE("Unit_hipLaunchHostFunc_multistreams") { +TEST_CASE(Unit_hipLaunchHostFunc_multistreams) { hipStream_t mystream1, mystream2; HIP_CHECK(hipStreamCreateWithFlags(&mystream1, hipStreamNonBlocking)); HIP_CHECK(hipStreamCreateWithFlags(&mystream2, hipStreamNonBlocking)); @@ -254,7 +241,7 @@ static void Fn_Completion_state(void* userData) { ptrUsrData->isOpCompleted = true; } -TEST_CASE("Unit_hipLaunchHostFunc_KernelHost") { +TEST_CASE(Unit_hipLaunchHostFunc_KernelHost) { hipStream_t stream1, stream2, stream3; HIP_CHECK(hipStreamCreate(&stream1)); HIP_CHECK(hipStreamCreate(&stream2)); @@ -313,7 +300,7 @@ TEST_CASE("Unit_hipLaunchHostFunc_KernelHost") { // Test scenario 5 // scenario that validates the host launch function on multi device // environment. -TEST_CASE("Unit_hipLaunchHostFunc_multidevice", "[multigpu]") { +TEST_CASE(Unit_hipLaunchHostFunc_multidevice) { int num_devices; HIP_CHECK(hipGetDeviceCount(&num_devices)); if (num_devices < 2) { @@ -344,7 +331,7 @@ TEST_CASE("Unit_hipLaunchHostFunc_multidevice", "[multigpu]") { // Test scenario 6 // scenario that validates the host launch function on created // stream with same priority. -TEST_CASE("Unit_hipLaunchHostFunc_Samepriority") { +TEST_CASE(Unit_hipLaunchHostFunc_Samepriority) { int priority = 0; unsigned int flags = 0; usrDataS* usrDataptr = reinterpret_cast(malloc(sizeof(usrDataS))); @@ -370,7 +357,7 @@ TEST_CASE("Unit_hipLaunchHostFunc_Samepriority") { // Test scenario 7 // scenario that validates the host launch function on // created stream with different priority. -TEST_CASE("Unit_hipLaunchHostFunc_Diffpriority") { +TEST_CASE(Unit_hipLaunchHostFunc_Diffpriority) { int priority; int priority_low{}; int priority_high{}; @@ -429,7 +416,7 @@ void myHostNodeCallback(void* data) { *result = 0.0; // reset the result } -TEST_CASE("Unit_hipLaunchHostFunc_Graph") { +TEST_CASE(Unit_hipLaunchHostFunc_Graph) { size_t size = 1 << 12; size_t maxBlocks = 512; float *inputVec_d = NULL, *inputVec_h = NULL; diff --git a/catch/unit/stream/hipMultiStream.cc b/catch/unit/stream/hipMultiStream.cc index bf7c3b39a..d094e8a2f 100644 --- a/catch/unit/stream/hipMultiStream.cc +++ b/catch/unit/stream/hipMultiStream.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -36,7 +24,7 @@ __global__ void nKernel(float* y) { size_t tid{threadIdx.x}; y[tid] = y[tid] + 1.0f; } -TEST_CASE("Unit_hipMultiStream_sameDevice") { +TEST_CASE(Unit_hipMultiStream_sameDevice) { constexpr int num_streams{8}; hipStream_t streams[num_streams]; float *data[num_streams], *yd, *xd; @@ -62,7 +50,7 @@ TEST_CASE("Unit_hipMultiStream_sameDevice") { REQUIRE(x == Catch::Approx(y)); } -TEST_CASE("Unit_hipMultiStream_multimeDevice") { +TEST_CASE(Unit_hipMultiStream_multimeDevice) { constexpr int nLoops = 50000; constexpr int nStreams = 2; std::vector streams(nStreams); diff --git a/catch/unit/stream/hipStreamACb_MultiThread.cc b/catch/unit/stream/hipStreamACb_MultiThread.cc index 23da26b56..1b5c59e98 100644 --- a/catch/unit/stream/hipStreamACb_MultiThread.cc +++ b/catch/unit/stream/hipStreamACb_MultiThread.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenario : @@ -86,7 +73,7 @@ void Thread2_func() { HIPCHECK(hipStreamAddCallback(mystream, Thread2_Callback, Test multiple hipStreamAddCallback() called over multiple Threads. */ -TEST_CASE("Unit_hipStreamAddCallback_MultipleThreads") { +TEST_CASE(Unit_hipStreamAddCallback_MultipleThreads) { float *A_d, *C_d; size_t Nbytes = (N) * sizeof(float); constexpr float Phi = 1.618f; diff --git a/catch/unit/stream/hipStreamACb_StrmSyncTiming.cc b/catch/unit/stream/hipStreamACb_StrmSyncTiming.cc index c2ed89363..0e2ab0e58 100644 --- a/catch/unit/stream/hipStreamACb_StrmSyncTiming.cc +++ b/catch/unit/stream/hipStreamACb_StrmSyncTiming.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenario : @@ -80,7 +67,7 @@ static void HIPRT_CB Callback1(hipStream_t stream, hipError_t status, void* user Test multiple hipStreamAddCallback() called over multiple Threads. */ -TEST_CASE("Unit_hipStreamAddCallback_StrmSyncTiming") { +TEST_CASE(Unit_hipStreamAddCallback_StrmSyncTiming) { float *A_d, *C_d; size_t Nbytes = N_elmts * sizeof(float); diff --git a/catch/unit/stream/hipStreamAddCallback.cc b/catch/unit/stream/hipStreamAddCallback.cc index 2d1d4e064..608c655c0 100644 --- a/catch/unit/stream/hipStreamAddCallback.cc +++ b/catch/unit/stream/hipStreamAddCallback.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -161,7 +148,7 @@ using hipStreaAddCallbackTest::testStreamCallbackFunctionality; /* * Validates parameter list of hipStreamAddCallback. */ -TEST_CASE("Unit_hipStreamAddCallback_ParamTst_Positive") { +TEST_CASE(Unit_hipStreamAddCallback_ParamTst_Positive) { hipStream_t mystream; HIP_CHECK(hipStreamCreate(&mystream)); @@ -194,7 +181,7 @@ TEST_CASE("Unit_hipStreamAddCallback_ParamTst_Positive") { /* * Negative tests for validation of hipStreamAddCallback parameter list. */ -TEST_CASE("Unit_hipStreamAddCallback_ParamTst_Negative") { +TEST_CASE(Unit_hipStreamAddCallback_ParamTst_Negative) { hipStream_t mystream; HIP_CHECK(hipStreamCreate(&mystream)); @@ -220,7 +207,7 @@ TEST_CASE("Unit_hipStreamAddCallback_ParamTst_Negative") { /* * Validates hipStreamAddCallback functionality with default stream. */ -TEST_CASE("Unit_hipStreamAddCallback_WithDefaultStream") { +TEST_CASE(Unit_hipStreamAddCallback_WithDefaultStream) { bool TestPassed = true; TestPassed = testStreamCallbackFunctionality(true); REQUIRE(TestPassed); @@ -229,7 +216,7 @@ TEST_CASE("Unit_hipStreamAddCallback_WithDefaultStream") { /* * Validates hipStreamAddCallback functionality with defined stream. */ -TEST_CASE("Unit_hipStreamAddCallback_WithCreatedStream") { +TEST_CASE(Unit_hipStreamAddCallback_WithCreatedStream) { bool TestPassed = true; TestPassed = testStreamCallbackFunctionality(false); REQUIRE(TestPassed); diff --git a/catch/unit/stream/hipStreamAttachMemAsync.cc b/catch/unit/stream/hipStreamAttachMemAsync.cc index e02754dfb..1d6c5d386 100644 --- a/catch/unit/stream/hipStreamAttachMemAsync.cc +++ b/catch/unit/stream/hipStreamAttachMemAsync.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ // TODO Enable it after hipStreamAttachMemAsync is feature complete on HIP @@ -26,7 +13,7 @@ __device__ __managed__ int var = 0; enum class StreamAttachTestType { NullStream = 0, StreamPerThread, CreatedStream }; -TEST_CASE("Unit_hipStreamAttachMemAsync_Negative") { +TEST_CASE(Unit_hipStreamAttachMemAsync_Negative) { hipStream_t stream{nullptr}; auto streamType = @@ -81,7 +68,7 @@ __global__ void kernel(int* ptr, size_t size) { constexpr size_t size = 1024; __device__ __managed__ int m_memory[size]; -TEST_CASE("Unit_hipStreamAttachMemAsync_UseCase") { +TEST_CASE(Unit_hipStreamAttachMemAsync_UseCase) { hipStream_t stream{nullptr}; auto streamType = diff --git a/catch/unit/stream/hipStreamAttachMemAsync_old.cc b/catch/unit/stream/hipStreamAttachMemAsync_old.cc deleted file mode 100644 index e02754dfb..000000000 --- a/catch/unit/stream/hipStreamAttachMemAsync_old.cc +++ /dev/null @@ -1,143 +0,0 @@ -/* -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. -*/ - -// TODO Enable it after hipStreamAttachMemAsync is feature complete on HIP - -#include -#include - -__device__ __managed__ int var = 0; - -enum class StreamAttachTestType { NullStream = 0, StreamPerThread, CreatedStream }; - -TEST_CASE("Unit_hipStreamAttachMemAsync_Negative") { - hipStream_t stream{nullptr}; - - auto streamType = - GENERATE(StreamAttachTestType::NullStream, StreamAttachTestType::StreamPerThread, - StreamAttachTestType::CreatedStream); - - if (streamType == StreamAttachTestType::StreamPerThread) { - stream = hipStreamPerThread; - } else if (streamType == StreamAttachTestType::CreatedStream) { - HIP_CHECK(hipStreamCreate(&stream)); - REQUIRE(stream != nullptr); - } - - SECTION("Invalid Resource Handle") { - int definitelyNotAManagedVariable = 0; - HIP_CHECK_ERROR( - hipStreamAttachMemAsync(stream, reinterpret_cast(&definitelyNotAManagedVariable), - sizeof(int), hipMemAttachSingle), - hipErrorInvalidValue); - } - - SECTION("Invalid devptr") { - HIP_CHECK_ERROR(hipStreamAttachMemAsync(stream, nullptr, sizeof(int), hipMemAttachSingle), - hipErrorInvalidValue); - } - - SECTION("Invalid Resource Size") { - HIP_CHECK_ERROR(hipStreamAttachMemAsync(stream, reinterpret_cast(&var), sizeof(int) - 1, - hipMemAttachSingle), - hipErrorInvalidValue); - } - - SECTION("Invalid Flags") { - HIP_CHECK_ERROR( - hipStreamAttachMemAsync(stream, reinterpret_cast(&var), sizeof(int) - 1, - hipMemAttachSingle | hipMemAttachHost | hipMemAttachGlobal), - hipErrorInvalidValue); - } - - if (streamType == StreamAttachTestType::CreatedStream) { - HIP_CHECK(hipStreamDestroy(stream)); - } -} - -__global__ void kernel(int* ptr, size_t size) { - auto i = threadIdx.x; - if (i < size) { - ptr[i] = 1024; - } -} - -constexpr size_t size = 1024; -__device__ __managed__ int m_memory[size]; - -TEST_CASE("Unit_hipStreamAttachMemAsync_UseCase") { - hipStream_t stream{nullptr}; - - auto streamType = - GENERATE(StreamAttachTestType::NullStream, StreamAttachTestType::StreamPerThread, - StreamAttachTestType::CreatedStream); - - if (streamType == StreamAttachTestType::CreatedStream) { - HIP_CHECK(hipStreamCreate(&stream)); - REQUIRE(stream != nullptr); - } - - SECTION("Size zero is valid") { - int* d_memory{nullptr}; - HIP_CHECK(hipMallocManaged(&d_memory, sizeof(int) * size, hipMemAttachHost)); - HIP_CHECK( - hipStreamAttachMemAsync(stream, reinterpret_cast(d_memory), 0, hipMemAttachHost)); - HIP_CHECK(hipStreamSynchronize(stream)); // Wait for command to complete - HIP_CHECK(hipFree(d_memory)); - } - - SECTION("Access from device and host") { - int* d_memory{nullptr}; - - HIP_CHECK(hipMallocManaged(&d_memory, sizeof(int) * size, hipMemAttachHost)); - HIP_CHECK(hipMemset(d_memory, 0, sizeof(int) * size)); - HIP_CHECK( - hipStreamAttachMemAsync(stream, reinterpret_cast(d_memory), 0, hipMemAttachHost)); - HIP_CHECK(hipStreamSynchronize(stream)); // Wait for the command to complete - - kernel<<<1, size, 0, stream>>>(d_memory, size); - HIP_CHECK(hipStreamSynchronize(stream)); // Wait for the kernel to complete - - auto ptr = std::make_unique(size); - std::copy(d_memory, d_memory + size, ptr.get()); - - HIP_CHECK(hipFree(d_memory)); - - REQUIRE(std::all_of(ptr.get(), ptr.get() + size, [](int n) { return n == size; })); - } - - SECTION("Access ManagedMemory") { - HIP_CHECK(hipMemset(m_memory, 0, sizeof(int) * size)); - HIP_CHECK( - hipStreamAttachMemAsync(stream, reinterpret_cast(m_memory), 0, hipMemAttachHost)); - HIP_CHECK(hipStreamSynchronize(stream)); // Wait for the command to complete - - kernel<<<1, size, 0, stream>>>(m_memory, size); - HIP_CHECK(hipStreamSynchronize(stream)); // Wait for the kernel to complete - - auto ptr = std::make_unique(size); - std::copy(m_memory, m_memory + size, ptr.get()); - - REQUIRE(std::all_of(ptr.get(), ptr.get() + size, [](int n) { return n == size; })); - } - - if (streamType == StreamAttachTestType::CreatedStream) { - HIP_CHECK(hipStreamDestroy(stream)); - } -} \ No newline at end of file diff --git a/catch/unit/stream/hipStreamBatchMemOp.cc b/catch/unit/stream/hipStreamBatchMemOp.cc index 5104c66d2..0c730ad7d 100644 --- a/catch/unit/stream/hipStreamBatchMemOp.cc +++ b/catch/unit/stream/hipStreamBatchMemOp.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include /** @@ -38,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.4 */ -TEST_CASE("Unit_hipStreamBatchMemOp_Negative_Tests") { +TEST_CASE(Unit_hipStreamBatchMemOp_Negative_Tests) { hipStream_t stream{nullptr}; HIP_CHECK(hipStreamCreate(&stream)); REQUIRE(stream != nullptr); diff --git a/catch/unit/stream/hipStreamCopyAttributes.cc b/catch/unit/stream/hipStreamCopyAttributes.cc index 33a980ee2..12a1e996d 100644 --- a/catch/unit/stream/hipStreamCopyAttributes.cc +++ b/catch/unit/stream/hipStreamCopyAttributes.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipStreamCopyAttributes hipStreamCopyAttributes @@ -38,7 +25,7 @@ THE SOFTWARE. * - HIP_VERSION >= 7.2 */ -TEST_CASE("Unit_hipStreamCopyAttributes_Basic") { +TEST_CASE(Unit_hipStreamCopyAttributes_Basic) { hipStream_t stream1, stream2, stream3, stream4; hipStreamAttrValue val1, val2; HIP_CHECK(hipStreamCreate(&stream1)); @@ -116,7 +103,7 @@ TEST_CASE("Unit_hipStreamCopyAttributes_Basic") { * ------------------------ * - HIP_VERSION >= 7.2 */ -TEST_CASE("Unit_hipStreamCopyAttributes_Negative") { +TEST_CASE(Unit_hipStreamCopyAttributes_Negative) { hipStream_t srcStream = nullptr; HIP_CHECK(hipStreamCreate(&srcStream)); hipStream_t dstStream = nullptr; @@ -159,7 +146,7 @@ TEST_CASE("Unit_hipStreamCopyAttributes_Negative") { * ------------------------ * - HIP_VERSION >= 7.2 */ -TEST_CASE("Unit_hipStreamCopyAttributes_WithAllSyncPolicyValues") { +TEST_CASE(Unit_hipStreamCopyAttributes_WithAllSyncPolicyValues) { hipStream_t srcStream = nullptr; HIP_CHECK(hipStreamCreate(&srcStream)); hipStream_t dstStream = nullptr; diff --git a/catch/unit/stream/hipStreamCreate.cc b/catch/unit/stream/hipStreamCreate.cc index 21fff252b..c14fbe222 100644 --- a/catch/unit/stream/hipStreamCreate.cc +++ b/catch/unit/stream/hipStreamCreate.cc @@ -1,25 +1,12 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "streamCommon.hh" -TEST_CASE("Unit_hipStreamCreate_default") { +TEST_CASE(Unit_hipStreamCreate_default) { int id = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(id)); @@ -30,6 +17,6 @@ TEST_CASE("Unit_hipStreamCreate_default") { HIP_CHECK(hipStreamDestroy(stream)); } -TEST_CASE("Unit_hipStreamCreate_Negative") { +TEST_CASE(Unit_hipStreamCreate_Negative) { REQUIRE(hipErrorInvalidValue == hipStreamCreate(nullptr)); } diff --git a/catch/unit/stream/hipStreamCreateWithFlags.cc b/catch/unit/stream/hipStreamCreateWithFlags.cc index 0aaf1f5e6..dfc1f1875 100644 --- a/catch/unit/stream/hipStreamCreateWithFlags.cc +++ b/catch/unit/stream/hipStreamCreateWithFlags.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -23,11 +10,11 @@ THE SOFTWARE. namespace hipStreamCreateWithFlagsTests { -TEST_CASE("Unit_hipStreamCreateWithFlags_Negative_NullStream") { +TEST_CASE(Unit_hipStreamCreateWithFlags_Negative_NullStream) { HIP_CHECK_ERROR(hipStreamCreateWithFlags(nullptr, hipStreamDefault), hipErrorInvalidValue); } -TEST_CASE("Unit_hipStreamCreateWithFlags_Negative_InvalidFlag") { +TEST_CASE(Unit_hipStreamCreateWithFlags_Negative_InvalidFlag) { hipStream_t stream{}; unsigned int flag = 0xFF; REQUIRE(flag != hipStreamDefault); @@ -36,7 +23,7 @@ TEST_CASE("Unit_hipStreamCreateWithFlags_Negative_InvalidFlag") { } // create a stream and check the properties are correctly set -TEST_CASE("Unit_hipStreamCreateWithFlags_Default") { +TEST_CASE(Unit_hipStreamCreateWithFlags_Default) { const unsigned int flagUnderTest = GENERATE(hipStreamDefault, hipStreamNonBlocking); hipStream_t stream{}; HIP_CHECK(hipStreamCreateWithFlags(&stream, flagUnderTest)); @@ -56,7 +43,7 @@ TEST_CASE("Unit_hipStreamCreateWithFlags_Default") { // a stream will default to blocking the null stream, but will not block the null stream when // created with hipStreamNonBlocking #if HT_AMD /* Disabled because frequency based wait is timing out on nvidia platforms */ -TEST_CASE("Unit_hipStreamCreateWithFlags_DefaultStreamInteraction") { +TEST_CASE(Unit_hipStreamCreateWithFlags_DefaultStreamInteraction) { const hipStream_t defaultStream = GENERATE(static_cast(nullptr), hipStreamPerThread); const unsigned int flagUnderTest = GENERATE(hipStreamDefault, hipStreamNonBlocking); CAPTURE(defaultStream, flagUnderTest); diff --git a/catch/unit/stream/hipStreamCreateWithPriority.cc b/catch/unit/stream/hipStreamCreateWithPriority.cc index 865551105..81dc4cc82 100644 --- a/catch/unit/stream/hipStreamCreateWithPriority.cc +++ b/catch/unit/stream/hipStreamCreateWithPriority.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2022-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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipStreamCreateWithPriority hipStreamCreateWithPriority @@ -803,7 +790,7 @@ template void TestForMultipleStreamWithPriority(void) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamCreateWithPriority_FunctionalForAllPriorities") { +TEST_CASE(Unit_hipStreamCreateWithPriority_FunctionalForAllPriorities) { SECTION("Default flag and device synchronize") { hipStreamCreateWithPriorityTest::funcTestsForAllPriorityLevelsWrtNullStrm(hipStreamDefault, true); @@ -837,7 +824,7 @@ TEST_CASE("Unit_hipStreamCreateWithPriority_FunctionalForAllPriorities") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamCreateWithPriority_MulthreadDefaultflag") { +TEST_CASE(Unit_hipStreamCreateWithPriority_MulthreadDefaultflag) { bool TestPassed = true; TestPassed = hipStreamCreateWithPriorityTest::runFuncTestsForAllPriorityLevelsMultThread(hipStreamDefault); @@ -856,7 +843,7 @@ TEST_CASE("Unit_hipStreamCreateWithPriority_MulthreadDefaultflag") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamCreateWithPriority_MulthreadNonblockingflag") { +TEST_CASE(Unit_hipStreamCreateWithPriority_MulthreadNonblockingflag) { bool TestPassed = true; TestPassed = hipStreamCreateWithPriorityTest::runFuncTestsForAllPriorityLevelsMultThread( hipStreamNonBlocking); @@ -874,7 +861,7 @@ TEST_CASE("Unit_hipStreamCreateWithPriority_MulthreadNonblockingflag") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamCreateWithPriority_NegTst") { +TEST_CASE(Unit_hipStreamCreateWithPriority_NegTst) { hipStream_t stream{nullptr}; int priority_low{0}; int priority_high{0}; @@ -907,7 +894,7 @@ TEST_CASE("Unit_hipStreamCreateWithPriority_NegTst") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamCreateWithPriority_CheckPriorityVal") { +TEST_CASE(Unit_hipStreamCreateWithPriority_CheckPriorityVal) { int id = GENERATE(range(0, HipTest::getDeviceCount())); HIP_CHECK(hipSetDevice(id)); @@ -962,7 +949,7 @@ TEST_CASE("Unit_hipStreamCreateWithPriority_CheckPriorityVal") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamCreateWithPriority_ValidateWithEvents") { +TEST_CASE(Unit_hipStreamCreateWithPriority_ValidateWithEvents) { bool TestPassed = true; TestPassed = hipStreamCreateWithPriorityTest::validateStreamPrioritiesWithEvents(); REQUIRE(TestPassed); @@ -979,7 +966,7 @@ TEST_CASE("Unit_hipStreamCreateWithPriority_ValidateWithEvents") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipStreamCreateWithPriority_TestMultipleStreamWithPriority") { +TEST_CASE(Unit_hipStreamCreateWithPriority_TestMultipleStreamWithPriority) { hipStreamCreateWithPriorityTest::TestForMultipleStreamWithPriority(); } diff --git a/catch/unit/stream/hipStreamDestroy.cc b/catch/unit/stream/hipStreamDestroy.cc index 0d20f153c..fb863b8c9 100644 --- a/catch/unit/stream/hipStreamDestroy.cc +++ b/catch/unit/stream/hipStreamDestroy.cc @@ -1,34 +1,22 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include namespace hipStreamDestroyTests { -TEST_CASE("Unit_hipStreamDestroy_Default") { +TEST_CASE(Unit_hipStreamDestroy_Default) { hipStream_t stream{}; HIP_CHECK(hipStreamCreate(&stream)); HIP_CHECK(hipStreamDestroy(stream)); } -TEST_CASE("Unit_hipStreamDestroy_Negative_NullStream") { +TEST_CASE(Unit_hipStreamDestroy_Negative_NullStream) { HIP_CHECK_ERROR(hipStreamDestroy(nullptr), hipErrorInvalidResourceHandle); } @@ -47,7 +35,7 @@ __global__ void setToOne(int* x, size_t size) { } } -TEST_CASE("Unit_hipStreamDestroy_WithFinishedWork") { +TEST_CASE(Unit_hipStreamDestroy_WithFinishedWork) { hipStream_t stream{}; HIP_CHECK(hipStreamCreate(&stream)); @@ -65,7 +53,7 @@ TEST_CASE("Unit_hipStreamDestroy_WithFinishedWork") { // hipStreamDestroy should return immediately then clean up the resources when the stream is empty // of work #if HT_AMD /* Disabled because frequency based wait is timing out on nvidia platforms */ -TEST_CASE("Unit_hipStreamDestroy_WithPendingWork") { +TEST_CASE(Unit_hipStreamDestroy_WithPendingWork) { hipStream_t stream{}; HIP_CHECK(hipStreamCreate(&stream)); constexpr int numDataPoints = 10; diff --git a/catch/unit/stream/hipStreamGetCUMask.cc b/catch/unit/stream/hipStreamGetCUMask.cc index c41758b1e..b3476e187 100644 --- a/catch/unit/stream/hipStreamGetCUMask.cc +++ b/catch/unit/stream/hipStreamGetCUMask.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -34,7 +21,7 @@ Testcase Scenarios : * Scenario to verify hipExtStreamGetCUMask api returning default CU Mask or global CU Mask. * Scenario to verify hipExtStreamGetCUMask api returns custom mask set. */ -TEST_CASE("Unit_hipExtStreamGetCUMask_verifyDefaultAndCustomMask") { +TEST_CASE(Unit_hipExtStreamGetCUMask_verifyDefaultAndCustomMask) { constexpr unsigned maxCUPerValue = 32; hipDeviceProp_t props; std::stringstream ss; @@ -170,7 +157,7 @@ TEST_CASE("Unit_hipExtStreamGetCUMask_verifyDefaultAndCustomMask") { /** * Negative tests for hipExtStreamGetCUMask. */ -TEST_CASE("Unit_hipExtStreamGetCUMask_Negative") { +TEST_CASE(Unit_hipExtStreamGetCUMask_Negative) { hipError_t ret; constexpr int maxNum = 6; std::vector cuMask(maxNum); diff --git a/catch/unit/stream/hipStreamGetDevice.cc b/catch/unit/stream/hipStreamGetDevice.cc index 5c9de1852..7828f648d 100644 --- a/catch/unit/stream/hipStreamGetDevice.cc +++ b/catch/unit/stream/hipStreamGetDevice.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -49,7 +36,7 @@ static bool thread_results[NUMBER_OF_THREADS]; * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamGetDevice_Negative") { +TEST_CASE(Unit_hipStreamGetDevice_Negative) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); @@ -74,7 +61,7 @@ TEST_CASE("Unit_hipStreamGetDevice_Negative") { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamGetDevice_Usecase", "[multigpu]") { +TEST_CASE(Unit_hipStreamGetDevice_Usecase) { int device_count = 0; HIP_CHECK(hipGetDeviceCount(&device_count)); REQUIRE(device_count != 0); @@ -168,7 +155,7 @@ static bool test_hipStreamGetDevice_MThread() { return status; } -TEST_CASE("Unit_hipStreamGetDevice_MThread") { REQUIRE(true == test_hipStreamGetDevice_MThread()); } +TEST_CASE(Unit_hipStreamGetDevice_MThread) { REQUIRE(true == test_hipStreamGetDevice_MThread()); } /** * Test Description @@ -186,7 +173,7 @@ TEST_CASE("Unit_hipStreamGetDevice_MThread") { REQUIRE(true == test_hipStreamGet * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipStreamGetDevice_SetDiffDevice", "[multigpu]") { +TEST_CASE(Unit_hipStreamGetDevice_SetDiffDevice) { hipDevice_t device_from_stream; int device_count = 0; HIP_CHECK(hipGetDeviceCount(&device_count)); @@ -225,7 +212,7 @@ TEST_CASE("Unit_hipStreamGetDevice_SetDiffDevice", "[multigpu]") { * Test to be run only on AMD machine as it's failing in CUDA. */ #if HT_AMD -TEST_CASE("Unit_hipStreamGetDevice_NullStream", "[multigpu]") { +TEST_CASE(Unit_hipStreamGetDevice_NullStream) { int device_count = 0; HIP_CHECK(hipGetDeviceCount(&device_count)); REQUIRE(device_count != 0); diff --git a/catch/unit/stream/hipStreamGetFlags.cc b/catch/unit/stream/hipStreamGetFlags.cc index 25624b41a..2aa017961 100644 --- a/catch/unit/stream/hipStreamGetFlags.cc +++ b/catch/unit/stream/hipStreamGetFlags.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /** Testcase Scenarios : 1) Test flag value of stream created with hipStreamCreateWithFlags/ @@ -30,7 +18,7 @@ Testcase Scenarios : * @brief Check that hipStreamGetFlags returns the same flags that were used to create the stream. * */ -TEST_CASE("Unit_hipStreamGetFlags_Basic") { +TEST_CASE(Unit_hipStreamGetFlags_Basic) { unsigned int expectedFlag = GENERATE(hipStreamDefault, hipStreamNonBlocking); unsigned int returnedFlags; hipStream_t stream; @@ -45,7 +33,7 @@ TEST_CASE("Unit_hipStreamGetFlags_Basic") { * @brief Negative scenarios for hipStreamGetFlags. * */ -TEST_CASE("Unit_hipStreamGetFlags_Negative") { +TEST_CASE(Unit_hipStreamGetFlags_Negative) { hipStream_t validStream; unsigned int flags; @@ -70,7 +58,7 @@ TEST_CASE("Unit_hipStreamGetFlags_Negative") { /** * Test flag value when streams created with CUMask. */ -TEST_CASE("Unit_hipStreamGetFlags_StreamsCreatedWithCUMask") { +TEST_CASE(Unit_hipStreamGetFlags_StreamsCreatedWithCUMask) { hipStream_t stream; unsigned int flags; const uint32_t cuMask = 0xffffffff; diff --git a/catch/unit/stream/hipStreamGetFlags_spt.cc b/catch/unit/stream/hipStreamGetFlags_spt.cc index 7d05c33bb..e48c97195 100644 --- a/catch/unit/stream/hipStreamGetFlags_spt.cc +++ b/catch/unit/stream/hipStreamGetFlags_spt.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include /** @@ -38,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamGetFlags_spt_Basic") { +TEST_CASE(Unit_hipStreamGetFlags_spt_Basic) { unsigned int expectedFlag = GENERATE(hipStreamDefault, hipStreamNonBlocking); unsigned int returnedFlags; hipStream_t stream; @@ -60,7 +48,7 @@ TEST_CASE("Unit_hipStreamGetFlags_spt_Basic") { * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamGetFlags_spt_Negative") { +TEST_CASE(Unit_hipStreamGetFlags_spt_Negative) { hipStream_t validStream; unsigned int flags; @@ -93,7 +81,7 @@ TEST_CASE("Unit_hipStreamGetFlags_spt_Negative") { */ #if HT_AMD -TEST_CASE("Unit_hipStreamGetFlags_spt_StreamsCreatedWithCUMask") { +TEST_CASE(Unit_hipStreamGetFlags_spt_StreamsCreatedWithCUMask) { hipStream_t stream; unsigned int flags; const uint32_t cuMask = 0xffffffff; diff --git a/catch/unit/stream/hipStreamGetId.cc b/catch/unit/stream/hipStreamGetId.cc index 35da95709..059d593e6 100644 --- a/catch/unit/stream/hipStreamGetId.cc +++ b/catch/unit/stream/hipStreamGetId.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Testcase Scenarios : @@ -51,7 +38,7 @@ bool hasUniqueStreamIds(const std::vector& streamIds) { /** * @brief Pass uninitialized stream and id as nullptr to check if the API behaves as expected. */ -TEST_CASE("Unit_hipStreamGetId_Negative") { +TEST_CASE(Unit_hipStreamGetId_Negative) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); SECTION("Null Pointer") { @@ -64,7 +51,7 @@ TEST_CASE("Unit_hipStreamGetId_Negative") { * @brief Pass null stream, legacy stream and streamperthread, check the API behaves as expected. * Also, check the stream id generated is not same for any two streams. */ -TEST_CASE("Unit_hipStreamGetId_Basic") { +TEST_CASE(Unit_hipStreamGetId_Basic) { hipStream_t stream1, stream2; unsigned long long id1, id2, id3, id4, id5; SECTION("Unique Stream Id") { @@ -99,7 +86,7 @@ TEST_CASE("Unit_hipStreamGetId_Basic") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipStreamGetId_WithDifferentStreamCreateAPIs") { +TEST_CASE(Unit_hipStreamGetId_WithDifferentStreamCreateAPIs) { hipStream_t stream_1 = nullptr, stream_2 = nullptr; unsigned long long streamId_1 = 0, streamId_2 = 0; @@ -161,7 +148,7 @@ void launchFunction() { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipStreamGetId_MultipleThreads") { +TEST_CASE(Unit_hipStreamGetId_MultipleThreads) { const unsigned int threadsSupported = std::thread::hardware_concurrency(); INFO("Number of threads supported : " << threadsSupported); @@ -192,7 +179,7 @@ TEST_CASE("Unit_hipStreamGetId_MultipleThreads") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipStreamGetId_MultiDevice", "[multigpu]") { +TEST_CASE(Unit_hipStreamGetId_MultiDevice) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount < 2) { @@ -231,7 +218,7 @@ TEST_CASE("Unit_hipStreamGetId_MultiDevice", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipStreamGetId_MultiProcess") { +TEST_CASE(Unit_hipStreamGetId_MultiProcess) { auto pid = fork(); REQUIRE(pid >= 0); diff --git a/catch/unit/stream/hipStreamGetPriority.cc b/catch/unit/stream/hipStreamGetPriority.cc index 50442e4a7..a6b709de8 100644 --- a/catch/unit/stream/hipStreamGetPriority.cc +++ b/catch/unit/stream/hipStreamGetPriority.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Testcase Scenarios : @@ -32,7 +19,7 @@ priority should be clamped to the priority range. /** * Create stream and check priority. */ -TEST_CASE("Unit_hipStreamGetPriority_happy") { +TEST_CASE(Unit_hipStreamGetPriority_happy) { int priority_low = 0; int priority_high = 0; int devID = GENERATE(range(0, HipTest::getDeviceCount())); @@ -82,7 +69,7 @@ TEST_CASE("Unit_hipStreamGetPriority_happy") { /** * both stream and priority passed as nullptr. */ -TEST_CASE("Unit_hipStreamGetPriority_nullptr_nullptr") { +TEST_CASE(Unit_hipStreamGetPriority_nullptr_nullptr) { auto res = hipStreamGetPriority(nullptr, nullptr); REQUIRE(res == hipErrorInvalidValue); } @@ -91,7 +78,7 @@ TEST_CASE("Unit_hipStreamGetPriority_nullptr_nullptr") { /** * valid stream and priority passed as nullptr. */ -TEST_CASE("Unit_hipStreamGetPriority_stream_nullptr") { +TEST_CASE(Unit_hipStreamGetPriority_stream_nullptr) { hipStream_t stream = nullptr; HIP_CHECK(hipStreamCreate(&stream)); @@ -105,7 +92,7 @@ TEST_CASE("Unit_hipStreamGetPriority_stream_nullptr") { /** * nullptr stream and valid priority */ -TEST_CASE("Unit_hipStreamGetPriority_nullptr_priority") { +TEST_CASE(Unit_hipStreamGetPriority_nullptr_priority) { int priority = -1; HIP_CHECK(hipStreamGetPriority(nullptr, &priority)); } @@ -113,7 +100,7 @@ TEST_CASE("Unit_hipStreamGetPriority_nullptr_priority") { /** * both stream and priority passed as valid. */ -TEST_CASE("Unit_hipStreamGetPriority_stream_priority") { +TEST_CASE(Unit_hipStreamGetPriority_stream_priority) { int priority = -1; hipStream_t stream = nullptr; HIP_CHECK(hipStreamCreate(&stream)); @@ -127,7 +114,7 @@ TEST_CASE("Unit_hipStreamGetPriority_stream_priority") { /** * Create stream with CUMask and check priority is returned as expected. */ -TEST_CASE("Unit_hipStreamGetPriority_StreamsWithCUMask") { +TEST_CASE(Unit_hipStreamGetPriority_StreamsWithCUMask) { hipStream_t stream{}; int priority = 0; int priority_normal = 0; diff --git a/catch/unit/stream/hipStreamGetPriority_spt.cc b/catch/unit/stream/hipStreamGetPriority_spt.cc index ea62b62bb..e8010c581 100644 --- a/catch/unit/stream/hipStreamGetPriority_spt.cc +++ b/catch/unit/stream/hipStreamGetPriority_spt.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -39,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamGetPriority_spt_BasicTst") { +TEST_CASE(Unit_hipStreamGetPriority_spt_BasicTst) { int priority_low = 0; int priority_high = 0; int devID = GENERATE(range(0, HipTest::getDeviceCount())); @@ -98,7 +85,7 @@ TEST_CASE("Unit_hipStreamGetPriority_spt_BasicTst") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamGetPriority_spt_NegativeCases") { +TEST_CASE(Unit_hipStreamGetPriority_spt_NegativeCases) { // stream as nullptr and priority as nullptr auto res = hipStreamGetPriority_spt(nullptr, nullptr); REQUIRE(res == hipErrorInvalidValue); @@ -125,7 +112,7 @@ TEST_CASE("Unit_hipStreamGetPriority_spt_NegativeCases") { */ #if HT_AMD -TEST_CASE("Unit_hipStreamGetPriority_spt_StreamsWithCUMask") { +TEST_CASE(Unit_hipStreamGetPriority_spt_StreamsWithCUMask) { hipStream_t stream{}; int priority = 0; int priority_normal = 0; diff --git a/catch/unit/stream/hipStreamLegacy.cc b/catch/unit/stream/hipStreamLegacy.cc index e89ace996..dc8898ef3 100644 --- a/catch/unit/stream/hipStreamLegacy.cc +++ b/catch/unit/stream/hipStreamLegacy.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2022 - present 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -36,7 +24,7 @@ constexpr int blocks = (N % threadsPerBlock == 0) ? (N / threadsPerBlock) : ((N / threadsPerBlock) + 1); size_t Nbytes = N * sizeof(float); -TEST_CASE("Unit_hipMemcpyAsync_H2H-H2D-D2H-H2PinMem") { +TEST_CASE(Unit_hipMemcpyAsync_hipStreamLegacy_H2H_H2D_D2H_H2PinMem) { int *A_d{nullptr}, *B_d{nullptr}; int *A_h{nullptr}, *B_h{nullptr}; int *A_Ph{nullptr}, *B_Ph{nullptr}; @@ -68,7 +56,7 @@ TEST_CASE("Unit_hipMemcpyAsync_H2H-H2D-D2H-H2PinMem") { HipTest::freeArrays(nullptr, nullptr, nullptr, A_Ph, B_Ph, nullptr, true); } -TEST_CASE("Unit_hipStreamGetCaptureInfo_hipStreamLegacy_CaptureInfo") { +TEST_CASE(Unit_hipStreamGetCaptureInfo_hipStreamLegacy_CaptureInfo) { hipStream_t stream{nullptr}, streamForGraph{nullptr}; hipGraph_t graph{nullptr}; hipError_t ret; @@ -171,7 +159,7 @@ __global__ void MemPrefetchAsyncKernel(int* C_d, const int* A_d, size_t N) { } } -TEST_CASE("Unit_hipMemPrefetchAsync_Basic") { +TEST_CASE(Unit_hipMemPrefetchAsync_Basic) { LinearAllocGuard alloc1(LinearAllocs::hipMallocManaged, kPageSize); const auto count = kPageSize / sizeof(*alloc1.ptr()); constexpr auto fill_value = 42; @@ -194,7 +182,7 @@ TEST_CASE("Unit_hipMemPrefetchAsync_Basic") { ArrayFindIfNot(alloc1.ptr(), fill_value, count); } -TEST_CASE("Unit_hipMemPoolApi_Basic") { +TEST_CASE(Unit_hipMemPoolApi_hipStreamLegacy_Basic) { int numElements = 64 * 1024 * 1024; float* A = nullptr; diff --git a/catch/unit/stream/hipStreamLegacy_Ext.cc b/catch/unit/stream/hipStreamLegacy_Ext.cc index e8aa3193f..648f36f83 100644 --- a/catch/unit/stream/hipStreamLegacy_Ext.cc +++ b/catch/unit/stream/hipStreamLegacy_Ext.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -76,7 +63,7 @@ static __global__ void addOneKernel(int* a, int size) { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_WithBlockingStream") { +TEST_CASE(Unit_hipStreamLegacy_WithBlockingStream) { int* hostArrSrc = new int[N]; REQUIRE(hostArrSrc != nullptr); fillHostArray(hostArrSrc, N, 1); @@ -158,7 +145,7 @@ void launchFunction(hipStream_t stream) { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_MultipleThreads") { +TEST_CASE(Unit_hipStreamLegacy_MultipleThreads) { const unsigned int threadsSupported = std::thread::hardware_concurrency(); const int numberOfThreads = (threadsSupported >= 10) ? 10 : threadsSupported; @@ -184,7 +171,7 @@ TEST_CASE("Unit_hipStreamLegacy_MultipleThreads") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_NegetiveCase") { +TEST_CASE(Unit_hipStreamLegacy_NegetiveCase) { hipStream_t stream = hipStreamLegacy; REQUIRE(hipStreamBeginCapture(stream, hipStreamCaptureModeGlobal) == hipErrorStreamCaptureUnsupported); @@ -206,7 +193,7 @@ TEST_CASE("Unit_hipStreamLegacy_NegetiveCase") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_WithNonBlockingStream") { +TEST_CASE(Unit_hipStreamLegacy_WithNonBlockingStream) { int* hostArrSrc = new int[N]; REQUIRE(hostArrSrc != nullptr); fillHostArray(hostArrSrc, N, 10); @@ -253,7 +240,7 @@ TEST_CASE("Unit_hipStreamLegacy_WithNonBlockingStream") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_WithStreamPerThread") { +TEST_CASE(Unit_hipStreamLegacy_WithStreamPerThread) { int* hostArrSrc = new int[N]; REQUIRE(hostArrSrc != nullptr); fillHostArray(hostArrSrc, N, 15); @@ -295,7 +282,7 @@ TEST_CASE("Unit_hipStreamLegacy_WithStreamPerThread") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_MultiDevice", "[multigpu]") { +TEST_CASE(Unit_hipStreamLegacy_MultiDevice) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount < 2) { @@ -350,7 +337,7 @@ TEST_CASE("Unit_hipStreamLegacy_MultiDevice", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_H2H_H2D_D2D_D2H_Default") { +TEST_CASE(Unit_hipStreamLegacy_H2H_H2D_D2D_D2H_Default) { int* hostArr1 = new int[N]; REQUIRE(hostArr1 != nullptr); fillHostArray(hostArr1, N, 30); @@ -418,7 +405,7 @@ TEST_CASE("Unit_hipStreamLegacy_H2H_H2D_D2D_D2H_Default") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_MultiDeviceMultiOperation", "[multigpu]") { +TEST_CASE(Unit_hipStreamLegacy_MultiDeviceMultiOperation) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount < 2) { @@ -540,7 +527,7 @@ static void copyFromDeviceToHost(int* devArr, int* hostArr) { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_TwoThreadsEachOneDiffOperation") { +TEST_CASE(Unit_hipStreamLegacy_TwoThreadsEachOneDiffOperation) { const unsigned int threadsSupported = std::thread::hardware_concurrency(); if (threadsSupported < 2) { @@ -594,7 +581,7 @@ TEST_CASE("Unit_hipStreamLegacy_TwoThreadsEachOneDiffOperation") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_TwoDevicesEachOneDiffOperation", "[multigpu]") { +TEST_CASE(Unit_hipStreamLegacy_TwoDevicesEachOneDiffOperation) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount < 2) { @@ -679,8 +666,7 @@ static void operationsInDev1(int* devArrDev1, int* hostArrDst) { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_TwoThreadsInTwoDevicesEachOneDiffOperation", - "[multigpu]") { +TEST_CASE(Unit_hipStreamLegacy_TwoThreadsInTwoDevicesEachOneDiffOperation) { int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); if (deviceCount < 2) { @@ -742,7 +728,7 @@ TEST_CASE("Unit_hipStreamLegacy_TwoThreadsInTwoDevicesEachOneDiffOperation", * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_InChildProcess") { +TEST_CASE(Unit_hipStreamLegacy_InChildProcess) { hip::SpawnProc proc("hipStreamLegacy_exe", true); REQUIRE(proc.run() == 0); } @@ -759,7 +745,7 @@ TEST_CASE("Unit_hipStreamLegacy_InChildProcess") { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_WithKernel") { +TEST_CASE(Unit_hipStreamLegacy_WithKernel) { int* hostArrSrc = new int[N]; REQUIRE(hostArrSrc != nullptr); fillHostArray(hostArrSrc, N, 1); @@ -801,7 +787,7 @@ TEST_CASE("Unit_hipStreamLegacy_WithKernel") { * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_hipStreamSynchronize") { +TEST_CASE(Unit_hipStreamLegacy_hipStreamSynchronize) { int* hostArrSrc = new int[N]; REQUIRE(hostArrSrc != nullptr); fillHostArray(hostArrSrc, N, 1); diff --git a/catch/unit/stream/hipStreamLegacy_compiler_options.cc b/catch/unit/stream/hipStreamLegacy_compiler_options.cc index 7fb023f19..37b0a28f9 100644 --- a/catch/unit/stream/hipStreamLegacy_compiler_options.cc +++ b/catch/unit/stream/hipStreamLegacy_compiler_options.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -49,7 +36,7 @@ static void fillArr(int* arr, unsigned int size, int value) { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_WithSptCompilerOption") { +TEST_CASE(Unit_hipStreamLegacy_WithSptCompilerOption) { int* hostArrSrc = new int[N]; REQUIRE(hostArrSrc != nullptr); fillArr(hostArrSrc, N, 1); @@ -108,7 +95,7 @@ static void copyDeviceToHost(int* devArr, int* hostArr) { * ------------------------ * - HIP_VERSION >= 6.3 */ -TEST_CASE("Unit_hipStreamLegacy_TwoThreadsDiffOperationWithSptCompOption") { +TEST_CASE(Unit_hipStreamLegacy_TwoThreadsDiffOperationWithSptCompOption) { const unsigned int threadsSupported = std::thread::hardware_concurrency(); if (threadsSupported < 2) { diff --git a/catch/unit/stream/hipStreamLegacy_exe.cc b/catch/unit/stream/hipStreamLegacy_exe.cc index 63cc94fe8..84dc4c306 100644 --- a/catch/unit/stream/hipStreamLegacy_exe.cc +++ b/catch/unit/stream/hipStreamLegacy_exe.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/stream/hipStreamQuery.cc b/catch/unit/stream/hipStreamQuery.cc index 47e8bfaed..9eaabdff1 100644 --- a/catch/unit/stream/hipStreamQuery.cc +++ b/catch/unit/stream/hipStreamQuery.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "streamCommon.hh" @@ -24,7 +11,7 @@ THE SOFTWARE. * @brief Check that querying a stream with no work returns hipSuccess * **/ -TEST_CASE("Unit_hipStreamQuery_WithNoWork") { +TEST_CASE(Unit_hipStreamQuery_WithNoWork) { hipStream_t stream{nullptr}; SECTION("Null Stream") { HIP_CHECK(hipStreamQuery(stream)); } @@ -40,7 +27,7 @@ TEST_CASE("Unit_hipStreamQuery_WithNoWork") { * @brief Check that querying a stream with finished work returns hipSuccess * **/ -TEST_CASE("Unit_hipStreamQuery_WithFinishedWork") { +TEST_CASE(Unit_hipStreamQuery_WithFinishedWork) { hipStream_t stream{nullptr}; SECTION("Null Stream") { @@ -67,7 +54,7 @@ TEST_CASE("Unit_hipStreamQuery_WithFinishedWork") { * hipErrorNotReady * */ -TEST_CASE("Unit_hipStreamQuery_SubmitWorkOnStreamAndQueryNullStream") { +TEST_CASE(Unit_hipStreamQuery_SubmitWorkOnStreamAndQueryNullStream) { { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); @@ -86,7 +73,7 @@ TEST_CASE("Unit_hipStreamQuery_SubmitWorkOnStreamAndQueryNullStream") { * hipErrorNotReady. * */ -TEST_CASE("Unit_hipStreamQuery_NullStreamQuery") { +TEST_CASE(Unit_hipStreamQuery_NullStreamQuery) { HIP_CHECK(hipStreamQuery(hip::nullStream)); LaunchDelayKernel(std::chrono::milliseconds(500), hip::nullStream); HIP_CHECK_ERROR(hipStreamQuery(hip::nullStream), hipErrorNotReady); @@ -98,7 +85,7 @@ TEST_CASE("Unit_hipStreamQuery_NullStreamQuery") { * @brief Check that querying a stream with pending work returns hipErrorNotReady * **/ -TEST_CASE("Unit_hipStreamQuery_WithPendingWork") { +TEST_CASE(Unit_hipStreamQuery_WithPendingWork) { hipStream_t waitingStream{nullptr}; HIP_CHECK(hipStreamCreate(&waitingStream)); diff --git a/catch/unit/stream/hipStreamQuery_spt.cc b/catch/unit/stream/hipStreamQuery_spt.cc index cee6651a7..a661901e7 100644 --- a/catch/unit/stream/hipStreamQuery_spt.cc +++ b/catch/unit/stream/hipStreamQuery_spt.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include "streamCommon.hh" @@ -38,7 +26,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamQuery_spt_WithNoWork") { +TEST_CASE(Unit_hipStreamQuery_spt_WithNoWork) { hipStream_t stream{nullptr}; SECTION("Null Stream") { HIP_CHECK(hipStreamQuery_spt(stream)); } @@ -60,7 +48,7 @@ TEST_CASE("Unit_hipStreamQuery_spt_WithNoWork") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamQuery_spt_WithFinishedWork") { +TEST_CASE(Unit_hipStreamQuery_spt_WithFinishedWork) { hipStream_t stream{nullptr}; SECTION("Null Stream") { @@ -91,7 +79,7 @@ TEST_CASE("Unit_hipStreamQuery_spt_WithFinishedWork") { * - HIP_VERSION >= 6.2 */ #if HT_AMD -TEST_CASE("Unit_hipStreamQuery_spt_NegativeCases") { +TEST_CASE(Unit_hipStreamQuery_spt_NegativeCases) { SECTION("Submit Work On Stream And Query Null Stream") { hipStream_t ValidStream; HIP_CHECK(hipStreamCreate(&ValidStream)); @@ -120,7 +108,7 @@ TEST_CASE("Unit_hipStreamQuery_spt_NegativeCases") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamQuery_spt_WithPendingWork") { +TEST_CASE(Unit_hipStreamQuery_spt_WithPendingWork) { hipStream_t waitingStream{nullptr}; HIP_CHECK(hipStreamCreate(&waitingStream)); LaunchDelayKernel(std::chrono::milliseconds(500), waitingStream); diff --git a/catch/unit/stream/hipStreamSetGetAttributes.cc b/catch/unit/stream/hipStreamSetGetAttributes.cc index bd42019e7..4971ec89d 100644 --- a/catch/unit/stream/hipStreamSetGetAttributes.cc +++ b/catch/unit/stream/hipStreamSetGetAttributes.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -43,7 +30,7 @@ static __global__ void doubleKernel(int *arr) { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipStreamSetAttribute_hipStreamGetAttribute_Basic") { +TEST_CASE(Unit_hipStreamSetAttribute_hipStreamGetAttribute_Basic) { constexpr int N = 1024; int hostMem[N]; for (int i = 0; i < N; i++) { @@ -103,7 +90,7 @@ TEST_CASE("Unit_hipStreamSetAttribute_hipStreamGetAttribute_Basic") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipStreamGetAttribute_Negative") { +TEST_CASE(Unit_hipStreamGetAttribute_Negative) { hipStream_t stream = nullptr; HIP_CHECK(hipStreamCreate(&stream)); @@ -147,7 +134,7 @@ TEST_CASE("Unit_hipStreamGetAttribute_Negative") { * ------------------------ * - HIP_VERSION >= 7.1 */ -TEST_CASE("Unit_hipStreamSetAttribute_Negative") { +TEST_CASE(Unit_hipStreamSetAttribute_Negative) { hipStream_t stream = nullptr; HIP_CHECK(hipStreamCreate(&stream)); diff --git a/catch/unit/stream/hipStreamSynchronize.cc b/catch/unit/stream/hipStreamSynchronize.cc index d578de0d4..ed9e9dbc3 100644 --- a/catch/unit/stream/hipStreamSynchronize.cc +++ b/catch/unit/stream/hipStreamSynchronize.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "streamCommon.hh" @@ -26,7 +13,7 @@ namespace hipStreamSynchronizeTest { * @brief Check that hipStreamSynchronize handles empty streams properly. * */ -TEST_CASE("Unit_hipStreamSynchronize_EmptyStream") { +TEST_CASE(Unit_hipStreamSynchronize_EmptyStream) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); HIP_CHECK(hipStreamSynchronize(stream)); @@ -40,7 +27,7 @@ TEST_CASE("Unit_hipStreamSynchronize_EmptyStream") { * hipStreamSynchronize. * */ -TEST_CASE("Unit_hipStreamSynchronize_FinishWork") { +TEST_CASE(Unit_hipStreamSynchronize_FinishWork) { const hipStream_t explicitStream = reinterpret_cast(-1); hipStream_t stream = GENERATE_COPY(explicitStream, hip::nullStream, hip::streamPerThread); @@ -61,7 +48,7 @@ TEST_CASE("Unit_hipStreamSynchronize_FinishWork") { /** * @brief Check that synchronizing the nullStream implicitly synchronizes all executing streams. */ -TEST_CASE("Unit_hipStreamSynchronize_NullStreamSynchronization") { +TEST_CASE(Unit_hipStreamSynchronize_NullStreamSynchronization) { int totalStreams = 10; std::vector streams{}; @@ -99,7 +86,7 @@ TEST_CASE("Unit_hipStreamSynchronize_NullStreamSynchronization") { * Check that submiting work to the nullStream does not affect synchronization of other * streams. Check that querying the nullStream does not affect synchronization of other streams. */ -TEST_CASE("Unit_hipStreamSynchronize_SynchronizeStreamAndQueryNullStream") { +TEST_CASE(Unit_hipStreamSynchronize_SynchronizeStreamAndQueryNullStream) { #if HT_AMD HipTest::HIP_SKIP_TEST("EXSWCPHIPT-22"); #else @@ -143,7 +130,7 @@ TEST_CASE("Unit_hipStreamSynchronize_SynchronizeStreamAndQueryNullStream") { * special stream. * */ -TEST_CASE("Unit_hipStreamSynchronize_NullStreamAndStreamPerThread") { +TEST_CASE(Unit_hipStreamSynchronize_NullStreamAndStreamPerThread) { LaunchDelayKernel(std::chrono::milliseconds(500), hip::streamPerThread); HIP_CHECK_ERROR(hipStreamQuery(hip::nullStream), hipErrorNotReady); HIP_CHECK_ERROR(hipStreamQuery(hip::streamPerThread), hipErrorNotReady); diff --git a/catch/unit/stream/hipStreamSynchronize_spt.cc b/catch/unit/stream/hipStreamSynchronize_spt.cc index d52414dac..42d243cb0 100644 --- a/catch/unit/stream/hipStreamSynchronize_spt.cc +++ b/catch/unit/stream/hipStreamSynchronize_spt.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -39,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamSynchronize_spt_EmptyStream") { +TEST_CASE(Unit_hipStreamSynchronize_spt_EmptyStream) { hipStream_t stream; HIP_CHECK(hipStreamCreate(&stream)); HIP_CHECK(hipStreamSynchronize_spt(stream)); @@ -71,7 +59,7 @@ TEST_CASE("Unit_hipStreamSynchronize_spt_EmptyStream") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamSynchronize_spt_FinishWork") { +TEST_CASE(Unit_hipStreamSynchronize_spt_FinishWork) { hipStream_t explicitStream = reinterpret_cast(-1); hipStream_t stream = GENERATE_COPY(explicitStream, hip::nullStream, hip::streamPerThread); if (explicitStream) { @@ -101,7 +89,7 @@ TEST_CASE("Unit_hipStreamSynchronize_spt_FinishWork") { * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipStreamSynchronize_spt_SynchronizeStreamAndQueryNullStream") { +TEST_CASE(Unit_hipStreamSynchronize_spt_SynchronizeStreamAndQueryNullStream) { hipStream_t stream1; hipStream_t stream2; diff --git a/catch/unit/stream/hipStreamValue.cc b/catch/unit/stream/hipStreamValue.cc index 525ecc5e1..b3487ce26 100644 --- a/catch/unit/stream/hipStreamValue.cc +++ b/catch/unit/stream/hipStreamValue.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #include #include @@ -233,7 +221,7 @@ template struct TestParams { }; #if HT_AMD -TEMPLATE_TEST_CASE("Unit_hipStreamValue_Write", "", (TestParams), +TEMPLATE_TEST_CASE(Unit_hipStreamValue_Write, (TestParams), (TestParams), (TestParams), (TestParams), @@ -241,7 +229,7 @@ TEMPLATE_TEST_CASE("Unit_hipStreamValue_Write", "", (TestParams), (TestParams)) { #else -TEMPLATE_TEST_CASE("Unit_hipStreamValue_Write", "", (TestParams), +TEMPLATE_TEST_CASE(Unit_hipStreamValue_Write, (TestParams), (TestParams), (TestParams), (TestParams), @@ -355,7 +343,7 @@ void testWait(TEST_WAIT tc) { } // Combined blocking test case for both uint32_t and uint64_t -TEMPLATE_TEST_CASE("Unit_hipStreamValue_Wait_Blocking", "", uint32_t, uint64_t) { +TEMPLATE_TEST_CASE(Unit_hipStreamValue_Wait_Blocking, uint32_t, uint64_t) { if (!streamWaitValueSupported()) { HipTest::HIP_SKIP_TEST("hipStreamWaitValue not supported on this device."); return; @@ -566,7 +554,7 @@ TEMPLATE_TEST_CASE("Unit_hipStreamValue_Wait_Blocking", "", uint32_t, uint64_t) } // Negative Tests -TEST_CASE("Unit_hipStreamValue_Negative_InvalidMemory") { +TEST_CASE(Unit_hipStreamValue_Negative_InvalidMemory) { if (!streamWaitValueSupported()) { HipTest::HIP_SKIP_TEST("hipStreamWaitValue not supported on this device."); return; @@ -598,7 +586,7 @@ TEST_CASE("Unit_hipStreamValue_Negative_InvalidMemory") { } // Merge the two similar negative tests -TEMPLATE_TEST_CASE("Unit_hipStreamValue_Negative_StreamAndFlag", "", uint32_t, uint64_t) { +TEMPLATE_TEST_CASE(Unit_hipStreamValue_Negative_StreamAndFlag, uint32_t, uint64_t) { if (!streamWaitValueSupported()) { HipTest::HIP_SKIP_TEST("hipStreamWaitValue not supported on this device."); return; @@ -653,7 +641,7 @@ TEMPLATE_TEST_CASE("Unit_hipStreamValue_Negative_StreamAndFlag", "", uint32_t, u } } -TEMPLATE_TEST_CASE("Unit_hipStreamWriteValue_Default", "", uint32_t, uint64_t) { +TEMPLATE_TEST_CASE(Unit_hipStreamWriteValue_Default, uint32_t, uint64_t) { if (!streamWaitValueSupported()) { HipTest::HIP_SKIP_TEST("hipStreamWaitValue not supported on this device."); return; @@ -684,7 +672,7 @@ template __global__ void add(T* a, T* b, T* c, size_t size) { if (i < size) c[i] = a[i] + b[i]; } -TEMPLATE_TEST_CASE("Unit_hipStreamWaitValue_Default", "", uint32_t, uint64_t) { +TEMPLATE_TEST_CASE(Unit_hipStreamWaitValue_Default, uint32_t, uint64_t) { if (!streamWaitValueSupported()) { HipTest::HIP_SKIP_TEST("hipStreamWaitValue not supported on this device."); return; diff --git a/catch/unit/stream/hipStreamWaitEvent.cc b/catch/unit/stream/hipStreamWaitEvent.cc index 404b1abb1..fecd71dd9 100644 --- a/catch/unit/stream/hipStreamWaitEvent.cc +++ b/catch/unit/stream/hipStreamWaitEvent.cc @@ -1,21 +1,9 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + /* Testcase Scenarios : Unit_hipStreamWaitEvent_Negative - Test unsuccessful hipStreamWaitEvent when either event or flags @@ -26,7 +14,7 @@ different stream with hipStreamWaitEvent api #include #include -TEST_CASE("Unit_hipStreamWaitEvent_Negative") { +TEST_CASE(Unit_hipStreamWaitEvent_Negative) { enum class StreamTestType { NullStream = 0, StreamPerThread, CreatedStream }; auto streamType = GENERATE(StreamTestType::NullStream, StreamTestType::StreamPerThread, @@ -65,7 +53,7 @@ TEST_CASE("Unit_hipStreamWaitEvent_Negative") { } } -TEST_CASE("Unit_hipStreamWaitEvent_Default") { +TEST_CASE(Unit_hipStreamWaitEvent_Default) { hipStream_t stream{nullptr}; hipEvent_t waitEvent{nullptr}; @@ -90,7 +78,7 @@ TEST_CASE("Unit_hipStreamWaitEvent_Default") { HIP_CHECK(hipEventDestroy(waitEvent)); } -TEST_CASE("Unit_hipStreamWaitEvent_DifferentStreams") { +TEST_CASE(Unit_hipStreamWaitEvent_DifferentStreams) { hipStream_t blockedStreamA{nullptr}, streamBlockedOnStreamA{nullptr}, unblockingStream{nullptr}; hipEvent_t waitEvent{nullptr}; diff --git a/catch/unit/stream/hipStreamWithCUMask.cc b/catch/unit/stream/hipStreamWithCUMask.cc index 819028dc2..a9c35047c 100644 --- a/catch/unit/stream/hipStreamWithCUMask.cc +++ b/catch/unit/stream/hipStreamWithCUMask.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** Testcase Scenarios : @@ -122,7 +109,7 @@ using hipExtStreamCreateWithCUMaskTest::N; /** * Scenario: Validates functionality of hipStreamAddCallback with created stream. */ -TEST_CASE("Unit_hipExtStreamCreateWithCUMask_ValidateCallbackFunc") { +TEST_CASE(Unit_hipExtStreamCreateWithCUMask_ValidateCallbackFunc) { float *A_d, *C_d; size_t Nbytes = N * sizeof(float); cbDone = false; @@ -169,7 +156,7 @@ TEST_CASE("Unit_hipExtStreamCreateWithCUMask_ValidateCallbackFunc") { /** * Scenario: Validates functionality of stream with cu mask. */ -TEST_CASE("Unit_hipExtStreamCreateWithCUMask_Functionality") { +TEST_CASE(Unit_hipExtStreamCreateWithCUMask_Functionality) { const int KNumPartition = NUM_CU_PARTITIONS; float *dA[KNumPartition], *dC[KNumPartition]; float *hA, *hC; @@ -301,7 +288,7 @@ TEST_CASE("Unit_hipExtStreamCreateWithCUMask_Functionality") { * Scenario: Create a stream with all CU masks disabled (0x00000000). * Verify that default CU mask is set for the stream. */ -TEST_CASE("Unit_hipExtStreamCreateWithCUMask_AllCUsMasked") { +TEST_CASE(Unit_hipExtStreamCreateWithCUMask_AllCUsMasked) { HIP_CHECK(hipSetDevice(0)); hipDeviceProp_t props; HIP_CHECK(hipGetDeviceProperties(&props, 0)); @@ -325,7 +312,7 @@ TEST_CASE("Unit_hipExtStreamCreateWithCUMask_AllCUsMasked") { /** * Scenario: Negative Testing of hipExtStreamCreateWithCUMask. */ -TEST_CASE("Unit_hipExtStreamCreateWithCUMask_NegTst") { +TEST_CASE(Unit_hipExtStreamCreateWithCUMask_NegTst) { std::vector defaultCUMask; REQUIRE(hipSuccess == hipSetDevice(0)); hipDeviceProp_t props; diff --git a/catch/unit/stream/streamCommon.cc b/catch/unit/stream/streamCommon.cc index 6a2904bbe..c0234e2ad 100644 --- a/catch/unit/stream/streamCommon.cc +++ b/catch/unit/stream/streamCommon.cc @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "streamCommon.hh" diff --git a/catch/unit/stream/streamCommon.hh b/catch/unit/stream/streamCommon.hh index 2017b9298..da8ec7d23 100644 --- a/catch/unit/stream/streamCommon.hh +++ b/catch/unit/stream/streamCommon.hh @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/streamperthread/CMakeLists.txt b/catch/unit/streamperthread/CMakeLists.txt index 85292c042..4efd34977 100644 --- a/catch/unit/streamperthread/CMakeLists.txt +++ b/catch/unit/streamperthread/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC hipStreamPerThread_Basic.cc @@ -9,16 +13,11 @@ set(TEST_SRC ) if(HIP_PLATFORM MATCHES "amd") - set(TEST_SRC ${TEST_SRC} + set(TEST_SRC ${TEST_SRC} hipGetProcAddressSptApis.cc) -endif() - -if(HIP_PLATFORM MATCHES "amd") - set_source_files_properties(hipStreamPerThrdCompilerOptn.cc PROPERTIES COMPILE_OPTIONS "-fgpu-default-stream=per-thread") -endif() - -if(HIP_PLATFORM MATCHES "nvidia") - set_source_files_properties(hipStreamPerThrdCompilerOptn.cc PROPERTIES COMPILE_OPTIONS "--default-stream=per-thread") + set_source_files_properties(hipStreamPerThrdCompilerOptn.cc PROPERTIES COMPILE_OPTIONS "-fgpu-default-stream=per-thread") +else() + set_source_files_properties(hipStreamPerThrdCompilerOptn.cc PROPERTIES COMPILE_OPTIONS "--default-stream=per-thread") endif() hip_add_exe_to_target(NAME StreamPerThreadTest diff --git a/catch/unit/streamperthread/hipGetProcAddressSptApis.cc b/catch/unit/streamperthread/hipGetProcAddressSptApis.cc index 70cbf0694..2ee75e228 100644 --- a/catch/unit/streamperthread/hipGetProcAddressSptApis.cc +++ b/catch/unit/streamperthread/hipGetProcAddressSptApis.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -37,7 +24,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_MemCpy") { +TEST_CASE(Unit_hipGetProcAddress_spt_MemCpy) { void* hipMemcpy_spt_ptr = nullptr; void* hipMemcpyAsync_spt_ptr = nullptr; @@ -527,7 +514,7 @@ TEST_CASE("Unit_hipGetProcAddress_spt_MemCpy") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_Memset") { +TEST_CASE(Unit_hipGetProcAddress_spt_Memset) { void* hipMemset_spt_ptr = nullptr; void* hipMemsetAsync_spt_ptr = nullptr; @@ -617,7 +604,7 @@ TEST_CASE("Unit_hipGetProcAddress_spt_Memset") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_Memset2D3D") { +TEST_CASE(Unit_hipGetProcAddress_spt_Memset2D3D) { CHECK_IMAGE_SUPPORT void* hipMemset2D_spt_ptr = nullptr; @@ -793,7 +780,7 @@ TEST_CASE("Unit_hipGetProcAddress_spt_Memset2D3D") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_Memcpy2D") { +TEST_CASE(Unit_hipGetProcAddress_spt_Memcpy2D) { CHECK_IMAGE_SUPPORT void* hipMemcpy2D_spt_ptr = nullptr; @@ -1873,7 +1860,7 @@ TEST_CASE("Unit_hipGetProcAddress_spt_Memcpy2D") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_Memcpy3D") { +TEST_CASE(Unit_hipGetProcAddress_spt_Memcpy3D) { CHECK_IMAGE_SUPPORT void* hipMemcpy3D_spt_ptr = nullptr; @@ -2434,7 +2421,7 @@ TEST_CASE("Unit_hipGetProcAddress_spt_Memcpy3D") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_LaunchKernel") { +TEST_CASE(Unit_hipGetProcAddress_spt_LaunchKernel) { void* hipLaunchKernel_spt_ptr = nullptr; void* hipLaunchHostFunc_spt_ptr = nullptr; @@ -2517,7 +2504,7 @@ TEST_CASE("Unit_hipGetProcAddress_spt_LaunchKernel") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_LaunchCooperativeKernel") { +TEST_CASE(Unit_hipGetProcAddress_spt_LaunchCooperativeKernel) { hipDeviceProp_t device_properties; HIP_CHECK(hipGetDeviceProperties(&device_properties, 0)); @@ -2587,7 +2574,7 @@ TEST_CASE("Unit_hipGetProcAddress_spt_LaunchCooperativeKernel") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_Stream") { +TEST_CASE(Unit_hipGetProcAddress_spt_Stream) { void* hipStreamGetFlags_spt_ptr = nullptr; void* hipStreamGetPriority_spt_ptr = nullptr; void* hipStreamSynchronize_spt_ptr = nullptr; @@ -2688,7 +2675,7 @@ TEST_CASE("Unit_hipGetProcAddress_spt_Stream") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_Graph") { +TEST_CASE(Unit_hipGetProcAddress_spt_Graph) { void* hipStreamBeginCapture_spt_ptr = nullptr; void* hipStreamIsCapturing_spt_ptr = nullptr; void* hipStreamEndCapture_spt_ptr = nullptr; @@ -2856,7 +2843,7 @@ TEST_CASE("Unit_hipGetProcAddress_spt_Graph") { * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_spt_Event") { +TEST_CASE(Unit_hipGetProcAddress_spt_Event) { void* hipEventRecord_spt_ptr = nullptr; void* hipStreamWaitEvent_spt_ptr = nullptr; diff --git a/catch/unit/streamperthread/hipStreamPerThrdCompilerOptn.cc b/catch/unit/streamperthread/hipStreamPerThrdCompilerOptn.cc index 558b6848e..63b2e3b04 100644 --- a/catch/unit/streamperthread/hipStreamPerThrdCompilerOptn.cc +++ b/catch/unit/streamperthread/hipStreamPerThrdCompilerOptn.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* This file will be compiled using the compiler option given below. The functions will be calculating the time taken to execute under @@ -709,7 +696,7 @@ void DefaultPT2_hipMemcpy3D() { } -TEST_CASE("Unit_hipStrmPerThrdDefault") { +TEST_CASE(Unit_hipStrmPerThrdDefault) { CHECK_IMAGE_SUPPORT SECTION("Testing hipMemset/Memcpy() and their async version") { diff --git a/catch/unit/streamperthread/hipStreamPerThrdTsts.cc b/catch/unit/streamperthread/hipStreamPerThrdTsts.cc index 6bef3cc97..f6dc7bb54 100644 --- a/catch/unit/streamperthread/hipStreamPerThrdTsts.cc +++ b/catch/unit/streamperthread/hipStreamPerThrdTsts.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /* Test Description: @@ -253,7 +240,7 @@ static void EventSync() { /* Launch a kernel in hipStreamPerThread, while it is in flight check for hipStreamQuery(hipStreamPerThread) it should return hipErrorNotReady.*/ -TEST_CASE("Unit_hipStreamPerThreadTst_StrmQuery") { +TEST_CASE(Unit_hipStreamPerThreadTst_StrmQuery) { int *Ad = nullptr, *Ah = nullptr, NumElms = 4096, CONST_NUM = 123; int blockSize = 32, peak_clk; hipError_t err; @@ -302,7 +289,7 @@ TEST_CASE("Unit_hipStreamPerThreadTst_StrmQuery") { } /* Testing hipStreamPerThread stream object with hipMallocManaged() memory*/ -TEST_CASE("Unit_hipStreamPerThread_MangdMem") { +TEST_CASE(Unit_hipStreamPerThread_MangdMem) { int managed = 0; HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, 0)); if (managed == 1) { @@ -353,7 +340,7 @@ TEST_CASE("Unit_hipStreamPerThread_MangdMem") { /* To check the working of hipStreamPerThread in forked process*/ #ifdef __linux__ -TEST_CASE("Unit_hipStreamPerThread_ChildProc") { +TEST_CASE(Unit_hipStreamPerThread_ChildProc) { if (fork() == 0) { // child process int *Ad = nullptr, *Ah = nullptr, NumElms = 4096, CONST_NUM = 123; int blockSize = 32, peak_clk; @@ -402,7 +389,7 @@ TEST_CASE("Unit_hipStreamPerThread_ChildProc") { /* The following test case tests the working of hipEventSynchronize in multiple threads which are launched in quick succession*/ -TEST_CASE("Unit_hipStreamPerThread_EvtRcrdMThrd") { +TEST_CASE(Unit_hipStreamPerThread_EvtRcrdMThrd) { IfTestPassed = true; int MAX_THREAD_CNT = 20; std::vector threads(MAX_THREAD_CNT); @@ -417,7 +404,7 @@ TEST_CASE("Unit_hipStreamPerThread_EvtRcrdMThrd") { /* The following test case checks the working of hipStreamWaitEvent() with hipStreamWaitEvent()*/ -TEST_CASE("Unit_hipStreamPerThread_StrmWaitEvt") { +TEST_CASE(Unit_hipStreamPerThread_StrmWaitEvt) { IfTestPassed = true; int *Ad = nullptr, NumElms = 4096, CONST_NUM = 123, blockSize = 32, *Ah = nullptr; int *Ad1 = nullptr, *Ah1 = nullptr; @@ -482,7 +469,7 @@ TEST_CASE("Unit_hipStreamPerThread_StrmWaitEvt") { /* Testing hipLaunchCooperativeKernel() api with hipStreamPerThread*/ -TEST_CASE("Unit_hipStreamPerThread_CoopLaunch") { +TEST_CASE(Unit_hipStreamPerThread_CoopLaunch) { hipDeviceProp_t device_properties; HIPCHECK(hipGetDeviceProperties(&device_properties, 0)); /* Test whether target device supports cooperative groups ****************/ diff --git a/catch/unit/streamperthread/hipStreamPerThread_Basic.cc b/catch/unit/streamperthread/hipStreamPerThread_Basic.cc index 42a3f9507..1170dd180 100644 --- a/catch/unit/streamperthread/hipStreamPerThread_Basic.cc +++ b/catch/unit/streamperthread/hipStreamPerThread_Basic.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -30,7 +17,7 @@ __global__ void copy_kernl(int* devPtr) { } } -TEST_CASE("Unit_hipStreamPerThread_Basic") { +TEST_CASE(Unit_hipStreamPerThread_Basic) { constexpr int size = sizeof(int) * MEM_SIZE; int* hostMem = nullptr; int* devMem = nullptr; @@ -65,7 +52,7 @@ TEST_CASE("Unit_hipStreamPerThread_Basic") { HIP_CHECK(hipFree(devMem)); } -TEST_CASE("Unit_hipStreamPerThread_StreamQuery") { +TEST_CASE(Unit_hipStreamPerThread_StreamQuery) { std::vector threads(MAX_THREAD_CNT); for (auto& th : threads) { @@ -78,7 +65,7 @@ TEST_CASE("Unit_hipStreamPerThread_StreamQuery") { REQUIRE(true); } -TEST_CASE("Unit_hipStreamPerThread_StreamSynchronize") { +TEST_CASE(Unit_hipStreamPerThread_StreamSynchronize) { constexpr unsigned int MAX_THREAD_CNT = 10; std::vector threads(MAX_THREAD_CNT); @@ -92,22 +79,22 @@ TEST_CASE("Unit_hipStreamPerThread_StreamSynchronize") { REQUIRE(true); } -TEST_CASE("Unit_hipStreamPerThread_StreamGetPriority") { +TEST_CASE(Unit_hipStreamPerThread_StreamGetPriority) { int priority = 0; HIP_CHECK(hipStreamGetPriority(hipStreamPerThread, &priority)); } -TEST_CASE("Unit_hipStreamPerThread_StreamGetFlags") { +TEST_CASE(Unit_hipStreamPerThread_StreamGetFlags) { unsigned int flags = 0; HIP_CHECK(hipStreamGetFlags(hipStreamPerThread, &flags)); } -TEST_CASE("Unit_hipStreamPerThread_StreamDestroy") { +TEST_CASE(Unit_hipStreamPerThread_StreamDestroy) { hipError_t status = hipStreamDestroy(hipStreamPerThread); REQUIRE(status != hipSuccess); } -TEST_CASE("Unit_hipStreamPerThread_MemcpyAsync") { +TEST_CASE(Unit_hipStreamPerThread_MemcpyAsync) { unsigned int ele_size = (16 * 1024); // 16KB int* A_h = nullptr; int* A_d = nullptr; diff --git a/catch/unit/streamperthread/hipStreamPerThread_DeviceReset.cc b/catch/unit/streamperthread/hipStreamPerThread_DeviceReset.cc index 3e62d1a83..0d15d66a8 100644 --- a/catch/unit/streamperthread/hipStreamPerThread_DeviceReset.cc +++ b/catch/unit/streamperthread/hipStreamPerThread_DeviceReset.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -48,7 +35,7 @@ static void Copy_to_device() { HIP_CHECK(hipFree(A_d)); } -TEST_CASE("Unit_hipStreamPerThread_DeviceReset_1") { +TEST_CASE(Unit_hipStreamPerThread_DeviceReset_1) { constexpr unsigned int MAX_THREAD_CNT = 10; std::vector threads(MAX_THREAD_CNT); @@ -70,7 +57,7 @@ TEST_CASE("Unit_hipStreamPerThread_DeviceReset_1") { Watch out: Since hipStreamPerThread is an implicit stream hence even after device reset it should available to use. */ -TEST_CASE("Unit_hipStreamPerThread_DeviceReset_2") { +TEST_CASE(Unit_hipStreamPerThread_DeviceReset_2) { unsigned int ele_size = (32 * 1024); // 32KB int* A_h = nullptr; int* A_d = nullptr; diff --git a/catch/unit/streamperthread/hipStreamPerThread_Event.cc b/catch/unit/streamperthread/hipStreamPerThread_Event.cc index 552725f09..db8e4f94f 100644 --- a/catch/unit/streamperthread/hipStreamPerThread_Event.cc +++ b/catch/unit/streamperthread/hipStreamPerThread_Event.cc @@ -1,25 +1,12 @@ /* -Copyright (c) 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include -TEST_CASE("Unit_hipStreamPerThread_EventRecord") { +TEST_CASE(Unit_hipStreamPerThread_EventRecord) { hipEvent_t event; HIP_CHECK(hipEventCreate(&event)); HIP_CHECK(hipEventRecord(event, hipStreamPerThread)); @@ -36,7 +23,7 @@ __global__ void update_even_odd(unsigned int N, int* out) { } } } -TEST_CASE("Unit_hipStreamPerThread_EventSynchronize") { +TEST_CASE(Unit_hipStreamPerThread_EventSynchronize) { int* A_h = nullptr; int* A_d = nullptr; unsigned int size = 1000; diff --git a/catch/unit/streamperthread/hipStreamPerThread_MultiThread.cc b/catch/unit/streamperthread/hipStreamPerThread_MultiThread.cc index 7a0092b47..4db871d03 100644 --- a/catch/unit/streamperthread/hipStreamPerThread_MultiThread.cc +++ b/catch/unit/streamperthread/hipStreamPerThread_MultiThread.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +31,7 @@ hipStreamPerThread is an implicit stream which gets destroyed once thread is com Scenario : App pushes Async task(s) into hipStreamPerThread and did not wait for it to complete. Watch out : Incomplete task in hipStreamPerThread should not cause any crash due to thread exit. */ -TEST_CASE("Unit_hipStreamPerThread_MultiThread") { +TEST_CASE(Unit_hipStreamPerThread_MultiThread) { constexpr unsigned int MAX_THREAD_CNT = 10; std::vector threads(MAX_THREAD_CNT); diff --git a/catch/unit/surface/CMakeLists.txt b/catch/unit/surface/CMakeLists.txt index 43c7eee34..38ead5601 100644 --- a/catch/unit/surface/CMakeLists.txt +++ b/catch/unit/surface/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(TEST_SRC @@ -31,11 +15,11 @@ set(TEST_SRC ) if(HIP_PLATFORM MATCHES "nvidia") # Disabled on AMD due to defect EXSWHTEC-377 -set(TEST_SRC + set(TEST_SRC ${TEST_SRC} surfCubemapLayered.cc) endif() hip_add_exe_to_target(NAME SurfaceTest TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests) \ No newline at end of file + TEST_TARGET_NAME build_tests) diff --git a/catch/unit/surface/hipCreateSurfaceObject.cc b/catch/unit/surface/hipCreateSurfaceObject.cc index 195137421..3091aeb13 100644 --- a/catch/unit/surface/hipCreateSurfaceObject.cc +++ b/catch/unit/surface/hipCreateSurfaceObject.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -39,7 +23,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipCreateSurfaceObject_Negative_Parameters") { +TEST_CASE(Unit_hipCreateSurfaceObject_Negative_Parameters) { CHECK_IMAGE_SUPPORT hipArray_t array; diff --git a/catch/unit/surface/hipDestroySurfaceObject.cc b/catch/unit/surface/hipDestroySurfaceObject.cc index 7c5ad9744..6cfe19865 100644 --- a/catch/unit/surface/hipDestroySurfaceObject.cc +++ b/catch/unit/surface/hipDestroySurfaceObject.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -39,7 +23,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipDestroySurfaceObject_Negative_Parameters") { +TEST_CASE(Unit_hipDestroySurfaceObject_Negative_Parameters) { CHECK_IMAGE_SUPPORT SECTION("surfObject is NULL") { diff --git a/catch/unit/surface/surf1D.cc b/catch/unit/surface/surf1D.cc index caf44ab80..9ad00dfd8 100644 --- a/catch/unit/surface/surf1D.cc +++ b/catch/unit/surface/surf1D.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup surf1D surf1D @@ -242,8 +226,8 @@ template static void runTestRW(const int width) { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf1Dread_Positive_Basic", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surf1Dread_Positive_Basic, char, unsigned char, short, unsigned short, int, + unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67, 131, 263); @@ -265,8 +249,8 @@ TEMPLATE_TEST_CASE("Unit_surf1Dread_Positive_Basic", "", char, unsigned char, sh * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf1Dwrite_Positive_Basic", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surf1Dwrite_Positive_Basic, char, unsigned char, short, unsigned short, int, + unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67, 131, 263); @@ -288,8 +272,8 @@ TEMPLATE_TEST_CASE("Unit_surf1Dwrite_Positive_Basic", "", char, unsigned char, s * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf1D_Positive_ReadWrite", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surf1D_Positive_ReadWrite, char, unsigned char, short, unsigned short, int, + unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67, 131, 263); diff --git a/catch/unit/surface/surf1DLayered.cc b/catch/unit/surface/surf1DLayered.cc index c2bab576d..14fdd6683 100644 --- a/catch/unit/surface/surf1DLayered.cc +++ b/catch/unit/surface/surf1DLayered.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup surf1DLayered surf1DLayered @@ -242,7 +226,7 @@ template static void runTestRW(const int width) { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf1DLayeredread_Positive_Basic", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_surf1DLayeredread_Positive_Basic, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -264,7 +248,7 @@ TEMPLATE_TEST_CASE("Unit_surf1DLayeredread_Positive_Basic", "", char, unsigned c * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf1DLayeredwrite_Positive_Basic", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_surf1DLayeredwrite_Positive_Basic, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -286,7 +270,7 @@ TEMPLATE_TEST_CASE("Unit_surf1DLayeredwrite_Positive_Basic", "", char, unsigned * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf1DLayered_Positive_ReadWrite", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_surf1DLayered_Positive_ReadWrite, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/surface/surf2D.cc b/catch/unit/surface/surf2D.cc index 768aa91b3..1f1439d56 100644 --- a/catch/unit/surface/surf2D.cc +++ b/catch/unit/surface/surf2D.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup surf2D surf2D @@ -281,8 +265,8 @@ template static void runTestRW(const int width, const int height) { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf2Dread_Positive_Basic", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surf2Dread_Positive_Basic, char, unsigned char, short, unsigned short, int, + unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67); @@ -304,8 +288,8 @@ TEMPLATE_TEST_CASE("Unit_surf2Dread_Positive_Basic", "", char, unsigned char, sh * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf2Dwrite_Positive_Basic", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surf2Dwrite_Positive_Basic, char, unsigned char, short, unsigned short, int, + unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67); @@ -327,8 +311,8 @@ TEMPLATE_TEST_CASE("Unit_surf2Dwrite_Positive_Basic", "", char, unsigned char, s * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf2D_Positive_ReadWrite", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surf2D_Positive_ReadWrite, char, unsigned char, short, unsigned short, int, + unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67); diff --git a/catch/unit/surface/surf2DLayered.cc b/catch/unit/surface/surf2DLayered.cc index 64f85dbff..25d376fce 100644 --- a/catch/unit/surface/surf2DLayered.cc +++ b/catch/unit/surface/surf2DLayered.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup surf2DLayered surf2DLayered @@ -281,7 +265,7 @@ template static void runTestRW(const int width, const int height) { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf2DLayeredread_Positive_Basic", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_surf2DLayeredread_Positive_Basic, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -304,7 +288,7 @@ TEMPLATE_TEST_CASE("Unit_surf2DLayeredread_Positive_Basic", "", char, unsigned c * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf2DLayeredwrite_Positive_Basic", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_surf2DLayeredwrite_Positive_Basic, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -327,7 +311,7 @@ TEMPLATE_TEST_CASE("Unit_surf2DLayeredwrite_Positive_Basic", "", char, unsigned * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf2DLayered_Positive_ReadWrite", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_surf2DLayered_Positive_ReadWrite, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/surface/surf3D.cc b/catch/unit/surface/surf3D.cc index 50fad415a..a6df25cb5 100644 --- a/catch/unit/surface/surf3D.cc +++ b/catch/unit/surface/surf3D.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup surf3D surf3D @@ -327,8 +311,8 @@ template static void runTestRW(const int width, const int height, c * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf3Dread_Positive_Basic", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surf3Dread_Positive_Basic, char, unsigned char, short, unsigned short, int, + unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67); @@ -351,8 +335,8 @@ TEMPLATE_TEST_CASE("Unit_surf3Dread_Positive_Basic", "", char, unsigned char, sh * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf3Dwrite_Positive_Basic", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surf3Dwrite_Positive_Basic, char, unsigned char, short, unsigned short, int, + unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67); @@ -375,8 +359,8 @@ TEMPLATE_TEST_CASE("Unit_surf3Dwrite_Positive_Basic", "", char, unsigned char, s * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surf3D_Positive_ReadWrite", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surf3D_Positive_ReadWrite, char, unsigned char, short, unsigned short, int, + unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67); diff --git a/catch/unit/surface/surfCubemap.cc b/catch/unit/surface/surfCubemap.cc index e6bc75af5..47e5816d8 100644 --- a/catch/unit/surface/surfCubemap.cc +++ b/catch/unit/surface/surfCubemap.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup surfCubemap surfCubemap @@ -281,8 +265,8 @@ template static void runTestRW(const int width, const int height) { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surfCubemapread_Positive_Basic", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surfCubemapread_Positive_Basic, char, unsigned char, short, unsigned short, + int, unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67); @@ -304,8 +288,8 @@ TEMPLATE_TEST_CASE("Unit_surfCubemapread_Positive_Basic", "", char, unsigned cha * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surfCubemapwrite_Positive_Basic", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surfCubemapwrite_Positive_Basic, char, unsigned char, short, unsigned short, + int, unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67); @@ -327,8 +311,8 @@ TEMPLATE_TEST_CASE("Unit_surfCubemapwrite_Positive_Basic", "", char, unsigned ch * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surfCubemap_Positive_ReadWrite", "", char, unsigned char, short, - unsigned short, int, unsigned int, float) { +TEMPLATE_TEST_CASE(Unit_surfCubemap_Positive_ReadWrite, char, unsigned char, short, unsigned short, + int, unsigned int, float) { CHECK_IMAGE_SUPPORT; const int width = GENERATE(31, 67); diff --git a/catch/unit/surface/surfCubemapLayered.cc b/catch/unit/surface/surfCubemapLayered.cc index 08df1bcc1..480b2e805 100644 --- a/catch/unit/surface/surfCubemapLayered.cc +++ b/catch/unit/surface/surfCubemapLayered.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup surfCubemapLayered surfCubemapLayered @@ -284,7 +268,7 @@ template static void runTestRW(const int width, const int height) { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surfCubemapLayeredread_Positive_Basic", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_surfCubemapLayeredread_Positive_Basic, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -307,7 +291,7 @@ TEMPLATE_TEST_CASE("Unit_surfCubemapLayeredread_Positive_Basic", "", char, unsig * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surfCubemapLayeredwrite_Positive_Basic", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_surfCubemapLayeredwrite_Positive_Basic, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -330,7 +314,7 @@ TEMPLATE_TEST_CASE("Unit_surfCubemapLayeredwrite_Positive_Basic", "", char, unsi * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_surfCubemapLayered_Positive_ReadWrite", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_surfCubemapLayered_Positive_ReadWrite, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/surface/surf_common.h b/catch/unit/surface/surf_common.h index d9d314562..02efe60d5 100644 --- a/catch/unit/surface/surf_common.h +++ b/catch/unit/surface/surf_common.h @@ -1,24 +1,8 @@ /* -Copyright (c) 2026 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/synchronization/CMakeLists.txt b/catch/unit/synchronization/CMakeLists.txt index 3f5315f51..fc8aeea84 100644 --- a/catch/unit/synchronization/CMakeLists.txt +++ b/catch/unit/synchronization/CMakeLists.txt @@ -1,28 +1,40 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC copy_coherency.cc ) -add_custom_target(memcpyInt.hsaco COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} +if (HIP_PLATFORM MATCHES "amd") + add_custom_target(memcpyInt.hsaco COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -x hip ${CMAKE_CURRENT_SOURCE_DIR}/memcpyIntDevice.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/../synchronization/memcpyInt.hsaco -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) +else() + add_custom_target(memcpyInt.hsaco COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/memcpyIntDevice.cpp -o + ${CMAKE_CURRENT_BINARY_DIR}/../synchronization/memcpyInt.hsaco + -I${HIP_INCLUDE_DIR} + -I${CMAKE_CURRENT_SOURCE_DIR}/../../include) +endif() set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/memcpyInt.hsaco) # only for AMD if(HIP_PLATFORM MATCHES "amd") -# There are problems in Windows: __hip_atomicsXXX() won't work as expected -if(NOT WIN32) - set(AMD_SRC + # There are problems in Windows: __hip_atomicsXXX() won't work as expected + if(NOT WIN32) + set(AMD_SRC cache_coherency_cpu_gpu.cc cache_coherency_gpu_gpu.cc ) - set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) -endif() + set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) + endif() endif() hip_add_exe_to_target(NAME synchronizationTests TEST_SRC ${TEST_SRC} TEST_TARGET_NAME build_tests COMPILE_OPTIONS -std=c++14) -add_dependencies(synchronizationTests memcpyInt.hsaco) +add_dependencies(synchronizationTests memcpyInt.hsaco) diff --git a/catch/unit/synchronization/cache_coherency_cpu_gpu.cc b/catch/unit/synchronization/cache_coherency_cpu_gpu.cc index 30e5ba303..2b29990a1 100644 --- a/catch/unit/synchronization/cache_coherency_cpu_gpu.cc +++ b/catch/unit/synchronization/cache_coherency_cpu_gpu.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Simple test for Fine Grained CPU-GPU coherency. #include @@ -254,7 +242,7 @@ static bool cpu_to_gpu_coherency() { * - Test to be run only on AMD. */ -TEST_CASE("Unit_cache_coherency_cpu_gpu") { +TEST_CASE(Unit_cache_coherency_cpu_gpu) { bool passed = true; // Coherency between CPU and GPU sharing host and device memory. REQUIRE(passed == cpu_to_gpu_coherency()); diff --git a/catch/unit/synchronization/cache_coherency_gpu_gpu.cc b/catch/unit/synchronization/cache_coherency_gpu_gpu.cc index eda2cc465..7110ba33c 100644 --- a/catch/unit/synchronization/cache_coherency_gpu_gpu.cc +++ b/catch/unit/synchronization/cache_coherency_gpu_gpu.cc @@ -1,21 +1,9 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + // Simple test for Fine Grained GPU-GPU coherency. #include @@ -284,7 +272,7 @@ static bool gpu_to_gpu_coherency() { * - Test to be run only on AMD. */ -TEST_CASE("Unit_cache_coherency_gpu_gpu", "[multigpu]") { +TEST_CASE(Unit_cache_coherency_gpu_gpu) { bool passed = true; // Coherency between GPUs accessing local or remote FB. REQUIRE(passed == gpu_to_gpu_coherency()); diff --git a/catch/unit/synchronization/copy_coherency.cc b/catch/unit/synchronization/copy_coherency.cc index bf0eb5c7c..2a2157b21 100644 --- a/catch/unit/synchronization/copy_coherency.cc +++ b/catch/unit/synchronization/copy_coherency.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -327,7 +314,7 @@ void testWrapper(size_t numElements) { * - HIP_VERSION >= 5.5 */ -TEST_CASE("Unit_Copy_Coherency") { +TEST_CASE(Unit_Copy_Coherency) { for (int index = 0; index < sizeof(g_elementSizes) / sizeof(int); index++) { size_t numElements = g_elementSizes[index]; testWrapper(numElements); diff --git a/catch/unit/syncthreads/CMakeLists.txt b/catch/unit/syncthreads/CMakeLists.txt index ae8ee33e8..639c08df6 100644 --- a/catch/unit/syncthreads/CMakeLists.txt +++ b/catch/unit/syncthreads/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC __syncthreads.cc diff --git a/catch/unit/syncthreads/__syncthreads.cc b/catch/unit/syncthreads/__syncthreads.cc index 77626b067..39566cc77 100644 --- a/catch/unit/syncthreads/__syncthreads.cc +++ b/catch/unit/syncthreads/__syncthreads.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -43,7 +27,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_Positive_Basic") { +TEST_CASE(Unit___syncthreads_Positive_Basic) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); diff --git a/catch/unit/syncthreads/__syncthreads_and.cc b/catch/unit/syncthreads/__syncthreads_and.cc index a96f0e40b..82eb66e0b 100644 --- a/catch/unit/syncthreads/__syncthreads_and.cc +++ b/catch/unit/syncthreads/__syncthreads_and.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_and_Positive_Basic") { +TEST_CASE(Unit___syncthreads_and_Positive_Basic) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -71,7 +55,7 @@ TEST_CASE("Unit___syncthreads_and_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_and_Positive_Predicate_Zero") { +TEST_CASE(Unit___syncthreads_and_Positive_Predicate_Zero) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -99,7 +83,7 @@ TEST_CASE("Unit___syncthreads_and_Positive_Predicate_Zero") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_and_Positive_Predicate_One") { +TEST_CASE(Unit___syncthreads_and_Positive_Predicate_One) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -128,7 +112,7 @@ TEST_CASE("Unit___syncthreads_and_Positive_Predicate_One") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_and_Positive_Predicate_OddEven") { +TEST_CASE(Unit___syncthreads_and_Positive_Predicate_OddEven) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -156,7 +140,7 @@ TEST_CASE("Unit___syncthreads_and_Positive_Predicate_OddEven") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_and_Positive_Predicate_Negative") { +TEST_CASE(Unit___syncthreads_and_Positive_Predicate_Negative) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -184,7 +168,7 @@ TEST_CASE("Unit___syncthreads_and_Positive_Predicate_Negative") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_and_Positive_Predicate_Id") { +TEST_CASE(Unit___syncthreads_and_Positive_Predicate_Id) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -212,7 +196,7 @@ TEST_CASE("Unit___syncthreads_and_Positive_Predicate_Id") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_and_Negative_Parameters_RTC") { +TEST_CASE(Unit___syncthreads_and_Negative_Parameters_RTC) { hiprtcProgram program{}; HIPRTC_CHECK(hiprtcCreateProgram(&program, kSyncthreadsAndSource, "__syncthreads_and_negative.cc", diff --git a/catch/unit/syncthreads/__syncthreads_and_negative_kernels.cc b/catch/unit/syncthreads/__syncthreads_and_negative_kernels.cc index 5d889a99d..7ba01b3d0 100644 --- a/catch/unit/syncthreads/__syncthreads_and_negative_kernels.cc +++ b/catch/unit/syncthreads/__syncthreads_and_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/syncthreads/__syncthreads_and_negative_kernels_rtc.hh b/catch/unit/syncthreads/__syncthreads_and_negative_kernels_rtc.hh index fc7be2787..284b9d1b6 100644 --- a/catch/unit/syncthreads/__syncthreads_and_negative_kernels_rtc.hh +++ b/catch/unit/syncthreads/__syncthreads_and_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/syncthreads/__syncthreads_count.cc b/catch/unit/syncthreads/__syncthreads_count.cc index f23e9474b..2b144aaa2 100644 --- a/catch/unit/syncthreads/__syncthreads_count.cc +++ b/catch/unit/syncthreads/__syncthreads_count.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_count_Positive_Basic") { +TEST_CASE(Unit___syncthreads_count_Positive_Basic) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -71,7 +55,7 @@ TEST_CASE("Unit___syncthreads_count_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_count_Positive_Predicate_Zero") { +TEST_CASE(Unit___syncthreads_count_Positive_Predicate_Zero) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -99,7 +83,7 @@ TEST_CASE("Unit___syncthreads_count_Positive_Predicate_Zero") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_count_Positive_Predicate_One") { +TEST_CASE(Unit___syncthreads_count_Positive_Predicate_One) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -128,7 +112,7 @@ TEST_CASE("Unit___syncthreads_count_Positive_Predicate_One") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_count_Positive_Predicate_OddEven") { +TEST_CASE(Unit___syncthreads_count_Positive_Predicate_OddEven) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -156,7 +140,7 @@ TEST_CASE("Unit___syncthreads_count_Positive_Predicate_OddEven") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_count_Positive_Predicate_Negative") { +TEST_CASE(Unit___syncthreads_count_Positive_Predicate_Negative) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -184,7 +168,7 @@ TEST_CASE("Unit___syncthreads_count_Positive_Predicate_Negative") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_count_Positive_Predicate_Id") { +TEST_CASE(Unit___syncthreads_count_Positive_Predicate_Id) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -212,7 +196,7 @@ TEST_CASE("Unit___syncthreads_count_Positive_Predicate_Id") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_count_Negative_Parameters_RTC") { +TEST_CASE(Unit___syncthreads_count_Negative_Parameters_RTC) { hiprtcProgram program{}; HIPRTC_CHECK(hiprtcCreateProgram(&program, kSyncthreadsCountSource, diff --git a/catch/unit/syncthreads/__syncthreads_count_negative_kernels.cc b/catch/unit/syncthreads/__syncthreads_count_negative_kernels.cc index 83d8cf08a..3ddd9f7c2 100644 --- a/catch/unit/syncthreads/__syncthreads_count_negative_kernels.cc +++ b/catch/unit/syncthreads/__syncthreads_count_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/syncthreads/__syncthreads_count_negative_kernels_rtc.hh b/catch/unit/syncthreads/__syncthreads_count_negative_kernels_rtc.hh index 9f40e5117..7d3fa38d6 100644 --- a/catch/unit/syncthreads/__syncthreads_count_negative_kernels_rtc.hh +++ b/catch/unit/syncthreads/__syncthreads_count_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/syncthreads/__syncthreads_or.cc b/catch/unit/syncthreads/__syncthreads_or.cc index 20ffcec28..661bb3971 100644 --- a/catch/unit/syncthreads/__syncthreads_or.cc +++ b/catch/unit/syncthreads/__syncthreads_or.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_or_Positive_Basic") { +TEST_CASE(Unit___syncthreads_or_Positive_Basic) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -71,7 +55,7 @@ TEST_CASE("Unit___syncthreads_or_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_or_Positive_Predicate_Zero") { +TEST_CASE(Unit___syncthreads_or_Positive_Predicate_Zero) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -99,7 +83,7 @@ TEST_CASE("Unit___syncthreads_or_Positive_Predicate_Zero") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_or_Positive_Predicate_One") { +TEST_CASE(Unit___syncthreads_or_Positive_Predicate_One) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -128,7 +112,7 @@ TEST_CASE("Unit___syncthreads_or_Positive_Predicate_One") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_or_Positive_Predicate_OddEven") { +TEST_CASE(Unit___syncthreads_or_Positive_Predicate_OddEven) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -156,7 +140,7 @@ TEST_CASE("Unit___syncthreads_or_Positive_Predicate_OddEven") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_or_Positive_Predicate_Negative") { +TEST_CASE(Unit___syncthreads_or_Positive_Predicate_Negative) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -184,7 +168,7 @@ TEST_CASE("Unit___syncthreads_or_Positive_Predicate_Negative") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_or_Positive_Predicate_Id") { +TEST_CASE(Unit___syncthreads_or_Positive_Predicate_Id) { const auto kGridSize = 2; const auto kBlockSize = GENERATE(13, 32, 64, 513); @@ -212,7 +196,7 @@ TEST_CASE("Unit___syncthreads_or_Positive_Predicate_Id") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___syncthreads_or_Negative_Parameters_RTC") { +TEST_CASE(Unit___syncthreads_or_Negative_Parameters_RTC) { hiprtcProgram program{}; HIPRTC_CHECK(hiprtcCreateProgram(&program, kSyncthreadsOrSource, "__syncthreads_or_negative.cc", diff --git a/catch/unit/syncthreads/__syncthreads_or_negative_kernels.cc b/catch/unit/syncthreads/__syncthreads_or_negative_kernels.cc index b6f46a811..e554dbda5 100644 --- a/catch/unit/syncthreads/__syncthreads_or_negative_kernels.cc +++ b/catch/unit/syncthreads/__syncthreads_or_negative_kernels.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/syncthreads/__syncthreads_or_negative_kernels_rtc.hh b/catch/unit/syncthreads/__syncthreads_or_negative_kernels_rtc.hh index dd7e1f93b..36b28a8cd 100644 --- a/catch/unit/syncthreads/__syncthreads_or_negative_kernels_rtc.hh +++ b/catch/unit/syncthreads/__syncthreads_or_negative_kernels_rtc.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/syncthreads/syncthreads_common.hh b/catch/unit/syncthreads/syncthreads_common.hh index c6f9dec8d..192e77155 100644 --- a/catch/unit/syncthreads/syncthreads_common.hh +++ b/catch/unit/syncthreads/syncthreads_common.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/texture/CMakeLists.txt b/catch/unit/texture/CMakeLists.txt index 95282cd1e..1984fd451 100644 --- a/catch/unit/texture/CMakeLists.txt +++ b/catch/unit/texture/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms set(TEST_SRC @@ -66,6 +50,7 @@ set(TEST_SRC hipTexRefGetAddressMode.cc hipTexRefSetGetFilterMode.cc hipDeviceGetTexture1DLinearMaxWidth.cc + hipMipmappedArrayGetMemoryRequirements.cc ) # tests not for gfx90a+ @@ -89,9 +74,6 @@ set(NOT_FOR_gfx90a_AND_ABOVE_TEST hipMipmappedArrayCreate.cc hipMipmappedArrayDestroy.cc hipMipmappedArrayGetLevel.cc - hipTextureMipmapObj1D.cc - hipTextureMipmapObj2D.cc - hipTextureMipmapObj3D.cc tex1DLod.cc tex1DLayeredLod.cc tex2DLod.cc @@ -101,9 +83,15 @@ set(NOT_FOR_gfx90a_AND_ABOVE_TEST hipTexRefSetGetMipmapLevelBias.cc hipTexRefSetGetMipmapLevelClamp.cc hipTexRefSetGetMipmappedArray.cc - hipMipmappedArrayGetMemoryRequirements.cc ) +if (HIP_PLATFORM MATCHES "amd") + set(${TEST_SRC} ${TEST_SRC} hipTextureMipmapObj1D.cc + hipTextureMipmapObj2D.cc + hipTextureMipmapObj3D.cc +) +endif() + set(gfx90a_AND_ABOVE_TARGETS gfx90a gfx942 gfx950) function(CheckRejectedArchs OFFLOAD_ARCH_STR_LOCAL) set(ARCH_CHECK -1 PARENT_SCOPE) @@ -118,12 +106,21 @@ function(CheckRejectedArchs OFFLOAD_ARCH_STR_LOCAL) endforeach() # OFFLOAD_ARCH_LIST endfunction() # CheckAcceptedArchs -add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code - COMMAND ${CMAKE_HIP_COMPILER} --cuda-device-only ${OFFLOAD_ARCH_LIST} -Wno-deprecated-declarations +if (HIP_PLATFORM MATCHES "amd") + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} ${OFFLOAD_ARCH_LIST} --cuda-device-only -Wno-deprecated-declarations -x hip ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc -I${HIP_INCLUDE_DIR} ${HIP_PATH_OPT} -o tex_ref_get_module.code DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc) +else() + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code + COMMAND ${CMAKE_HIP_COMPILER} --fatbin ${OFFLOAD_ARCH_LIST} + -x cu ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc + -I${HIP_INCLUDE_DIR} + -o tex_ref_get_module.code + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tex_ref_get_module.cc) +endif() add_custom_target(tex_ref_get_module ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code) set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/tex_ref_get_module.code) diff --git a/catch/unit/texture/fixed_point.hh b/catch/unit/texture/fixed_point.hh index ba95c42c4..edfe0266e 100644 --- a/catch/unit/texture/fixed_point.hh +++ b/catch/unit/texture/fixed_point.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/texture/hipBindTexture.cc b/catch/unit/texture/hipBindTexture.cc index d8fadcfe2..9c18d659e 100644 --- a/catch/unit/texture/hipBindTexture.cc +++ b/catch/unit/texture/hipBindTexture.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -35,7 +22,7 @@ static __global__ void kernel(float* out) { #endif } -TEST_CASE("Unit_hipBindTexture_Positive") { +TEST_CASE(Unit_hipBindTexture_Positive) { CHECK_IMAGE_SUPPORT size_t offset = 0; float* tex_buf; @@ -58,7 +45,7 @@ TEST_CASE("Unit_hipBindTexture_Positive") { HIP_CHECK(hipFree(tex_buf)); } -TEST_CASE("Unit_hipBindTexture_1DfetchVerification") { +TEST_CASE(Unit_hipBindTexture_1DfetchVerification) { CHECK_IMAGE_SUPPORT float* tex_buf; @@ -103,7 +90,7 @@ TEST_CASE("Unit_hipBindTexture_1DfetchVerification") { HIP_CHECK(hipFree(dev_buf)); } -TEST_CASE("Unit_hipBindTexture_Negative") { +TEST_CASE(Unit_hipBindTexture_Negative) { CHECK_IMAGE_SUPPORT size_t offset = 0; float* tex_buf; diff --git a/catch/unit/texture/hipBindTexture2D.cc b/catch/unit/texture/hipBindTexture2D.cc index 658ae6d37..ba7721416 100644 --- a/catch/unit/texture/hipBindTexture2D.cc +++ b/catch/unit/texture/hipBindTexture2D.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -39,7 +26,7 @@ static __global__ void texture2dCopyKernel(float* dst) { #endif } -TEST_CASE("Unit_hipBindTexture2D_Positive") { +TEST_CASE(Unit_hipBindTexture2D_Positive) { CHECK_IMAGE_SUPPORT float* device_ptr; size_t device_pitch, texture_offset; @@ -50,7 +37,7 @@ TEST_CASE("Unit_hipBindTexture2D_Positive") { HIP_CHECK(hipFree((void*)device_ptr)); } -TEST_CASE("Unit_hipBindTexture2D_Pitch") { +TEST_CASE(Unit_hipBindTexture2D_Pitch) { CHECK_IMAGE_SUPPORT (void) hipGetLastError(); // Prevent negative tests affecting this @@ -89,7 +76,7 @@ TEST_CASE("Unit_hipBindTexture2D_Pitch") { HIP_CHECK(hipUnbindTexture(tex)); } -TEST_CASE("Unit_hipBindTexture2D_Negative") { +TEST_CASE(Unit_hipBindTexture2D_Negative) { CHECK_IMAGE_SUPPORT float* device_ptr; size_t device_pitch, texture_offset; diff --git a/catch/unit/texture/hipBindTextureToArray.cc b/catch/unit/texture/hipBindTextureToArray.cc index ecf8adad3..84f02f500 100644 --- a/catch/unit/texture/hipBindTextureToArray.cc +++ b/catch/unit/texture/hipBindTextureToArray.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -77,7 +64,7 @@ bool compare_array_elements(int* array1, int* array2, int width, int height = 1, return true; } -TEST_CASE("Unit_hipBindTextureToArray_Negative_Parameters") { +TEST_CASE(Unit_hipBindTextureToArray_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr unsigned int width = 16; @@ -145,7 +132,7 @@ TEST_CASE("Unit_hipBindTextureToArray_Negative_Parameters") { free(data); } -TEST_CASE("Unit_hipBindTextureToArray_Positive_1D") { +TEST_CASE(Unit_hipBindTextureToArray_Positive_1D) { CHECK_IMAGE_SUPPORT constexpr unsigned int width = 1024; @@ -190,7 +177,7 @@ TEST_CASE("Unit_hipBindTextureToArray_Positive_1D") { free(data); } -TEST_CASE("Unit_hipBindTextureToArray_Positive_2D") { +TEST_CASE(Unit_hipBindTextureToArray_Positive_2D) { CHECK_IMAGE_SUPPORT constexpr unsigned int width = 256; @@ -239,7 +226,7 @@ TEST_CASE("Unit_hipBindTextureToArray_Positive_2D") { free(data); } -TEST_CASE("Unit_hipBindTextureToArray_Positive_3D") { +TEST_CASE(Unit_hipBindTextureToArray_Positive_3D) { CHECK_IMAGE_SUPPORT constexpr unsigned int width = 256; diff --git a/catch/unit/texture/hipBindTextureToMipmappedArray.cc b/catch/unit/texture/hipBindTextureToMipmappedArray.cc index 3f7bed5b5..a521fce2f 100644 --- a/catch/unit/texture/hipBindTextureToMipmappedArray.cc +++ b/catch/unit/texture/hipBindTextureToMipmappedArray.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -134,7 +121,7 @@ static void runMipMapTest(unsigned int width, unsigned int height, unsigned int * - Host specific (WINDOWS) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipTextureMipmapRef2D_Positive_Check") { +TEST_CASE(Unit_hipTextureMipmapRef2D_Positive_Check) { CHECK_IMAGE_SUPPORT // Height Width Vector @@ -174,7 +161,7 @@ TEST_CASE("Unit_hipTextureMipmapRef2D_Positive_Check") { * - Host specific (WINDOWS) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipTextureMipmapRef2D_Negative_Parameters") { +TEST_CASE(Unit_hipTextureMipmapRef2D_Negative_Parameters) { CHECK_IMAGE_SUPPORT #if defined(_WIN32) diff --git a/catch/unit/texture/hipCreateTextureObject_ArgValidation.cc b/catch/unit/texture/hipCreateTextureObject_ArgValidation.cc index 92910a100..0e4f35eda 100644 --- a/catch/unit/texture/hipCreateTextureObject_ArgValidation.cc +++ b/catch/unit/texture/hipCreateTextureObject_ArgValidation.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -50,7 +37,7 @@ THE SOFTWARE. * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipCreateTextureObject_ArgValidation") { +TEST_CASE(Unit_hipCreateTextureObject_ArgValidation) { CHECK_IMAGE_SUPPORT float* texBuf; diff --git a/catch/unit/texture/hipCreateTextureObject_Array.cc b/catch/unit/texture/hipCreateTextureObject_Array.cc index f232edc80..f5f4efad6 100644 --- a/catch/unit/texture/hipCreateTextureObject_Array.cc +++ b/catch/unit/texture/hipCreateTextureObject_Array.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -38,7 +25,7 @@ THE SOFTWARE. * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipCreateTextureObject_ArrayResource") { +TEST_CASE(Unit_hipCreateTextureObject_ArrayResource) { CHECK_IMAGE_SUPPORT hipError_t ret; @@ -73,7 +60,7 @@ TEST_CASE("Unit_hipCreateTextureObject_ArrayResource") { * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipCreateTextureObject_MmArrayResource") { +TEST_CASE(Unit_hipCreateTextureObject_MmArrayResource) { CHECK_IMAGE_SUPPORT hipError_t ret; diff --git a/catch/unit/texture/hipCreateTextureObject_Linear.cc b/catch/unit/texture/hipCreateTextureObject_Linear.cc index 6fc6e2177..f4e2f1aa8 100644 --- a/catch/unit/texture/hipCreateTextureObject_Linear.cc +++ b/catch/unit/texture/hipCreateTextureObject_Linear.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -51,7 +38,7 @@ THE SOFTWARE. * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipCreateTextureObject_LinearResource") { +TEST_CASE(Unit_hipCreateTextureObject_LinearResource) { CHECK_IMAGE_SUPPORT float* texBuf; diff --git a/catch/unit/texture/hipCreateTextureObject_Pitch2D.cc b/catch/unit/texture/hipCreateTextureObject_Pitch2D.cc index e21220e43..b87df67fc 100644 --- a/catch/unit/texture/hipCreateTextureObject_Pitch2D.cc +++ b/catch/unit/texture/hipCreateTextureObject_Pitch2D.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -62,7 +49,7 @@ THE SOFTWARE. * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipCreateTextureObject_Pitch2DResource") { +TEST_CASE(Unit_hipCreateTextureObject_Pitch2DResource) { CHECK_IMAGE_SUPPORT hipError_t ret; diff --git a/catch/unit/texture/hipDeviceGetTexture1DLinearMaxWidth.cc b/catch/unit/texture/hipDeviceGetTexture1DLinearMaxWidth.cc index b4e244f8a..ed5063116 100644 --- a/catch/unit/texture/hipDeviceGetTexture1DLinearMaxWidth.cc +++ b/catch/unit/texture/hipDeviceGetTexture1DLinearMaxWidth.cc @@ -1,24 +1,9 @@ /* -Copyright (c) 2025 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. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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 /** @@ -34,7 +19,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipDeviceGetTexture1DLinearMaxWidth_Positive") { +TEST_CASE(Unit_hipDeviceGetTexture1DLinearMaxWidth_Positive) { CHECK_IMAGE_SUPPORT int deviceCount = 0; @@ -68,7 +53,7 @@ TEST_CASE("Unit_hipDeviceGetTexture1DLinearMaxWidth_Positive") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipDeviceGetTexture1DLinearMaxWidth_Negative") { +TEST_CASE(Unit_hipDeviceGetTexture1DLinearMaxWidth_Negative) { CHECK_IMAGE_SUPPORT int deviceCount = 0; diff --git a/catch/unit/texture/hipFreeMipmappedArray.cc b/catch/unit/texture/hipFreeMipmappedArray.cc index 20ee62f74..5ba7808cb 100644 --- a/catch/unit/texture/hipFreeMipmappedArray.cc +++ b/catch/unit/texture/hipFreeMipmappedArray.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -39,7 +23,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipFreeMipmappedArray_Negative_Parameters") { +TEST_CASE(Unit_hipFreeMipmappedArray_Negative_Parameters) { CHECK_IMAGE_SUPPORT; SECTION("array is nullptr") { diff --git a/catch/unit/texture/hipGetChanDesc.cc b/catch/unit/texture/hipGetChanDesc.cc index e3aec357d..10f0217e0 100644 --- a/catch/unit/texture/hipGetChanDesc.cc +++ b/catch/unit/texture/hipGetChanDesc.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -43,7 +30,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetChannelDesc_CreateAndGet") { +TEST_CASE(Unit_hipGetChannelDesc_CreateAndGet) { CHECK_IMAGE_SUPPORT; hipChannelFormatDesc chan_test, chan_desc; @@ -76,7 +63,7 @@ TEST_CASE("Unit_hipGetChannelDesc_CreateAndGet") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetChannelDesc_Negative_Parameters") { +TEST_CASE(Unit_hipGetChannelDesc_Negative_Parameters) { CHECK_IMAGE_SUPPORT; hipChannelFormatDesc chan_test, chan_desc; diff --git a/catch/unit/texture/hipGetMipmappedArrayLevel.cc b/catch/unit/texture/hipGetMipmappedArrayLevel.cc index 2ec207de2..8075ff805 100644 --- a/catch/unit/texture/hipGetMipmappedArrayLevel.cc +++ b/catch/unit/texture/hipGetMipmappedArrayLevel.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -39,7 +23,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipGetMipmappedArrayLevel_Negative_Parameters") { +TEST_CASE(Unit_hipGetMipmappedArrayLevel_Negative_Parameters) { CHECK_IMAGE_SUPPORT; hipMipmappedArray_t array; diff --git a/catch/unit/texture/hipGetTextureAlignmentOffset.cc b/catch/unit/texture/hipGetTextureAlignmentOffset.cc index fd05a6a35..51a164779 100644 --- a/catch/unit/texture/hipGetTextureAlignmentOffset.cc +++ b/catch/unit/texture/hipGetTextureAlignmentOffset.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -38,7 +22,7 @@ texture tex; * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipGetTextureAlignmentOffset_Positive") { +TEST_CASE(Unit_hipGetTextureAlignmentOffset_Positive) { CHECK_IMAGE_SUPPORT size_t offset = 0; @@ -66,7 +50,7 @@ TEST_CASE("Unit_hipGetTextureAlignmentOffset_Positive") { * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipGetTextureAlignmentOffset_Negative") { +TEST_CASE(Unit_hipGetTextureAlignmentOffset_Negative) { CHECK_IMAGE_SUPPORT size_t offset = 0; size_t* tex_buf; diff --git a/catch/unit/texture/hipGetTextureReference.cc b/catch/unit/texture/hipGetTextureReference.cc index 6cfac5447..f04218433 100644 --- a/catch/unit/texture/hipGetTextureReference.cc +++ b/catch/unit/texture/hipGetTextureReference.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -26,7 +10,7 @@ THE SOFTWARE. texture tex; -TEST_CASE("Unit_hipGetTextureReference_Positive") { +TEST_CASE(Unit_hipGetTextureReference_Positive) { CHECK_IMAGE_SUPPORT const textureReference* tex_ref = nullptr; @@ -34,7 +18,7 @@ TEST_CASE("Unit_hipGetTextureReference_Positive") { REQUIRE(tex_ref != nullptr); } -TEST_CASE("Unit_hipGetTextureReference_Negative") { +TEST_CASE(Unit_hipGetTextureReference_Negative) { CHECK_IMAGE_SUPPORT const textureReference* tex_ref = nullptr; diff --git a/catch/unit/texture/hipMallocMipmappedArray.cc b/catch/unit/texture/hipMallocMipmappedArray.cc index aaa38ba19..e31d093e6 100644 --- a/catch/unit/texture/hipMallocMipmappedArray.cc +++ b/catch/unit/texture/hipMallocMipmappedArray.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -39,7 +23,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipMallocMipmappedArray_Negative_Parameters") { +TEST_CASE(Unit_hipMallocMipmappedArray_Negative_Parameters) { CHECK_IMAGE_SUPPORT; hipMipmappedArray_t array; diff --git a/catch/unit/texture/hipMipmappedArrayCreate.cc b/catch/unit/texture/hipMipmappedArrayCreate.cc index 6b237dbae..aabd92814 100644 --- a/catch/unit/texture/hipMipmappedArrayCreate.cc +++ b/catch/unit/texture/hipMipmappedArrayCreate.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -40,7 +24,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipMipmappedArrayCreate_Negative_Parameters") { +TEST_CASE(Unit_hipMipmappedArrayCreate_Negative_Parameters) { CHECK_IMAGE_SUPPORT; hipmipmappedArray array; diff --git a/catch/unit/texture/hipMipmappedArrayDestroy.cc b/catch/unit/texture/hipMipmappedArrayDestroy.cc index 5a01095b7..732b94dbf 100644 --- a/catch/unit/texture/hipMipmappedArrayDestroy.cc +++ b/catch/unit/texture/hipMipmappedArrayDestroy.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -40,7 +24,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipMipmappedArrayDestroy_Negative_Parameters") { +TEST_CASE(Unit_hipMipmappedArrayDestroy_Negative_Parameters) { CHECK_IMAGE_SUPPORT; SECTION("array is nullptr") { diff --git a/catch/unit/texture/hipMipmappedArrayGetLevel.cc b/catch/unit/texture/hipMipmappedArrayGetLevel.cc index 1f12449a1..5929ecf00 100644 --- a/catch/unit/texture/hipMipmappedArrayGetLevel.cc +++ b/catch/unit/texture/hipMipmappedArrayGetLevel.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -40,7 +24,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEST_CASE("Unit_hipMipmappedArrayGetLevel_Negative_Parameters") { +TEST_CASE(Unit_hipMipmappedArrayGetLevel_Negative_Parameters) { CHECK_IMAGE_SUPPORT; hipmipmappedArray array; diff --git a/catch/unit/texture/hipMipmappedArrayGetMemoryRequirements.cc b/catch/unit/texture/hipMipmappedArrayGetMemoryRequirements.cc index f7365f5aa..bae1066e7 100644 --- a/catch/unit/texture/hipMipmappedArrayGetMemoryRequirements.cc +++ b/catch/unit/texture/hipMipmappedArrayGetMemoryRequirements.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -26,11 +10,6 @@ THE SOFTWARE. TEST_CASE("Unit_hipMipmappedArrayGetMemoryRequirements_Negative_Parameters") { CHECK_IMAGE_SUPPORT; -#ifdef __linux__ - HipTest::HIP_SKIP_TEST("Mipmap APIs are not supported on Linux"); - return; -#endif //__linux__ - const int device_id = 0; hipArrayMemoryRequirements memoryRequirements{}; hipmipmappedArray array; diff --git a/catch/unit/texture/hipNormalizedFloatValueTex.cc b/catch/unit/texture/hipNormalizedFloatValueTex.cc index 61aa4cd0d..1f35f0646 100644 --- a/catch/unit/texture/hipNormalizedFloatValueTex.cc +++ b/catch/unit/texture/hipNormalizedFloatValueTex.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -135,7 +122,7 @@ static void runTest_hipTextureFilterMode() { textureTest(&texuc); } -TEST_CASE("Unit_hipNormalizedFloatValueTex_CheckModes") { +TEST_CASE(Unit_hipNormalizedFloatValueTex_CheckModes) { CHECK_IMAGE_SUPPORT #if HT_AMD diff --git a/catch/unit/texture/hipSimpleTexture1DLayered.cc b/catch/unit/texture/hipSimpleTexture1DLayered.cc index 9b9566deb..fdb31dd37 100644 --- a/catch/unit/texture/hipSimpleTexture1DLayered.cc +++ b/catch/unit/texture/hipSimpleTexture1DLayered.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -56,7 +43,7 @@ __global__ void simpleKernelLayered1DArray(hipTextureObject_t tex, TestType* out * - Textures supported on device * - HIP_VERSION >= 6.0 */ -TEMPLATE_TEST_CASE("Unit_Layered1DTexture_Check_HostBufferToFromLayered1DArray", "", char, +TEMPLATE_TEST_CASE(Unit_Layered1DTexture_Check_HostBufferToFromLayered1DArray, char, unsigned char, short, ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, float1, char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, short4, ushort4, int4, uint4, float4) { @@ -199,7 +186,7 @@ TEMPLATE_TEST_CASE("Unit_Layered1DTexture_Check_HostBufferToFromLayered1DArray", * - Textures supported on device * - HIP_VERSION >= 6.0 */ -TEMPLATE_TEST_CASE("Unit_Layered1DTexture_Check_DeviceBufferToFromLayered1DArray", "", char, +TEMPLATE_TEST_CASE(Unit_Layered1DTexture_Check_DeviceBufferToFromLayered1DArray, char, unsigned char, short, ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, float1, char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, short4, ushort4, int4, uint4, float4) { diff --git a/catch/unit/texture/hipSimpleTexture2DLayered.cc b/catch/unit/texture/hipSimpleTexture2DLayered.cc index c2e7d112a..c4807dab3 100644 --- a/catch/unit/texture/hipSimpleTexture2DLayered.cc +++ b/catch/unit/texture/hipSimpleTexture2DLayered.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -58,7 +45,7 @@ __global__ void simpleKernelLayered2DArray(hipTextureObject_t tex, TestType* out * - Textures supported on device * - HIP_VERSION >= 6.0 */ -TEMPLATE_TEST_CASE("Unit_Layered2DTexture_Check_HostBufferToFromLayered2DArray", "", char, +TEMPLATE_TEST_CASE(Unit_Layered2DTexture_Check_HostBufferToFromLayered2DArray, char, unsigned char, short, ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, float1, char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, short4, ushort4, int4, uint4, float4) { @@ -204,7 +191,7 @@ TEMPLATE_TEST_CASE("Unit_Layered2DTexture_Check_HostBufferToFromLayered2DArray", * - Textures supported on device * - HIP_VERSION >= 6.0 */ -TEMPLATE_TEST_CASE("Unit_Layered2DTexture_Check_DeviceBufferToFromLayered2DArray", "", char, +TEMPLATE_TEST_CASE(Unit_Layered2DTexture_Check_DeviceBufferToFromLayered2DArray, char, unsigned char, short, ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, float1, char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, short4, ushort4, int4, uint4, float4) { diff --git a/catch/unit/texture/hipSimpleTexture3D.cc b/catch/unit/texture/hipSimpleTexture3D.cc index df9e140f9..6191f50a2 100644 --- a/catch/unit/texture/hipSimpleTexture3D.cc +++ b/catch/unit/texture/hipSimpleTexture3D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -112,7 +99,7 @@ static void runSimpleTexture3D_Check(int width, int height, int depth, free(hOutputData); } -TEST_CASE("Unit_hipSimpleTexture3D_Check_DataTypes") { +TEST_CASE(Unit_hipSimpleTexture3D_Check_DataTypes) { CHECK_IMAGE_SUPPORT diff --git a/catch/unit/texture/hipTex1DFetchCheckModes.cc b/catch/unit/texture/hipTex1DFetchCheckModes.cc index 9e8b92648..9821b2773 100644 --- a/catch/unit/texture/hipTex1DFetchCheckModes.cc +++ b/catch/unit/texture/hipTex1DFetchCheckModes.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -103,7 +90,7 @@ static void runTest(hipTextureAddressMode addressMode, hipTextureFilterMode filt } -TEST_CASE("Unit_tex1Dfetch_CheckModes") { +TEST_CASE(Unit_tex1Dfetch_CheckModes) { CHECK_IMAGE_SUPPORT (void) hipGetLastError(); // Prevent negative tests affecting this diff --git a/catch/unit/texture/hipTexObjPitch.cc b/catch/unit/texture/hipTexObjPitch.cc index 3bef80e4c..22908d0e9 100644 --- a/catch/unit/texture/hipTexObjPitch.cc +++ b/catch/unit/texture/hipTexObjPitch.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -55,7 +42,7 @@ static __global__ void texture2dCopyKernel(hipTextureObject_t texObj, TYPE_t* ds * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_hipTexObjPitch_texture2D", "", char, unsigned char, short, unsigned short, +TEMPLATE_TEST_CASE(Unit_hipTexObjPitch_texture2D, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT (void)hipGetLastError(); // Prevent negative tests affecting this diff --git a/catch/unit/texture/hipTexObjectCreate.cc b/catch/unit/texture/hipTexObjectCreate.cc index c8271e4f3..09cc1cc3f 100644 --- a/catch/unit/texture/hipTexObjectCreate.cc +++ b/catch/unit/texture/hipTexObjectCreate.cc @@ -1,27 +1,14 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #define N 256 -TEST_CASE("Unit_TexObjectCreate_NullptrParams") { +TEST_CASE(Unit_TexObjectCreate_NullptrParams) { CHECK_IMAGE_SUPPORT CTX_CREATE(); @@ -48,7 +35,7 @@ TEST_CASE("Unit_TexObjectCreate_NullptrParams") { CTX_DESTROY(); } -TEST_CASE("Unit_TexObjectCreate_TypeLinear") { +TEST_CASE(Unit_TexObjectCreate_TypeLinear) { CHECK_IMAGE_SUPPORT CTX_CREATE(); @@ -86,7 +73,7 @@ TEST_CASE("Unit_TexObjectCreate_TypeLinear") { CTX_DESTROY(); } -TEST_CASE("Unit_TexObjectCreate_TypeLinear_IncompleteInit") { +TEST_CASE(Unit_TexObjectCreate_TypeLinear_IncompleteInit) { CHECK_IMAGE_SUPPORT CTX_CREATE(); @@ -159,7 +146,7 @@ TEST_CASE("Unit_TexObjectCreate_TypeLinear_IncompleteInit") { CTX_DESTROY(); } -TEST_CASE("Unit_TexObjectCreate_TypeLinear_EdgeCases") { +TEST_CASE(Unit_TexObjectCreate_TypeLinear_EdgeCases) { CHECK_IMAGE_SUPPORT CTX_CREATE(); @@ -200,7 +187,7 @@ TEST_CASE("Unit_TexObjectCreate_TypeLinear_EdgeCases") { CTX_DESTROY(); } -TEST_CASE("Unit_TexObjectCreate_TypeArray") { +TEST_CASE(Unit_TexObjectCreate_TypeArray) { CHECK_IMAGE_SUPPORT CTX_CREATE(); @@ -227,7 +214,7 @@ TEST_CASE("Unit_TexObjectCreate_TypeArray") { CTX_DESTROY(); } -TEST_CASE("Unit_TexObjectCreate_TypeArray_NullptrArray") { +TEST_CASE(Unit_TexObjectCreate_TypeArray_NullptrArray) { CHECK_IMAGE_SUPPORT CTX_CREATE(); @@ -245,7 +232,7 @@ TEST_CASE("Unit_TexObjectCreate_TypeArray_NullptrArray") { } #if 0 -TEST_CASE("Unit_TexObjectCreate_TypeMipmapped") { +TEST_CASE(Unit_TexObjectCreate_TypeMipmapped) { CHECK_IMAGE_SUPPORT hipMipmappedArray_t mipmapped_array; @@ -272,7 +259,7 @@ TEST_CASE("Unit_TexObjectCreate_TypeMipmapped") { HIP_CHECK(hipFreeMipmappedArray(mipmapped_array)); } -TEST_CASE("Unit_TexObjectCreate_TypeMipmaped_IncompleteInit") { +TEST_CASE(Unit_TexObjectCreate_TypeMipmaped_IncompleteInit) { CHECK_IMAGE_SUPPORT CTX_CREATE(); @@ -306,7 +293,7 @@ TEST_CASE("Unit_TexObjectCreate_TypeMipmaped_IncompleteInit") { } #endif -TEST_CASE("Unit_TexObjectCreate_TypePitch2D") { +TEST_CASE(Unit_TexObjectCreate_TypePitch2D) { CHECK_IMAGE_SUPPORT CTX_CREATE(); @@ -349,7 +336,7 @@ TEST_CASE("Unit_TexObjectCreate_TypePitch2D") { CTX_DESTROY(); } -TEST_CASE("Unit_TexObjectCreate_TypePitch2D_IncompleteInit") { +TEST_CASE(Unit_TexObjectCreate_TypePitch2D_IncompleteInit) { CHECK_IMAGE_SUPPORT CTX_CREATE(); @@ -415,7 +402,7 @@ TEST_CASE("Unit_TexObjectCreate_TypePitch2D_IncompleteInit") { CTX_DESTROY(); } -TEST_CASE("Unit_TexObjectCreate_TypePitch2D_EdgeCases") { +TEST_CASE(Unit_TexObjectCreate_TypePitch2D_EdgeCases) { CHECK_IMAGE_SUPPORT CTX_CREATE(); diff --git a/catch/unit/texture/hipTexObjectTests.cc b/catch/unit/texture/hipTexObjectTests.cc index 3c22d6cbb..6c0d28304 100644 --- a/catch/unit/texture/hipTexObjectTests.cc +++ b/catch/unit/texture/hipTexObjectTests.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -115,7 +102,7 @@ class TexObjectTestWrapper { * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetTexObjectResourceDesc_positive") { +TEST_CASE(Unit_hipGetTexObjectResourceDesc_positive) { CHECK_IMAGE_SUPPORT; CTX_CREATE(); @@ -148,7 +135,7 @@ TEST_CASE("Unit_hipGetTexObjectResourceDesc_positive") { * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetTexObjectResourceDesc_Negative_Parameters") { +TEST_CASE(Unit_hipGetTexObjectResourceDesc_Negative_Parameters) { CHECK_IMAGE_SUPPORT; CTX_CREATE(); @@ -200,7 +187,7 @@ TEST_CASE("Unit_hipGetTexObjectResourceDesc_Negative_Parameters") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetTexObjectResourceViewDesc_positive") { +TEST_CASE(Unit_hipGetTexObjectResourceViewDesc_positive) { CHECK_IMAGE_SUPPORT; CTX_CREATE(); TexObjectTestWrapper* tex_obj_wrapper = new TexObjectTestWrapper(true); @@ -233,7 +220,7 @@ TEST_CASE("Unit_hipGetTexObjectResourceViewDesc_positive") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetTexObjectResourceViewDesc_Negative_Parameters") { +TEST_CASE(Unit_hipGetTexObjectResourceViewDesc_Negative_Parameters) { CHECK_IMAGE_SUPPORT; CTX_CREATE(); TexObjectTestWrapper* tex_obj_wrapper = new TexObjectTestWrapper(true); @@ -285,7 +272,7 @@ TEST_CASE("Unit_hipGetTexObjectResourceViewDesc_Negative_Parameters") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetTexObjectTextureDesc_positive") { +TEST_CASE(Unit_hipGetTexObjectTextureDesc_positive) { CHECK_IMAGE_SUPPORT; CTX_CREATE(); @@ -319,7 +306,7 @@ TEST_CASE("Unit_hipGetTexObjectTextureDesc_positive") { * - Platform specific (AMD) * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetTexObjectTextureDesc_Negative_Parameters") { +TEST_CASE(Unit_hipGetTexObjectTextureDesc_Negative_Parameters) { CHECK_IMAGE_SUPPORT; CTX_CREATE(); @@ -367,7 +354,7 @@ TEST_CASE("Unit_hipGetTexObjectTextureDesc_Negative_Parameters") { * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipTexObjectDestroy_positive") { +TEST_CASE(Unit_hipTexObjectDestroy_positive) { CHECK_IMAGE_SUPPORT; CTX_CREATE(); diff --git a/catch/unit/texture/hipTexRefGetAddress.cc b/catch/unit/texture/hipTexRefGetAddress.cc index 68261ffbd..5331e12db 100644 --- a/catch/unit/texture/hipTexRefGetAddress.cc +++ b/catch/unit/texture/hipTexRefGetAddress.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -26,7 +10,7 @@ THE SOFTWARE. texture tex; -TEST_CASE("Unit_hipTexRefGetAddress_Positive") { +TEST_CASE(Unit_hipTexRefGetAddress_Positive) { CHECK_IMAGE_SUPPORT hipDeviceptr_t device_ptr; hipModule_t module = nullptr; @@ -47,7 +31,7 @@ TEST_CASE("Unit_hipTexRefGetAddress_Positive") { HIP_CHECK(hipFree(tex_buffer)); } -TEST_CASE("Unit_hipTexRefGetAddress_Negative") { +TEST_CASE(Unit_hipTexRefGetAddress_Negative) { CHECK_IMAGE_SUPPORT hipDeviceptr_t device_ptr; hipModule_t module = nullptr; @@ -74,7 +58,7 @@ TEST_CASE("Unit_hipTexRefGetAddress_Negative") { HIP_CHECK(hipFree(tex_buffer)); } -TEST_CASE("Unit_hipTexRefGetAddress_AdressNotSet") { +TEST_CASE(Unit_hipTexRefGetAddress_AdressNotSet) { CHECK_IMAGE_SUPPORT hipDeviceptr_t device_ptr; hipModule_t module = nullptr; diff --git a/catch/unit/texture/hipTexRefGetAddressMode.cc b/catch/unit/texture/hipTexRefGetAddressMode.cc index 093cfe025..615fb96cd 100644 --- a/catch/unit/texture/hipTexRefGetAddressMode.cc +++ b/catch/unit/texture/hipTexRefGetAddressMode.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -23,7 +10,7 @@ THE SOFTWARE. #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 -TEST_CASE("Unit_hipTexRefGetAddressMode_Negative_Parameters") { +TEST_CASE(Unit_hipTexRefGetAddressMode_Negative_Parameters) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; @@ -67,7 +54,7 @@ TEST_CASE("Unit_hipTexRefGetAddressMode_Negative_Parameters") { HIP_CHECK(hipCtxDestroy(ctx)); } -TEST_CASE("Unit_hipTexRefGetAddressMode_Positive") { +TEST_CASE(Unit_hipTexRefGetAddressMode_Positive) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; diff --git a/catch/unit/texture/hipTexRefGetArray.cc b/catch/unit/texture/hipTexRefGetArray.cc index d07c8af12..6178ff409 100644 --- a/catch/unit/texture/hipTexRefGetArray.cc +++ b/catch/unit/texture/hipTexRefGetArray.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -23,7 +10,7 @@ THE SOFTWARE. texture tex; -TEST_CASE("Unit_hipTexRefGetArray_Positive") { +TEST_CASE(Unit_hipTexRefGetArray_Positive) { CHECK_IMAGE_SUPPORT hipArray_t array_set = nullptr; hipArray_t array_get = nullptr; @@ -47,7 +34,7 @@ TEST_CASE("Unit_hipTexRefGetArray_Positive") { HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipTexRefGetArray_Negative") { +TEST_CASE(Unit_hipTexRefGetArray_Negative) { CHECK_IMAGE_SUPPORT hipArray_t array_set = nullptr; hipArray_t array_get = nullptr; diff --git a/catch/unit/texture/hipTexRefGetBorderColor.cc b/catch/unit/texture/hipTexRefGetBorderColor.cc index 7bffd6080..abdee654c 100644 --- a/catch/unit/texture/hipTexRefGetBorderColor.cc +++ b/catch/unit/texture/hipTexRefGetBorderColor.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -26,7 +13,7 @@ texture tex; // It will be added for HIP in ROCm7.0 #if HT_NVIDIA -TEST_CASE("Unit_hipTexRefGetBorderColor_Positive") { +TEST_CASE(Unit_hipTexRefGetBorderColor_Positive) { CHECK_IMAGE_SUPPORT float set_border_color[3] = {1, 2, 3}; float get_border_color[3] = {0, 0, 0}; @@ -47,7 +34,7 @@ TEST_CASE("Unit_hipTexRefGetBorderColor_Positive") { } #endif -TEST_CASE("Unit_hipTexRefGetBorderColor_Negative") { +TEST_CASE(Unit_hipTexRefGetBorderColor_Negative) { CHECK_IMAGE_SUPPORT float border_color[3] = {0, 0, 0}; hipModule_t module = nullptr; diff --git a/catch/unit/texture/hipTexRefGetFlags.cc b/catch/unit/texture/hipTexRefGetFlags.cc index 18ff1898e..d88041503 100644 --- a/catch/unit/texture/hipTexRefGetFlags.cc +++ b/catch/unit/texture/hipTexRefGetFlags.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -23,7 +10,7 @@ THE SOFTWARE. #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 -TEST_CASE("Unit_hipTexRefGetFlags_Negative_Parameters") { +TEST_CASE(Unit_hipTexRefGetFlags_Negative_Parameters) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; @@ -55,7 +42,7 @@ TEST_CASE("Unit_hipTexRefGetFlags_Negative_Parameters") { HIP_CHECK(hipCtxDestroy(ctx)); } -TEST_CASE("Unit_hipTexRefGetFlags_Positive") { +TEST_CASE(Unit_hipTexRefGetFlags_Positive) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; diff --git a/catch/unit/texture/hipTexRefGetFormat.cc b/catch/unit/texture/hipTexRefGetFormat.cc index 5d405f39c..3579647c1 100644 --- a/catch/unit/texture/hipTexRefGetFormat.cc +++ b/catch/unit/texture/hipTexRefGetFormat.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -23,7 +10,7 @@ THE SOFTWARE. texture tex; -TEST_CASE("Unit_hipTexRefGetFormat_Basic") { +TEST_CASE(Unit_hipTexRefGetFormat_Basic) { CHECK_IMAGE_SUPPORT hipModule_t module = nullptr; hipTexRef tex_ref = nullptr; @@ -44,7 +31,7 @@ TEST_CASE("Unit_hipTexRefGetFormat_Basic") { HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipTexRefGetFormat_Positive") { +TEST_CASE(Unit_hipTexRefGetFormat_Positive) { CHECK_IMAGE_SUPPORT hipModule_t module = nullptr; hipTexRef tex_ref = nullptr; @@ -75,7 +62,7 @@ TEST_CASE("Unit_hipTexRefGetFormat_Positive") { HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipTexRefGetFormat_Negative") { +TEST_CASE(Unit_hipTexRefGetFormat_Negative) { CHECK_IMAGE_SUPPORT hipModule_t module = nullptr; hipTexRef tex_ref = nullptr; diff --git a/catch/unit/texture/hipTexRefGetMaxAnisotropy.cc b/catch/unit/texture/hipTexRefGetMaxAnisotropy.cc index c01ebfc27..6ec78fa43 100644 --- a/catch/unit/texture/hipTexRefGetMaxAnisotropy.cc +++ b/catch/unit/texture/hipTexRefGetMaxAnisotropy.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -23,7 +10,7 @@ THE SOFTWARE. #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 -TEST_CASE("Unit_hipTexRefGetMaxAnisotropy_Negative_Parameters") { +TEST_CASE(Unit_hipTexRefGetMaxAnisotropy_Negative_Parameters) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; @@ -56,7 +43,7 @@ TEST_CASE("Unit_hipTexRefGetMaxAnisotropy_Negative_Parameters") { HIP_CHECK(hipCtxDestroy(ctx)); } -TEST_CASE("Unit_hipTexRefGetMaxAnisotropy_Positive") { +TEST_CASE(Unit_hipTexRefGetMaxAnisotropy_Positive) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; diff --git a/catch/unit/texture/hipTexRefSetAddress.cc b/catch/unit/texture/hipTexRefSetAddress.cc index 8d3a3caa1..f013064d5 100644 --- a/catch/unit/texture/hipTexRefSetAddress.cc +++ b/catch/unit/texture/hipTexRefSetAddress.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -26,7 +10,7 @@ THE SOFTWARE. texture tex; -TEST_CASE("Unit_hipTexRefSetAddress_Basic") { +TEST_CASE(Unit_hipTexRefSetAddress_Basic) { CHECK_IMAGE_SUPPORT hipDeviceptr_t device_ptr; hipModule_t module = nullptr; @@ -47,7 +31,7 @@ TEST_CASE("Unit_hipTexRefSetAddress_Basic") { HIP_CHECK(hipFree(tex_buffer)); } -TEST_CASE("Unit_hipTexRefSetAddress_Positive") { +TEST_CASE(Unit_hipTexRefSetAddress_Positive) { CHECK_IMAGE_SUPPORT hipModule_t module = nullptr; hipTexRef tex_ref = nullptr; @@ -73,7 +57,7 @@ TEST_CASE("Unit_hipTexRefSetAddress_Positive") { HIP_CHECK(hipFree(tex_buffer)); } -TEST_CASE("Unit_hipTexRefSetAddress_Negative") { +TEST_CASE(Unit_hipTexRefSetAddress_Negative) { CHECK_IMAGE_SUPPORT hipModule_t module = nullptr; hipTexRef tex_ref = nullptr; diff --git a/catch/unit/texture/hipTexRefSetAddress2D.cc b/catch/unit/texture/hipTexRefSetAddress2D.cc index b5db9e1b2..17464d891 100644 --- a/catch/unit/texture/hipTexRefSetAddress2D.cc +++ b/catch/unit/texture/hipTexRefSetAddress2D.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -23,7 +10,7 @@ THE SOFTWARE. #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 -TEST_CASE("Unit_hipTexRefSetAddress2D_Negative_Parameters") { +TEST_CASE(Unit_hipTexRefSetAddress2D_Negative_Parameters) { CHECK_IMAGE_SUPPORT constexpr int width = 256; @@ -79,7 +66,7 @@ TEST_CASE("Unit_hipTexRefSetAddress2D_Negative_Parameters") { HIP_CHECK(hipCtxDestroy(ctx)); } -TEST_CASE("Unit_hipTexRefSetAddress2D_Positive") { +TEST_CASE(Unit_hipTexRefSetAddress2D_Positive) { CHECK_IMAGE_SUPPORT constexpr int width = 256; diff --git a/catch/unit/texture/hipTexRefSetAddressMode.cc b/catch/unit/texture/hipTexRefSetAddressMode.cc index 0b362cbcc..461038f41 100644 --- a/catch/unit/texture/hipTexRefSetAddressMode.cc +++ b/catch/unit/texture/hipTexRefSetAddressMode.cc @@ -1,28 +1,15 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 -TEST_CASE("Unit_hipTexRefSetAddressMode_Negative_Parameters") { +TEST_CASE(Unit_hipTexRefSetAddressMode_Negative_Parameters) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; @@ -60,7 +47,7 @@ TEST_CASE("Unit_hipTexRefSetAddressMode_Negative_Parameters") { HIP_CHECK(hipCtxDestroy(ctx)); } -TEST_CASE("Unit_hipTexRefSetAddressMode_Positive") { +TEST_CASE(Unit_hipTexRefSetAddressMode_Positive) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; diff --git a/catch/unit/texture/hipTexRefSetArray.cc b/catch/unit/texture/hipTexRefSetArray.cc index 9fcbdb7d6..84560a529 100644 --- a/catch/unit/texture/hipTexRefSetArray.cc +++ b/catch/unit/texture/hipTexRefSetArray.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -23,7 +10,7 @@ THE SOFTWARE. texture tex; -TEST_CASE("Unit_hipTexRefSetArray_Positive") { +TEST_CASE(Unit_hipTexRefSetArray_Positive) { CHECK_IMAGE_SUPPORT hipArray_t array_set = nullptr; hipArray_t array_get = nullptr; @@ -47,7 +34,7 @@ TEST_CASE("Unit_hipTexRefSetArray_Positive") { HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipTexRefSetArray_CheckData") { +TEST_CASE(Unit_hipTexRefSetArray_CheckData) { CHECK_IMAGE_SUPPORT hipModule_t module = nullptr; hipTexRef tex_ref = nullptr; @@ -76,7 +63,7 @@ TEST_CASE("Unit_hipTexRefSetArray_CheckData") { HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipTexRefSetArray_Negative") { +TEST_CASE(Unit_hipTexRefSetArray_Negative) { CHECK_IMAGE_SUPPORT hipArray_t array_set = nullptr; hipModule_t module = nullptr; diff --git a/catch/unit/texture/hipTexRefSetBorderColor.cc b/catch/unit/texture/hipTexRefSetBorderColor.cc index c14206eab..05922ef75 100644 --- a/catch/unit/texture/hipTexRefSetBorderColor.cc +++ b/catch/unit/texture/hipTexRefSetBorderColor.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -26,7 +13,7 @@ texture tex; // It will be added for HIP in ROCm7.0 #if HT_NVIDIA -TEST_CASE("Unit_hipTexRefSetBorderColor_Positive") { +TEST_CASE(Unit_hipTexRefSetBorderColor_Positive) { float set_border_color[3] = {1, 2, 3}; float get_border_color[3] = {0, 0, 0}; hipModule_t module = nullptr; @@ -46,7 +33,7 @@ TEST_CASE("Unit_hipTexRefSetBorderColor_Positive") { } #endif -TEST_CASE("Unit_hipTexRefSetBorderColor_Negative") { +TEST_CASE(Unit_hipTexRefSetBorderColor_Negative) { CHECK_IMAGE_SUPPORT float border_color[3] = {0, 0, 0}; hipModule_t module = nullptr; diff --git a/catch/unit/texture/hipTexRefSetFlags.cc b/catch/unit/texture/hipTexRefSetFlags.cc index 93a725016..005432bef 100644 --- a/catch/unit/texture/hipTexRefSetFlags.cc +++ b/catch/unit/texture/hipTexRefSetFlags.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -23,7 +10,7 @@ THE SOFTWARE. #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 -TEST_CASE("Unit_hipTexRefSetFlags_Negative_Parameters") { +TEST_CASE(Unit_hipTexRefSetFlags_Negative_Parameters) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; @@ -50,7 +37,7 @@ TEST_CASE("Unit_hipTexRefSetFlags_Negative_Parameters") { HIP_CHECK(hipCtxDestroy(ctx)); } -TEST_CASE("Unit_hipTexRefSetFlags_Positive") { +TEST_CASE(Unit_hipTexRefSetFlags_Positive) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; diff --git a/catch/unit/texture/hipTexRefSetFormat.cc b/catch/unit/texture/hipTexRefSetFormat.cc index 5b5daeda4..5ec5f05da 100644 --- a/catch/unit/texture/hipTexRefSetFormat.cc +++ b/catch/unit/texture/hipTexRefSetFormat.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -23,7 +10,7 @@ THE SOFTWARE. texture tex; -TEST_CASE("Unit_hipTexRefSetFormat_Positive") { +TEST_CASE(Unit_hipTexRefSetFormat_Positive) { CHECK_IMAGE_SUPPORT hipModule_t module = nullptr; hipTexRef tex_ref = nullptr; @@ -44,7 +31,7 @@ TEST_CASE("Unit_hipTexRefSetFormat_Positive") { HIP_CHECK(hipModuleUnload(module)); } -TEST_CASE("Unit_hipTexRefSetFormat_Negative") { +TEST_CASE(Unit_hipTexRefSetFormat_Negative) { CHECK_IMAGE_SUPPORT hipModule_t module = nullptr; hipTexRef tex_ref = nullptr; diff --git a/catch/unit/texture/hipTexRefSetGetFilterMode.cc b/catch/unit/texture/hipTexRefSetGetFilterMode.cc index b336a4df9..12c2aabe5 100644 --- a/catch/unit/texture/hipTexRefSetGetFilterMode.cc +++ b/catch/unit/texture/hipTexRefSetGetFilterMode.cc @@ -1,27 +1,14 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 texture tex; // Test for hipTexRefSetFilterMode and hipTexRefGetFilterMode, including error handling -TEST_CASE("Unit_hipTexRefSetGetFilterMode") { +TEST_CASE(Unit_hipTexRefSetGetFilterMode) { CHECK_IMAGE_SUPPORT; // Retrieve the texture reference for our symbol diff --git a/catch/unit/texture/hipTexRefSetGetMipmapFilterMode.cc b/catch/unit/texture/hipTexRefSetGetMipmapFilterMode.cc index 7e208c136..c8253639f 100644 --- a/catch/unit/texture/hipTexRefSetGetMipmapFilterMode.cc +++ b/catch/unit/texture/hipTexRefSetGetMipmapFilterMode.cc @@ -1,27 +1,14 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 texture tex; // Test for hipTexRefSetMipmapFilterMode and hipTexRefGetMipmapFilterMode, including error handling -TEST_CASE("Unit_hipTexRefSetGetMipmapFilterMode") { +TEST_CASE(Unit_hipTexRefSetGetMipmapFilterMode) { CHECK_IMAGE_SUPPORT; // Retrieve the texture reference for our symbol diff --git a/catch/unit/texture/hipTexRefSetGetMipmapLevelBias.cc b/catch/unit/texture/hipTexRefSetGetMipmapLevelBias.cc index 8476826e9..64b9261bc 100644 --- a/catch/unit/texture/hipTexRefSetGetMipmapLevelBias.cc +++ b/catch/unit/texture/hipTexRefSetGetMipmapLevelBias.cc @@ -1,27 +1,14 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 texture tex; // Test for hipTexRefSetMipmapLevelBias and hipTexRefGetMipmapLevelBias, including error handling -TEST_CASE("Unit_hipTexRefSetGetMipmapLevelBias") { +TEST_CASE(Unit_hipTexRefSetGetMipmapLevelBias) { CHECK_IMAGE_SUPPORT; // Retrieve the texture reference for our symbol diff --git a/catch/unit/texture/hipTexRefSetGetMipmapLevelClamp.cc b/catch/unit/texture/hipTexRefSetGetMipmapLevelClamp.cc index c28fbfe89..c892e6580 100644 --- a/catch/unit/texture/hipTexRefSetGetMipmapLevelClamp.cc +++ b/catch/unit/texture/hipTexRefSetGetMipmapLevelClamp.cc @@ -1,28 +1,15 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 texture tex; // Test for hipTexRefSetMipmapLevelClamp and hipTexRefGetMipmapLevelClamp, including error handling -TEST_CASE("Unit_texRefSetGetMipmapLevelClamp") { +TEST_CASE(Unit_texRefSetGetMipmapLevelClamp) { CHECK_IMAGE_SUPPORT; // Retrieve the texture reference for our symbol diff --git a/catch/unit/texture/hipTexRefSetGetMipmappedArray.cc b/catch/unit/texture/hipTexRefSetGetMipmappedArray.cc index a36212a82..29ac384c1 100644 --- a/catch/unit/texture/hipTexRefSetGetMipmappedArray.cc +++ b/catch/unit/texture/hipTexRefSetGetMipmappedArray.cc @@ -1,27 +1,15 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #include #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 texture tex; // Test for hipTexRefSetMipmappedArray and hipTexRefGetMipmappedArray, including error handling -TEST_CASE("Unit_hipTexRefSetGetMipmappedArray") { +TEST_CASE(Unit_hipTexRefSetGetMipmappedArray) { CHECK_IMAGE_SUPPORT; // Retrieve the texture reference for our symbol diff --git a/catch/unit/texture/hipTexRefSetMaxAnisotropy.cc b/catch/unit/texture/hipTexRefSetMaxAnisotropy.cc index dbd4aa5cf..6a7c8a7b9 100644 --- a/catch/unit/texture/hipTexRefSetMaxAnisotropy.cc +++ b/catch/unit/texture/hipTexRefSetMaxAnisotropy.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -23,7 +10,7 @@ THE SOFTWARE. #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 -TEST_CASE("Unit_hipTexRefSetMaxAnisotropy_Negative_Parameters") { +TEST_CASE(Unit_hipTexRefSetMaxAnisotropy_Negative_Parameters) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; @@ -52,7 +39,7 @@ TEST_CASE("Unit_hipTexRefSetMaxAnisotropy_Negative_Parameters") { HIP_CHECK(hipCtxDestroy(ctx)); } -TEST_CASE("Unit_hipTexRefSetMaxAnisotropy_Positive") { +TEST_CASE(Unit_hipTexRefSetMaxAnisotropy_Positive) { CHECK_IMAGE_SUPPORT hipCtx_t ctx; diff --git a/catch/unit/texture/hipTextureMipmapObj1D.cc b/catch/unit/texture/hipTextureMipmapObj1D.cc index 0fbd2e1a5..efe6233bd 100644 --- a/catch/unit/texture/hipTextureMipmapObj1D.cc +++ b/catch/unit/texture/hipTextureMipmapObj1D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -305,32 +292,32 @@ static void testMipmapTextureObj(size_t width, float offsetX = 0.) { * - Textures supported on device * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType", "", char, uchar, - short, ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, - float1, char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, - short4, ushort4, int4, uint4, float4) { +TEMPLATE_TEST_CASE(Unit_hipTextureMipmapObj1D_Check_hipReadModeElementType, char, uchar, short, + ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, float1, + char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, short4, + ushort4, int4, uint4, float4) { CHECK_IMAGE_SUPPORT SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeClamp 23") { testMipmapTextureObj( 23, 0.49); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeClamp 67") { testMipmapTextureObj( 67, -0.3); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeBorder 131") { testMipmapTextureObj(131, 0.15); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeBorder 263") { testMipmapTextureObj(263, 0.96); @@ -355,55 +342,55 @@ TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType", * - Textures supported on device * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat", "", char, uchar, - short, ushort, char1, uchar1, short1, ushort1, char2, uchar2, short2, ushort2, - char4, uchar4, short4, ushort4) { +TEMPLATE_TEST_CASE(Unit_hipTextureMipmapObj1D_Check_hipReadModeNormalizedFloat, char, uchar, short, + ushort, char1, uchar1, short1, ushort1, char2, uchar2, short2, ushort2, char4, + uchar4, short4, ushort4) { CHECK_IMAGE_SUPPORT SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeClamp 23") { testMipmapTextureObj(23, -0.9); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeClamp 131") { testMipmapTextureObj(131, 0.15); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeClamp 67") { testMipmapTextureObj(67, -0.3); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeClamp 263") { testMipmapTextureObj(263, 0.13); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeBorder 131") { testMipmapTextureObj(131, -0.34); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeBorder 23") { testMipmapTextureObj(23, 0.4); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeBorder 263") { testMipmapTextureObj(263, 0.96); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeBorder 67") { testMipmapTextureObj(67, -0.67); @@ -429,36 +416,36 @@ TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj1D_Check - hipReadModeNormalizedFloa * - Textures supported on device * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType float only", "", - float, float1, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipTextureMipmapObj1D_Check_hipReadModeElementType_float_only, float, + float1, float2, float4) { CHECK_IMAGE_SUPPORT SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeClamp 23, 0.") { testMipmapTextureObj(23, 0.7); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeClamp 23") { testMipmapTextureObj(23, -0.67); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeClamp 263") { testMipmapTextureObj(263, 0.13); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeBorder 131") { testMipmapTextureObj(131, 0.96); } SECTION( - "Unit_hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj1D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeBorder 67") { testMipmapTextureObj(67, -0.97); diff --git a/catch/unit/texture/hipTextureMipmapObj2D.cc b/catch/unit/texture/hipTextureMipmapObj2D.cc index 791fcd1e5..8f4a3cc7e 100644 --- a/catch/unit/texture/hipTextureMipmapObj2D.cc +++ b/catch/unit/texture/hipTextureMipmapObj2D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -338,32 +325,32 @@ static void testMipmapTextureObj(size_t width, size_t height, float offsetX = 0. * - Textures supported on device * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType", "", char, uchar, - short, ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, - float1, char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, - short4, ushort4, int4, uint4, float4) { +TEMPLATE_TEST_CASE(Unit_hipTextureMipmapObj2D_Check_hipReadModeElementType, char, uchar, short, + ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, float1, + char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, short4, + ushort4, int4, uint4, float4) { CHECK_IMAGE_SUPPORT SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeClamp 23, 21") { testMipmapTextureObj( 23, 21, 0.4, -0.9); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeClamp 67, 131") { testMipmapTextureObj( 67, 131, -0.3, -0.67); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeBorder 131, 263") { testMipmapTextureObj(131, 263, 0.15, -0.34); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeBorder 263, 67") { testMipmapTextureObj(263, 67, 0.13, 0.96); @@ -388,55 +375,55 @@ TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType", * - Textures supported on device * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat", "", char, uchar, - short, ushort, char1, uchar1, short1, ushort1, char2, uchar2, short2, ushort2, - char4, uchar4, short4, ushort4) { +TEMPLATE_TEST_CASE(Unit_hipTextureMipmapObj2D_Check_hipReadModeNormalizedFloat, char, uchar, short, + ushort, char1, uchar1, short1, ushort1, char2, uchar2, short2, ushort2, char4, + uchar4, short4, ushort4) { CHECK_IMAGE_SUPPORT SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeClamp 23, 21") { testMipmapTextureObj(23, 21, 0.4, -0.9); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeClamp 131, 263") { testMipmapTextureObj(131, 263, 0.15, -0.34); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeClamp 67, 131") { testMipmapTextureObj(23, 17, -0.3, -0.67); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeClamp 263, 67") { testMipmapTextureObj(263, 67, 0.13, 0.96); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeBorder 131, 263") { testMipmapTextureObj(131, 263, 0.15, -0.34); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeBorder 23, 21") { testMipmapTextureObj(23, 21, 0.4, -0.9); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeBorder 263, 67") { testMipmapTextureObj(263, 67, 0.13, 0.96); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeBorder 67, 131") { testMipmapTextureObj(67, 131, -0.3, -0.67); @@ -462,36 +449,36 @@ TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj2D_Check - hipReadModeNormalizedFloa * - Textures supported on device * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType float only", "", - float, float1, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipTextureMipmapObj2D_Check_hipReadModeElementType_float_only, float, + float1, float2, float4) { CHECK_IMAGE_SUPPORT SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeClamp 23, 17, 0., 0.") { testMipmapTextureObj(23, 17, 0.79, 0.37); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeClamp 23, 17") { testMipmapTextureObj(23, 17, -0.3, -0.67); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeClamp 263, 67") { testMipmapTextureObj(263, 67, 0.13, 0.96); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeBorder 263, 67") { testMipmapTextureObj(263, 67, 0.13, 0.96); } SECTION( - "Unit_hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj2D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeBorder 67, 131") { testMipmapTextureObj(67, 131, -0.3, -0.67); diff --git a/catch/unit/texture/hipTextureMipmapObj3D.cc b/catch/unit/texture/hipTextureMipmapObj3D.cc index 026472fa5..bd262e064 100644 --- a/catch/unit/texture/hipTextureMipmapObj3D.cc +++ b/catch/unit/texture/hipTextureMipmapObj3D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -360,32 +347,32 @@ static void testMipmapTextureObj(size_t width, size_t height, size_t depth, floa * - Textures supported on device * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType", "", char, uchar, - short, ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, - float1, char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, - short4, ushort4, int4, uint4, float4) { +TEMPLATE_TEST_CASE(Unit_hipTextureMipmapObj3D_Check_hipReadModeElementType, char, uchar, short, + ushort, int, uint, float, char1, uchar1, short1, ushort1, int1, uint1, float1, + char2, uchar2, short2, ushort2, int2, uint2, float2, char4, uchar4, short4, + ushort4, int4, uint4, float4) { CHECK_IMAGE_SUPPORT SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeClamp 23, 21, 47") { testMipmapTextureObj( 23, 21, 47, 0.4, -0.9, 0.77); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeClamp 67, 131, 99") { testMipmapTextureObj( 67, 131, 99, -0.3, -0.67, 0.49); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeBorder 131, 263, 31") { testMipmapTextureObj(131, 263, 31, 0.15, -0.34, 0.85); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModePoint, " + "hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModePoint, " "hipAddressModeBorder 263, 67, 17") { testMipmapTextureObj(263, 67, 17, 0.13, 0.96, -0.57); @@ -410,55 +397,55 @@ TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType", * - Textures supported on device * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat", "", char, uchar, - short, ushort, char1, uchar1, short1, ushort1, char2, uchar2, short2, ushort2, - char4, uchar4, short4, ushort4) { +TEMPLATE_TEST_CASE(Unit_hipTextureMipmapObj3D_Check_hipReadModeNormalizedFloat, char, uchar, short, + ushort, char1, uchar1, short1, ushort1, char2, uchar2, short2, ushort2, char4, + uchar4, short4, ushort4) { CHECK_IMAGE_SUPPORT SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeClamp 23, 21, 67") { testMipmapTextureObj(23, 21, 67, 0.4, -0.9, 0.37); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeClamp 131, 263, 11") { testMipmapTextureObj(131, 263, 11, 0.15, -0.34, 0.83); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeClamp 67, 131, 53") { testMipmapTextureObj(23, 17, 53, -0.3, -0.67, 0.78); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeClamp 263, 67, 37") { testMipmapTextureObj(263, 67, 37, 0.13, 0.96, -0.96); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeBorder 131, 263, 11") { testMipmapTextureObj(131, 263, 11, 0.15, -0.34, -0.11); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " + "hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModePoint, " "hipAddressModeBorder 23, 21, 201") { testMipmapTextureObj(23, 21, 201, 0.4, -0.9, 0.54); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeBorder 263, 67, 51") { testMipmapTextureObj(263, 67, 51, 0.13, 0.96, 0.77); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " + "hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloat, hipFilterModeLinear, " "hipAddressModeBorder 67, 131, 87") { testMipmapTextureObj(67, 131, 87, -0.3, -0.67, -0.29); @@ -484,36 +471,36 @@ TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj3D_Check - hipReadModeNormalizedFloa * - Textures supported on device * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType float only", "", - float, float1, float2, float4) { +TEMPLATE_TEST_CASE(Unit_hipTextureMipmapObj3D_Check_hipReadModeElementType_float_only, float, + float1, float2, float4) { CHECK_IMAGE_SUPPORT SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeClamp 23, 17, 301, 0., 0., 0.") { testMipmapTextureObj(23, 17, 301, 0.19, 0.46, -0.9); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeClamp 23, 17, 243") { testMipmapTextureObj(23, 17, 243, -0.3, -0.67, 0.65); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeClamp 263, 67, 39") { testMipmapTextureObj(263, 67, 39, 0.13, 0.96, 0.66); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeBorder 263, 67, 117") { testMipmapTextureObj(263, 67, 117, 0.13, 0.96, -0.93); } SECTION( - "Unit_hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " + "hipTextureMipmapObj3D_Check - hipReadModeElementType, hipFilterModeLinear, " "hipAddressModeBorder 67, 131, 67") { testMipmapTextureObj(67, 131, 67, -0.3, -0.67, 0.88); diff --git a/catch/unit/texture/hipTextureObj1DCheckModes.cc b/catch/unit/texture/hipTextureObj1DCheckModes.cc index 6ce557b14..da64c39f1 100644 --- a/catch/unit/texture/hipTextureObj1DCheckModes.cc +++ b/catch/unit/texture/hipTextureObj1DCheckModes.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -121,7 +108,7 @@ static void runTest(const int width, const float offsetX) { * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipTextureObj1DCheckModes") { +TEST_CASE(Unit_hipTextureObj1DCheckModes) { CHECK_IMAGE_SUPPORT SECTION("hipAddressModeClamp, hipFilterModePoint, regularCoords") { diff --git a/catch/unit/texture/hipTextureObj1DCheckSRGBModes.cc b/catch/unit/texture/hipTextureObj1DCheckSRGBModes.cc index 462fe7361..e5236c9c2 100644 --- a/catch/unit/texture/hipTextureObj1DCheckSRGBModes.cc +++ b/catch/unit/texture/hipTextureObj1DCheckSRGBModes.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -171,7 +158,7 @@ static void runTest(const int width, const float offsetX = 0) { REQUIRE(result); } -TEST_CASE("Unit_hipTextureObj1DCheckRGBAModes - array") { +TEST_CASE(Unit_hipTextureObj1DCheckRGBAModes_array) { CHECK_IMAGE_SUPPORT SECTION("RGBA 1D hipAddressModeClamp, hipFilterModePoint, hipResourceTypeArray, regularCoords") { @@ -227,7 +214,7 @@ TEST_CASE("Unit_hipTextureObj1DCheckRGBAModes - array") { } -TEST_CASE("Unit_hipTextureObj1DCheckSRGBAModes - array") { +TEST_CASE(Unit_hipTextureObj1DCheckSRGBAModes_array) { CHECK_IMAGE_SUPPORT SECTION("SRGBA 1D hipAddressModeClamp, hipFilterModePoint, hipResourceTypeArray, regularCoords") { @@ -286,7 +273,7 @@ TEST_CASE("Unit_hipTextureObj1DCheckSRGBAModes - array") { #endif } -TEST_CASE("Unit_hipTextureObj1DCheckRGBAModes - buffer") { +TEST_CASE(Unit_hipTextureObj1DCheckRGBAModes_buffer) { CHECK_IMAGE_SUPPORT SECTION("RGBA 1D hipAddressModeClamp, hipFilterModePoint, hipResourceTypeLinear, regularCoords") { @@ -299,7 +286,7 @@ TEST_CASE("Unit_hipTextureObj1DCheckRGBAModes - buffer") { } } -TEST_CASE("Unit_hipTextureObj1DCheckSRGBAModes - buffer") { +TEST_CASE(Unit_hipTextureObj1DCheckSRGBAModes_buffer) { CHECK_IMAGE_SUPPORT SECTION( diff --git a/catch/unit/texture/hipTextureObj1DFetch.cc b/catch/unit/texture/hipTextureObj1DFetch.cc index 90b472e27..09db35e06 100644 --- a/catch/unit/texture/hipTextureObj1DFetch.cc +++ b/catch/unit/texture/hipTextureObj1DFetch.cc @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -32,7 +19,7 @@ static __global__ void tex1dKernel(float* val, hipTextureObject_t obj) { } -TEST_CASE("Unit_hipCreateTextureObject_tex1DfetchVerification") { +TEST_CASE(Unit_hipCreateTextureObject_tex1DfetchVerification) { CHECK_IMAGE_SUPPORT (void) hipGetLastError(); // Prevent negative tests affecting this diff --git a/catch/unit/texture/hipTextureObj2D.cc b/catch/unit/texture/hipTextureObj2D.cc index 3dd0b07cb..dd4daa009 100644 --- a/catch/unit/texture/hipTextureObj2D.cc +++ b/catch/unit/texture/hipTextureObj2D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -46,7 +33,7 @@ __global__ void tex2DKernel(float* outputData, hipTextureObject_t textureObject, * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipTextureObj2D_Check") { +TEST_CASE(Unit_hipTextureObj2D_Check) { CHECK_IMAGE_SUPPORT constexpr int SIZE = 256; diff --git a/catch/unit/texture/hipTextureObj2DCheckModes.cc b/catch/unit/texture/hipTextureObj2DCheckModes.cc index e9131cb76..815e945be 100644 --- a/catch/unit/texture/hipTextureObj2DCheckModes.cc +++ b/catch/unit/texture/hipTextureObj2DCheckModes.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -131,7 +118,7 @@ static void runTest(const int width, const int height, const float offsetX, cons * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipTextureObj2DCheckModes") { +TEST_CASE(Unit_hipTextureObj2DCheckModes) { CHECK_IMAGE_SUPPORT SECTION("hipAddressModeClamp, hipFilterModePoint, regularCoords") { diff --git a/catch/unit/texture/hipTextureObj2DCheckSRGBModes.cc b/catch/unit/texture/hipTextureObj2DCheckSRGBModes.cc index 1fdca3bd5..2594d0b71 100644 --- a/catch/unit/texture/hipTextureObj2DCheckSRGBModes.cc +++ b/catch/unit/texture/hipTextureObj2DCheckSRGBModes.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -152,7 +139,7 @@ static void runTest(const int width, const int height, const float offsetX, cons REQUIRE(result); } -TEST_CASE("Unit_hipTextureObj2DCheckRGBAModes") { +TEST_CASE(Unit_hipTextureObj2DCheckRGBAModes) { CHECK_IMAGE_SUPPORT (void) hipGetLastError(); // Prevent negative tests affecting this @@ -198,7 +185,7 @@ TEST_CASE("Unit_hipTextureObj2DCheckRGBAModes") { } -TEST_CASE("Unit_hipTextureObj2DCheckSRGBAModes") { +TEST_CASE(Unit_hipTextureObj2DCheckSRGBAModes) { CHECK_IMAGE_SUPPORT SECTION("SRGBA 2D hipAddressModeClamp, hipFilterModePoint, regularCoords") { diff --git a/catch/unit/texture/hipTextureObj3DCheckModes.cc b/catch/unit/texture/hipTextureObj3DCheckModes.cc index cd39026e8..6e2c8a6c8 100644 --- a/catch/unit/texture/hipTextureObj3DCheckModes.cc +++ b/catch/unit/texture/hipTextureObj3DCheckModes.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -170,7 +157,7 @@ static void runTest(const int width, const int height, const int depth, const fl * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipTextureObj3DCheckModes") { +TEST_CASE(Unit_hipTextureObj3DCheckModes) { CHECK_IMAGE_SUPPORT int device = 0; diff --git a/catch/unit/texture/hipTextureObjFetchVector.cc b/catch/unit/texture/hipTextureObjFetchVector.cc index de153ecc9..67a0f3df5 100644 --- a/catch/unit/texture/hipTextureObjFetchVector.cc +++ b/catch/unit/texture/hipTextureObjFetchVector.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -128,7 +115,7 @@ template bool runTest() { return testResult; } -TEST_CASE("Unit_hipTextureFetch_vector") { +TEST_CASE(Unit_hipTextureFetch_vector) { CHECK_IMAGE_SUPPORT // test for char diff --git a/catch/unit/texture/hipTextureObjectTests.cc b/catch/unit/texture/hipTextureObjectTests.cc index 9d4fa748f..1a088ff2e 100644 --- a/catch/unit/texture/hipTextureObjectTests.cc +++ b/catch/unit/texture/hipTextureObjectTests.cc @@ -1,21 +1,8 @@ /* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -112,7 +99,7 @@ class TextureObjectTestWrapper { * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetTextureObjectResourceDesc_positive") { +TEST_CASE(Unit_hipGetTextureObjectResourceDesc_positive) { CHECK_IMAGE_SUPPORT; TextureObjectTestWrapper tex_obj_wrapper(false); @@ -142,7 +129,7 @@ TEST_CASE("Unit_hipGetTextureObjectResourceDesc_positive") { * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipGetTextureObjectResourceDesc_Negative_Parameters") { +TEST_CASE(Unit_hipGetTextureObjectResourceDesc_Negative_Parameters) { CHECK_IMAGE_SUPPORT; TextureObjectTestWrapper tex_obj_wrapper(false); @@ -192,7 +179,7 @@ TEST_CASE("Unit_hipGetTextureObjectResourceDesc_Negative_Parameters") { * - HIP_VERSION >= 5.2 */ #if HT_AMD -TEST_CASE("Unit_hipGetTextureObjectResourceViewDesc_positive") { +TEST_CASE(Unit_hipGetTextureObjectResourceViewDesc_positive) { CHECK_IMAGE_SUPPORT; TextureObjectTestWrapper tex_obj_wrapper(true); @@ -225,7 +212,7 @@ TEST_CASE("Unit_hipGetTextureObjectResourceViewDesc_positive") { * - HIP_VERSION >= 5.2 */ #if HT_AMD -TEST_CASE("Unit_hipGetTextureObjectResourceViewDesc_Negative_Parameters") { +TEST_CASE(Unit_hipGetTextureObjectResourceViewDesc_Negative_Parameters) { CHECK_IMAGE_SUPPORT; TextureObjectTestWrapper tex_obj_wrapper(true); @@ -276,7 +263,7 @@ TEST_CASE("Unit_hipGetTextureObjectResourceViewDesc_Negative_Parameters") { * - HIP_VERSION >= 5.2 */ #if HT_AMD -TEST_CASE("Unit_hipGetTextureObjectTextureDesc_positive") { +TEST_CASE(Unit_hipGetTextureObjectTextureDesc_positive) { CHECK_IMAGE_SUPPORT; TextureObjectTestWrapper tex_obj_wrapper(false); @@ -311,7 +298,7 @@ TEST_CASE("Unit_hipGetTextureObjectTextureDesc_positive") { * - HIP_VERSION >= 5.2 */ #if HT_AMD -TEST_CASE("Unit_hipGetTextureObjectTextureDesc_Negative_Parameters") { +TEST_CASE(Unit_hipGetTextureObjectTextureDesc_Negative_Parameters) { CHECK_IMAGE_SUPPORT; TextureObjectTestWrapper tex_obj_wrapper(false); @@ -359,7 +346,7 @@ TEST_CASE("Unit_hipGetTextureObjectTextureDesc_Negative_Parameters") { * - Textures supported on device * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_hipDestroyTextureObject_positive") { +TEST_CASE(Unit_hipDestroyTextureObject_positive) { CHECK_IMAGE_SUPPORT; TextureObjectTestWrapper tex_obj_wrapper(false, true); diff --git a/catch/unit/texture/hipTextureRef2D.cc b/catch/unit/texture/hipTextureRef2D.cc index db778bbc0..b2b595097 100644 --- a/catch/unit/texture/hipTextureRef2D.cc +++ b/catch/unit/texture/hipTextureRef2D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" #include @@ -33,7 +20,7 @@ __global__ void tex2DKernel(float* outputData, int width) { #endif } -TEST_CASE("Unit_hipTextureRef2D_Check") { +TEST_CASE(Unit_hipTextureRef2D_Check) { CHECK_IMAGE_SUPPORT constexpr int SIZE = 256; diff --git a/catch/unit/texture/hipUnbindTexture.cc b/catch/unit/texture/hipUnbindTexture.cc index a342638af..cacf93d32 100644 --- a/catch/unit/texture/hipUnbindTexture.cc +++ b/catch/unit/texture/hipUnbindTexture.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma clang diagnostic ignored "-Wunused-parameter" @@ -28,7 +15,7 @@ texture tex_1D; texture tex_2D; texture tex_3D; -TEST_CASE("Unit_hipUnbindTexture_Null_Texture") { +TEST_CASE(Unit_hipUnbindTexture_Null_Texture) { #if HT_AMD HIP_CHECK_ERROR(hipUnbindTexture(nullptr), hipErrorInvalidValue); #else @@ -37,7 +24,7 @@ TEST_CASE("Unit_hipUnbindTexture_Null_Texture") { #endif } -TEST_CASE("Unit_hipUnbindTexture_Positive_1D") { +TEST_CASE(Unit_hipUnbindTexture_Positive_1D) { CHECK_IMAGE_SUPPORT constexpr int size = 1024; @@ -63,7 +50,7 @@ TEST_CASE("Unit_hipUnbindTexture_Positive_1D") { HIP_CHECK(hipFree(tex_buffer)); } -TEST_CASE("Unit_hipUnbindTexture_Positive_2D") { +TEST_CASE(Unit_hipUnbindTexture_Positive_2D) { CHECK_IMAGE_SUPPORT constexpr int width = 1024; @@ -85,7 +72,7 @@ TEST_CASE("Unit_hipUnbindTexture_Positive_2D") { HIP_CHECK(hipFree(dev_ptr)); } -TEST_CASE("Unit_hipUnbindTexture_Positive_3D") { +TEST_CASE(Unit_hipUnbindTexture_Positive_3D) { CHECK_IMAGE_SUPPORT constexpr unsigned int width = 256; diff --git a/catch/unit/texture/kernels.hh b/catch/unit/texture/kernels.hh index f9718d45f..7620276a4 100644 --- a/catch/unit/texture/kernels.hh +++ b/catch/unit/texture/kernels.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #pragma clang diagnostic ignored "-Wunused-parameter" diff --git a/catch/unit/texture/test_fixture.hh b/catch/unit/texture/test_fixture.hh index b61fe4056..b504474b6 100644 --- a/catch/unit/texture/test_fixture.hh +++ b/catch/unit/texture/test_fixture.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/texture/tex1D.cc b/catch/unit/texture/tex1D.cc index 527ce8474..6a24e8918 100644 --- a/catch/unit/texture/tex1D.cc +++ b/catch/unit/texture/tex1D.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex1D_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex1D_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -98,7 +82,7 @@ TEMPLATE_TEST_CASE("Unit_tex1D_Positive_ReadModeElementType", "", char, unsigned * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex1D_Positive_ReadModeNormalizedFloat", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex1D_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex1DGrad.cc b/catch/unit/texture/tex1DGrad.cc index 0d7400b93..54422d393 100644 --- a/catch/unit/texture/tex1DGrad.cc +++ b/catch/unit/texture/tex1DGrad.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex1DGrad_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex1DGrad_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -98,7 +82,7 @@ TEMPLATE_TEST_CASE("Unit_tex1DGrad_Positive_ReadModeElementType", "", char, unsi * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex1DGrad_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex1DGrad_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex1DLayered.cc b/catch/unit/texture/tex1DLayered.cc index d2b7a1f4a..2d2233e53 100644 --- a/catch/unit/texture/tex1DLayered.cc +++ b/catch/unit/texture/tex1DLayered.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex1DLayered_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex1DLayered_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -103,7 +87,7 @@ TEMPLATE_TEST_CASE("Unit_tex1DLayered_Positive_ReadModeElementType", "", char, u * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex1DLayered_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex1DLayered_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex1DLayeredGrad.cc b/catch/unit/texture/tex1DLayeredGrad.cc index d6155f0ed..0504c0813 100644 --- a/catch/unit/texture/tex1DLayeredGrad.cc +++ b/catch/unit/texture/tex1DLayeredGrad.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex1DLayeredGrad_Positive_ReadModeElementType", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex1DLayeredGrad_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -103,7 +87,7 @@ TEMPLATE_TEST_CASE("Unit_tex1DLayeredGrad_Positive_ReadModeElementType", "", cha * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex1DLayeredGrad_Positive_ReadModeNormalizedFloat", "", char, +TEMPLATE_TEST_CASE(Unit_tex1DLayeredGrad_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex1DLayeredLod.cc b/catch/unit/texture/tex1DLayeredLod.cc index 5d58da3e8..cc41bb4e8 100644 --- a/catch/unit/texture/tex1DLayeredLod.cc +++ b/catch/unit/texture/tex1DLayeredLod.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex1DLayeredLod_Positive_ReadModeElementType", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex1DLayeredLod_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -103,7 +87,7 @@ TEMPLATE_TEST_CASE("Unit_tex1DLayeredLod_Positive_ReadModeElementType", "", char * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex1DLayeredLod_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex1DLayeredLod_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex1DLod.cc b/catch/unit/texture/tex1DLod.cc index 8e2bf84ea..a4ee5780b 100644 --- a/catch/unit/texture/tex1DLod.cc +++ b/catch/unit/texture/tex1DLod.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex1DLod_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex1DLod_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -98,7 +82,7 @@ TEMPLATE_TEST_CASE("Unit_tex1DLod_Positive_ReadModeElementType", "", char, unsig * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex1DLod_Positive_ReadModeNormalizedFloat", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex1DLod_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex1Dfetch.cc b/catch/unit/texture/tex1Dfetch.cc index 15fe43ef8..495447eac 100644 --- a/catch/unit/texture/tex1Dfetch.cc +++ b/catch/unit/texture/tex1Dfetch.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -46,7 +30,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex1Dfetch_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex1Dfetch_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -108,7 +92,7 @@ TEMPLATE_TEST_CASE("Unit_tex1Dfetch_Positive_ReadModeElementType", "", char, uns * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex1Dfetch_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex1Dfetch_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex2D.cc b/catch/unit/texture/tex2D.cc index bb1ecb547..142220a21 100644 --- a/catch/unit/texture/tex2D.cc +++ b/catch/unit/texture/tex2D.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex2D_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex2D_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; (void) hipGetLastError(); // Prevent negative tests affecting this @@ -116,7 +100,7 @@ TEMPLATE_TEST_CASE("Unit_tex2D_Positive_ReadModeElementType", "", char, unsigned * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex2D_Positive_ReadModeNormalizedFloat", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex2D_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex2DGrad.cc b/catch/unit/texture/tex2DGrad.cc index 80b8def7b..a2fd9fbc1 100644 --- a/catch/unit/texture/tex2DGrad.cc +++ b/catch/unit/texture/tex2DGrad.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex2DGrad_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex2DGrad_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -116,7 +100,7 @@ TEMPLATE_TEST_CASE("Unit_tex2DGrad_Positive_ReadModeElementType", "", char, unsi * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex2DGrad_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex2DGrad_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex2DLayered.cc b/catch/unit/texture/tex2DLayered.cc index a20fd647d..b0f3812c3 100644 --- a/catch/unit/texture/tex2DLayered.cc +++ b/catch/unit/texture/tex2DLayered.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex2DLayered_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex2DLayered_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -120,7 +104,7 @@ TEMPLATE_TEST_CASE("Unit_tex2DLayered_Positive_ReadModeElementType", "", char, u * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex2DLayered_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex2DLayered_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex2DLayeredGrad.cc b/catch/unit/texture/tex2DLayeredGrad.cc index 9094eba9f..972ef17d1 100644 --- a/catch/unit/texture/tex2DLayeredGrad.cc +++ b/catch/unit/texture/tex2DLayeredGrad.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex2DLayeredGrad_Positive_ReadModeElementType", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex2DLayeredGrad_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -120,7 +104,7 @@ TEMPLATE_TEST_CASE("Unit_tex2DLayeredGrad_Positive_ReadModeElementType", "", cha * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex2DLayeredGrad_Positive_ReadModeNormalizedFloat", "", char, +TEMPLATE_TEST_CASE(Unit_tex2DLayeredGrad_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex2DLayeredLod.cc b/catch/unit/texture/tex2DLayeredLod.cc index 7482359e6..00edc65f8 100644 --- a/catch/unit/texture/tex2DLayeredLod.cc +++ b/catch/unit/texture/tex2DLayeredLod.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex2DLayeredLod_Positive_ReadModeElementType", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex2DLayeredLod_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -120,7 +104,7 @@ TEMPLATE_TEST_CASE("Unit_tex2DLayeredLod_Positive_ReadModeElementType", "", char * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex2DLayeredLod_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex2DLayeredLod_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex2DLod.cc b/catch/unit/texture/tex2DLod.cc index 9b1880b63..4c317695d 100644 --- a/catch/unit/texture/tex2DLod.cc +++ b/catch/unit/texture/tex2DLod.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex2DLod_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex2DLod_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -116,7 +100,7 @@ TEMPLATE_TEST_CASE("Unit_tex2DLod_Positive_ReadModeElementType", "", char, unsig * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex2DLod_Positive_ReadModeNormalizedFloat", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex2DLod_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex2Dgather.cc b/catch/unit/texture/tex2Dgather.cc index 050a0a75b..153d2d772 100644 --- a/catch/unit/texture/tex2Dgather.cc +++ b/catch/unit/texture/tex2Dgather.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex2Dgather_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex2Dgather_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex3D.cc b/catch/unit/texture/tex3D.cc index f1203f945..276394ec5 100644 --- a/catch/unit/texture/tex3D.cc +++ b/catch/unit/texture/tex3D.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex3D_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex3D_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; #if HT_NVIDIA @@ -127,7 +111,7 @@ TEMPLATE_TEST_CASE("Unit_tex3D_Positive_ReadModeElementType", "", char, unsigned * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_tex3D_Positive_ReadModeNormalizedFloat", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex3D_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex3DGrad.cc b/catch/unit/texture/tex3DGrad.cc index dfbc2b542..9fdbed477 100644 --- a/catch/unit/texture/tex3DGrad.cc +++ b/catch/unit/texture/tex3DGrad.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex3DGrad_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex3DGrad_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -125,7 +109,7 @@ TEMPLATE_TEST_CASE("Unit_tex3DGrad_Positive_ReadModeElementType", "", char, unsi * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex3DGrad_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_tex3DGrad_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/tex3DLod.cc b/catch/unit/texture/tex3DLod.cc index 5aa31198e..3ac893739 100644 --- a/catch/unit/texture/tex3DLod.cc +++ b/catch/unit/texture/tex3DLod.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex3DLod_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex3DLod_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; @@ -125,7 +109,7 @@ TEMPLATE_TEST_CASE("Unit_tex3DLod_Positive_ReadModeElementType", "", char, unsig * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_tex3DLod_Positive_ReadModeNormalizedFloat", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_tex3DLod_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; diff --git a/catch/unit/texture/texCubemap.cc b/catch/unit/texture/texCubemap.cc index 5c6738175..1c3683e09 100644 --- a/catch/unit/texture/texCubemap.cc +++ b/catch/unit/texture/texCubemap.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_texCubemap_Positive_ReadModeElementType", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_texCubemap_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); @@ -130,7 +114,7 @@ TEMPLATE_TEST_CASE("Unit_texCubemap_Positive_ReadModeElementType", "", char, uns * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_texCubemap_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_texCubemap_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); diff --git a/catch/unit/texture/texCubemapGrad.cc b/catch/unit/texture/texCubemapGrad.cc index da72490d9..759bf1e46 100644 --- a/catch/unit/texture/texCubemapGrad.cc +++ b/catch/unit/texture/texCubemapGrad.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_texCubemapGrad_Positive_ReadModeElementType", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_texCubemapGrad_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); @@ -130,7 +114,7 @@ TEMPLATE_TEST_CASE("Unit_texCubemapGrad_Positive_ReadModeElementType", "", char, * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_texCubemapGrad_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_texCubemapGrad_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); diff --git a/catch/unit/texture/texCubemapLayered.cc b/catch/unit/texture/texCubemapLayered.cc index cef3de8e0..bda49b527 100644 --- a/catch/unit/texture/texCubemapLayered.cc +++ b/catch/unit/texture/texCubemapLayered.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_texCubemapLayered_Positive_ReadModeElementType", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_texCubemapLayered_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); @@ -133,7 +117,7 @@ TEMPLATE_TEST_CASE("Unit_texCubemapLayered_Positive_ReadModeElementType", "", ch * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_texCubemapLayered_Positive_ReadModeNormalizedFloat", "", char, +TEMPLATE_TEST_CASE(Unit_texCubemapLayered_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); diff --git a/catch/unit/texture/texCubemapLayeredGrad.cc b/catch/unit/texture/texCubemapLayeredGrad.cc index 765c5f8be..90f9f8ddf 100644 --- a/catch/unit/texture/texCubemapLayeredGrad.cc +++ b/catch/unit/texture/texCubemapLayeredGrad.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_texCubemapLayeredGrad_Positive_ReadModeElementType", "", char, +TEMPLATE_TEST_CASE(Unit_texCubemapLayeredGrad_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); @@ -134,7 +118,7 @@ TEMPLATE_TEST_CASE("Unit_texCubemapLayeredGrad_Positive_ReadModeElementType", "" * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_texCubemapLayeredGrad_Positive_ReadModeNormalizedFloat", "", char, +TEMPLATE_TEST_CASE(Unit_texCubemapLayeredGrad_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); diff --git a/catch/unit/texture/texCubemapLayeredLod.cc b/catch/unit/texture/texCubemapLayeredLod.cc index 330f47bf2..1694b1b7b 100644 --- a/catch/unit/texture/texCubemapLayeredLod.cc +++ b/catch/unit/texture/texCubemapLayeredLod.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_texCubemapLayeredLod_Positive_ReadModeElementType", "", char, +TEMPLATE_TEST_CASE(Unit_texCubemapLayeredLod_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); @@ -134,7 +118,7 @@ TEMPLATE_TEST_CASE("Unit_texCubemapLayeredLod_Positive_ReadModeElementType", "", * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_texCubemapLayeredLod_Positive_ReadModeNormalizedFloat", "", char, +TEMPLATE_TEST_CASE(Unit_texCubemapLayeredLod_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); diff --git a/catch/unit/texture/texCubemapLod.cc b/catch/unit/texture/texCubemapLod.cc index 96c0cfce8..6a62f4c99 100644 --- a/catch/unit/texture/texCubemapLod.cc +++ b/catch/unit/texture/texCubemapLod.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +32,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_texCubemapLod_Positive_ReadModeElementType", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_texCubemapLod_Positive_ReadModeElementType, char, unsigned char, short, unsigned short, int, unsigned int, float) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); @@ -130,7 +114,7 @@ TEMPLATE_TEST_CASE("Unit_texCubemapLod_Positive_ReadModeElementType", "", char, * ------------------------ * - HIP_VERSION >= 5.7 */ -TEMPLATE_TEST_CASE("Unit_texCubemapLod_Positive_ReadModeNormalizedFloat", "", char, unsigned char, +TEMPLATE_TEST_CASE(Unit_texCubemapLod_Positive_ReadModeNormalizedFloat, char, unsigned char, short, unsigned short) { CHECK_IMAGE_SUPPORT; INFO("texCubemap isn't supported. Skipped."); diff --git a/catch/unit/texture/tex_ref_get_module.cc b/catch/unit/texture/tex_ref_get_module.cc index 413b60137..042dd380e 100644 --- a/catch/unit/texture/tex_ref_get_module.cc +++ b/catch/unit/texture/tex_ref_get_module.cc @@ -1,23 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/texture/texture_reference.hh b/catch/unit/texture/texture_reference.hh index 2ff3f6c6e..feef35f2f 100644 --- a/catch/unit/texture/texture_reference.hh +++ b/catch/unit/texture/texture_reference.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/texture/utils.hh b/catch/unit/texture/utils.hh index 90e51d48c..1826269fe 100644 --- a/catch/unit/texture/utils.hh +++ b/catch/unit/texture/utils.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/texture/vec4.hh b/catch/unit/texture/vec4.hh index ab1d8d457..f3f21e331 100644 --- a/catch/unit/texture/vec4.hh +++ b/catch/unit/texture/vec4.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/threadfence/CMakeLists.txt b/catch/unit/threadfence/CMakeLists.txt index 51f61f4e2..980b8afcd 100644 --- a/catch/unit/threadfence/CMakeLists.txt +++ b/catch/unit/threadfence/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC __threadfence_block.cc @@ -26,4 +10,4 @@ set(TEST_SRC hip_add_exe_to_target(NAME ThreadfenceTest TEST_SRC ${TEST_SRC} - TEST_TARGET_NAME build_tests) \ No newline at end of file + TEST_TARGET_NAME build_tests) diff --git a/catch/unit/threadfence/__threadfence.cc b/catch/unit/threadfence/__threadfence.cc index 001386668..3651ba86f 100644 --- a/catch/unit/threadfence/__threadfence.cc +++ b/catch/unit/threadfence/__threadfence.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_Positive_Basic_Shared") { +TEST_CASE(Unit___threadfence_Positive_Basic_Shared) { LinearAllocGuard in_dev(LinearAllocs::hipMalloc, 2 * sizeof(int)); LinearAllocGuard out_dev(LinearAllocs::hipMalloc, 2 * sizeof(int)); @@ -76,7 +60,7 @@ TEST_CASE("Unit___threadfence_Positive_Basic_Shared") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_Positive_Basic_Global") { +TEST_CASE(Unit___threadfence_Positive_Basic_Global) { LinearAllocGuard in_dev(LinearAllocs::hipMalloc, 2 * sizeof(int)); LinearAllocGuard out_dev(LinearAllocs::hipMalloc, 2 * sizeof(int)); @@ -108,7 +92,7 @@ TEST_CASE("Unit___threadfence_Positive_Basic_Global") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_Positive_Basic_Pinned") { +TEST_CASE(Unit___threadfence_Positive_Basic_Pinned) { LinearAllocGuard in_host(LinearAllocs::hipHostMalloc, 2 * sizeof(int)); LinearAllocGuard out_host(LinearAllocs::hipHostMalloc, 2 * sizeof(int)); @@ -136,7 +120,7 @@ TEST_CASE("Unit___threadfence_Positive_Basic_Pinned") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_Positive_Basic_Managed") { +TEST_CASE(Unit___threadfence_Positive_Basic_Managed) { LinearAllocGuard in_host(LinearAllocs::hipMallocManaged, 2 * sizeof(int)); LinearAllocGuard out_host(LinearAllocs::hipMallocManaged, 2 * sizeof(int)); @@ -164,7 +148,7 @@ TEST_CASE("Unit___threadfence_Positive_Basic_Managed") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_Positive_Basic_Peer", "[multigpu]") { +TEST_CASE(Unit___threadfence_Positive_Basic_Peer) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("At least 2 devices are required"); diff --git a/catch/unit/threadfence/__threadfence_block.cc b/catch/unit/threadfence/__threadfence_block.cc index 23e822363..4295733b7 100644 --- a/catch/unit/threadfence/__threadfence_block.cc +++ b/catch/unit/threadfence/__threadfence_block.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_block_Positive_Basic_Shared") { +TEST_CASE(Unit___threadfence_block_Positive_Basic_Shared) { LinearAllocGuard in_dev(LinearAllocs::hipMalloc, 2 * sizeof(int)); LinearAllocGuard out_dev(LinearAllocs::hipMalloc, 2 * sizeof(int)); @@ -76,7 +60,7 @@ TEST_CASE("Unit___threadfence_block_Positive_Basic_Shared") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_block_Positive_Basic_Global") { +TEST_CASE(Unit___threadfence_block_Positive_Basic_Global) { LinearAllocGuard in_dev(LinearAllocs::hipMalloc, 2 * sizeof(int)); LinearAllocGuard out_dev(LinearAllocs::hipMalloc, 2 * sizeof(int)); @@ -108,7 +92,7 @@ TEST_CASE("Unit___threadfence_block_Positive_Basic_Global") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_block_Positive_Basic_Pinned") { +TEST_CASE(Unit___threadfence_block_Positive_Basic_Pinned) { LinearAllocGuard in_host(LinearAllocs::hipHostMalloc, 2 * sizeof(int)); LinearAllocGuard out_host(LinearAllocs::hipHostMalloc, 2 * sizeof(int)); @@ -136,7 +120,7 @@ TEST_CASE("Unit___threadfence_block_Positive_Basic_Pinned") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_block_Positive_Basic_Managed") { +TEST_CASE(Unit___threadfence_block_Positive_Basic_Managed) { LinearAllocGuard in_host(LinearAllocs::hipMallocManaged, 2 * sizeof(int)); LinearAllocGuard out_host(LinearAllocs::hipMallocManaged, 2 * sizeof(int)); @@ -164,7 +148,7 @@ TEST_CASE("Unit___threadfence_block_Positive_Basic_Managed") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_block_Positive_Basic_Peer", "[multigpu]") { +TEST_CASE(Unit___threadfence_block_Positive_Basic_Peer) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("At least 2 devices are required"); diff --git a/catch/unit/threadfence/__threadfence_system.cc b/catch/unit/threadfence/__threadfence_system.cc index 9b54b0b8c..af3e18808 100644 --- a/catch/unit/threadfence/__threadfence_system.cc +++ b/catch/unit/threadfence/__threadfence_system.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -60,7 +44,7 @@ __global__ void ReadKernel(int* out, int* in) { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_system_Positive_Basic_Peer", "[multigpu]") { +TEST_CASE(Unit___threadfence_system_Positive_Basic_Peer) { const auto device_count = HipTest::getDeviceCount(); if (device_count < 2) { HipTest::HIP_SKIP_TEST("At least 2 devices are required"); @@ -114,7 +98,7 @@ TEST_CASE("Unit___threadfence_system_Positive_Basic_Peer", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit___threadfence_system_Positive_Basic_Host") { +TEST_CASE(Unit___threadfence_system_Positive_Basic_Host) { LinearAllocGuard in_host(LinearAllocs::hipHostMalloc, 2 * sizeof(int)); LinearAllocGuard out_host(LinearAllocs::hipHostMalloc, 2 * sizeof(int)); diff --git a/catch/unit/threadfence/threadfence_common.hh b/catch/unit/threadfence/threadfence_common.hh index dc8dca776..b7cf261c0 100644 --- a/catch/unit/threadfence/threadfence_common.hh +++ b/catch/unit/threadfence/threadfence_common.hh @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/vector_types/CMakeLists.txt b/catch/unit/vector_types/CMakeLists.txt index d35e4fb7e..42dcc5417 100644 --- a/catch/unit/vector_types/CMakeLists.txt +++ b/catch/unit/vector_types/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Common Tests - Test independent of all platforms diff --git a/catch/unit/vector_types/dim3.cc b/catch/unit/vector_types/dim3.cc index 3ddd8d648..48a450049 100644 --- a/catch/unit/vector_types/dim3.cc +++ b/catch/unit/vector_types/dim3.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include @@ -48,7 +35,7 @@ __global__ void Dim3VectorKernel(dim3* vector, const uint32_t x, const uint32_t * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_dim3_Empty_Positive_Device") { +TEST_CASE(Unit_dim3_Empty_Positive_Device) { dim3 vector_h{0, 0, 0}; dim3* vector_d; HIP_CHECK(hipMalloc(&vector_d, sizeof(dim3))); @@ -75,7 +62,7 @@ TEST_CASE("Unit_dim3_Empty_Positive_Device") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_dim3_X_Positive_Device") { +TEST_CASE(Unit_dim3_X_Positive_Device) { dim3 vector_h{0, 0, 0}; dim3* vector_d; HIP_CHECK(hipMalloc(&vector_d, sizeof(dim3))); @@ -105,7 +92,7 @@ TEST_CASE("Unit_dim3_X_Positive_Device") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_dim3_XY_Positive_Device") { +TEST_CASE(Unit_dim3_XY_Positive_Device) { dim3 vector_h{0, 0, 0}; dim3* vector_d; HIP_CHECK(hipMalloc(&vector_d, sizeof(dim3))); @@ -138,7 +125,7 @@ TEST_CASE("Unit_dim3_XY_Positive_Device") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_dim3_XYZ_Positive_Device") { +TEST_CASE(Unit_dim3_XYZ_Positive_Device) { dim3 vector_h{0, 0, 0}; dim3* vector_d; HIP_CHECK(hipMalloc(&vector_d, sizeof(dim3))); @@ -175,7 +162,7 @@ TEST_CASE("Unit_dim3_XYZ_Positive_Device") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_dim3_Empty_Positive_Host") { +TEST_CASE(Unit_dim3_Empty_Positive_Host) { dim3 vector = dim3(); REQUIRE(vector.x == 1); REQUIRE(vector.y == 1); @@ -195,7 +182,7 @@ TEST_CASE("Unit_dim3_Empty_Positive_Host") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_dim3_X_Positive_Host") { +TEST_CASE(Unit_dim3_X_Positive_Host) { uint32_t value_x = GENERATE(std::numeric_limits::min(), std::numeric_limits::max() / 2, std::numeric_limits::max()); @@ -218,7 +205,7 @@ TEST_CASE("Unit_dim3_X_Positive_Host") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_dim3_XY_Positive_Host") { +TEST_CASE(Unit_dim3_XY_Positive_Host) { uint32_t value_x = GENERATE(std::numeric_limits::min(), std::numeric_limits::max() / 2, std::numeric_limits::max()); @@ -244,7 +231,7 @@ TEST_CASE("Unit_dim3_XY_Positive_Host") { * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_dim3_XYZ_Positive_Host") { +TEST_CASE(Unit_dim3_XYZ_Positive_Host) { uint32_t value_x = GENERATE(std::numeric_limits::min(), std::numeric_limits::max() / 2, std::numeric_limits::max()); diff --git a/catch/unit/vector_types/negative_bitwise_double.cc b/catch/unit/vector_types/negative_bitwise_double.cc index e3a88bfe2..26656d0c0 100644 --- a/catch/unit/vector_types/negative_bitwise_double.cc +++ b/catch/unit/vector_types/negative_bitwise_double.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_bitwise_float.cc b/catch/unit/vector_types/negative_bitwise_float.cc index cc7185f09..db25adf10 100644 --- a/catch/unit/vector_types/negative_bitwise_float.cc +++ b/catch/unit/vector_types/negative_bitwise_float.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_bitwise_float_double_rtc.hh b/catch/unit/vector_types/negative_bitwise_float_double_rtc.hh index bf5eed042..992cb3486 100644 --- a/catch/unit/vector_types/negative_bitwise_float_double_rtc.hh +++ b/catch/unit/vector_types/negative_bitwise_float_double_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_1D.cc b/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_1D.cc index f95f2e5f0..33e5a57d1 100644 --- a/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_1D.cc +++ b/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_1D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_2D.cc b/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_2D.cc index 9f69fc18e..26be5c82c 100644 --- a/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_2D.cc +++ b/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_2D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_3D.cc b/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_3D.cc index 99f9d8130..435766110 100644 --- a/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_3D.cc +++ b/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_3D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_4D.cc b/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_4D.cc index 301ae99c6..254bde7ed 100644 --- a/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_4D.cc +++ b/catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_4D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_calculate_assign_with_value_1D.cc b/catch/unit/vector_types/negative_calculate_assign_with_value_1D.cc index 09d726718..7b0875821 100644 --- a/catch/unit/vector_types/negative_calculate_assign_with_value_1D.cc +++ b/catch/unit/vector_types/negative_calculate_assign_with_value_1D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_calculate_assign_with_value_2D.cc b/catch/unit/vector_types/negative_calculate_assign_with_value_2D.cc index 173d5fcb4..4936dc083 100644 --- a/catch/unit/vector_types/negative_calculate_assign_with_value_2D.cc +++ b/catch/unit/vector_types/negative_calculate_assign_with_value_2D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_calculate_assign_with_value_3D.cc b/catch/unit/vector_types/negative_calculate_assign_with_value_3D.cc index 8cd3145aa..be80a4564 100644 --- a/catch/unit/vector_types/negative_calculate_assign_with_value_3D.cc +++ b/catch/unit/vector_types/negative_calculate_assign_with_value_3D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_calculate_assign_with_value_4D.cc b/catch/unit/vector_types/negative_calculate_assign_with_value_4D.cc index 9679d1754..66702cf40 100644 --- a/catch/unit/vector_types/negative_calculate_assign_with_value_4D.cc +++ b/catch/unit/vector_types/negative_calculate_assign_with_value_4D.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_calculate_assign_with_value_rtc.hh b/catch/unit/vector_types/negative_calculate_assign_with_value_rtc.hh index ee921a016..b68e50608 100644 --- a/catch/unit/vector_types/negative_calculate_assign_with_value_rtc.hh +++ b/catch/unit/vector_types/negative_calculate_assign_with_value_rtc.hh @@ -1,21 +1,8 @@ /* -Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. -Permission is hereby granted, free of longge, 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/vector_types/negative_macros_common.hh b/catch/unit/vector_types/negative_macros_common.hh index 2967d4480..eda243d98 100644 --- a/catch/unit/vector_types/negative_macros_common.hh +++ b/catch/unit/vector_types/negative_macros_common.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/vector_types/negative_negate_unsigned.cc b/catch/unit/vector_types/negative_negate_unsigned.cc index c8bd39c7a..7343bae3d 100644 --- a/catch/unit/vector_types/negative_negate_unsigned.cc +++ b/catch/unit/vector_types/negative_negate_unsigned.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "negative_macros_common.hh" diff --git a/catch/unit/vector_types/negative_negate_unsigned_rtc.hh b/catch/unit/vector_types/negative_negate_unsigned_rtc.hh index c393570a0..265d17669 100644 --- a/catch/unit/vector_types/negative_negate_unsigned_rtc.hh +++ b/catch/unit/vector_types/negative_negate_unsigned_rtc.hh @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/catch/unit/vector_types/vector_operations_common.hh b/catch/unit/vector_types/vector_operations_common.hh index ede6b010a..b956e0215 100644 --- a/catch/unit/vector_types/vector_operations_common.hh +++ b/catch/unit/vector_types/vector_operations_common.hh @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vector_types_common.hh" diff --git a/catch/unit/vector_types/vector_types.cc b/catch/unit/vector_types/vector_types.cc index e2674c7db..fda1760b5 100644 --- a/catch/unit/vector_types/vector_types.cc +++ b/catch/unit/vector_types/vector_types.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vector_operations_common.hh" #if HT_AMD @@ -55,7 +42,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_make_vector_SanityCheck_Basic_Host", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_make_vector_SanityCheck_Basic_Host, char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { { @@ -109,7 +96,7 @@ TEMPLATE_TEST_CASE("Unit_make_vector_SanityCheck_Basic_Host", "", char, unsigned * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_make_vector_SanityCheck_Basic_Device", "", char, unsigned char, short, +TEMPLATE_TEST_CASE(Unit_make_vector_SanityCheck_Basic_Device, char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double) { { @@ -153,9 +140,9 @@ TEMPLATE_TEST_CASE("Unit_make_vector_SanityCheck_Basic_Device", "", char, unsign * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_VectorAndVectorOperations_SanityCheck_Basic_Host", "", char, - unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, - long long, unsigned long long, float, double) { +TEMPLATE_TEST_CASE(Unit_VectorAndVectorOperations_SanityCheck_Basic_Host, char, unsigned char, + short, unsigned short, int, unsigned int, long, unsigned long, long long, + unsigned long long, float, double) { const VectorOperation operations[] = { VectorOperation::kIncrementPrefix, VectorOperation::kIncrementPostfix, VectorOperation::kDecrementPrefix, VectorOperation::kDecrementPostfix, @@ -232,9 +219,9 @@ TEMPLATE_TEST_CASE("Unit_VectorAndVectorOperations_SanityCheck_Basic_Host", "", * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_VectorAndValueTypeOperations_SanityCheck_Basic_Host", "", char, - unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, - long long, unsigned long long, float, double) { +TEMPLATE_TEST_CASE(Unit_VectorAndValueTypeOperations_SanityCheck_Basic_Host, char, unsigned char, + short, unsigned short, int, unsigned int, long, unsigned long, long long, + unsigned long long, float, double) { const VectorOperation operations[] = { VectorOperation::kAddAssign, VectorOperation::kSubtractAssign, VectorOperation::kMultiplyAssign, VectorOperation::kDivideAssign, @@ -305,9 +292,9 @@ TEMPLATE_TEST_CASE("Unit_VectorAndValueTypeOperations_SanityCheck_Basic_Host", " * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_VectorAndVectorOperations_SanityCheck_Basic_Device", "", char, - unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, - long long, unsigned long long, float, double) { +TEMPLATE_TEST_CASE(Unit_VectorAndVectorOperations_SanityCheck_Basic_Device, char, unsigned char, + short, unsigned short, int, unsigned int, long, unsigned long, long long, + unsigned long long, float, double) { const VectorOperation operations[] = { VectorOperation::kIncrementPrefix, VectorOperation::kIncrementPostfix, VectorOperation::kDecrementPrefix, VectorOperation::kDecrementPostfix, @@ -384,9 +371,9 @@ TEMPLATE_TEST_CASE("Unit_VectorAndVectorOperations_SanityCheck_Basic_Device", "" * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_VectorAndValueTypeOperations_SanityCheck_Basic_Device", "", char, - unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, - long long, unsigned long long, float, double) { +TEMPLATE_TEST_CASE(Unit_VectorAndValueTypeOperations_SanityCheck_Basic_Device, char, unsigned char, + short, unsigned short, int, unsigned int, long, unsigned long, long long, + unsigned long long, float, double) { const VectorOperation operations[] = { VectorOperation::kAddAssign, VectorOperation::kSubtractAssign, VectorOperation::kMultiplyAssign, VectorOperation::kDivideAssign, @@ -455,7 +442,7 @@ TEMPLATE_TEST_CASE("Unit_VectorAndValueTypeOperations_SanityCheck_Basic_Device", * ------------------------ * - HIP_VERSION >= 5.2 */ -TEMPLATE_TEST_CASE("Unit_VectorStructuredBindings_SanityCheck_Basic_host", "", float3, double3) { +TEMPLATE_TEST_CASE(Unit_VectorStructuredBindings_SanityCheck_Basic_host, float3, double3) { auto value = GetTestValue(0); TestType vec3 = {value, value, value}; @@ -485,7 +472,7 @@ __global__ void generate_my_kernel() { static_assert(func()); } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_VectorConstexpr_SanityCheck_Basic_host_device", "") { +TEST_CASE(Unit_VectorConstexpr_SanityCheck_Basic_host_device) { generate_my_kernel<<<1, 1>>>(); static_assert(func()); } @@ -577,7 +564,7 @@ __global__ void check_alignment_device() { check_alignment(); } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Vector_alignment_check", "") { +TEST_CASE(Unit_Vector_alignment_check) { check_alignment_device<<<1, 1>>>(); check_alignment(); } @@ -670,7 +657,7 @@ __global__ void check_size_device() { check_size(); } * ------------------------ * - HIP_VERSION >= 5.2 */ -TEST_CASE("Unit_Vector_size_check", "") { +TEST_CASE(Unit_Vector_size_check) { check_size_device<<<1, 1>>>(); check_size(); } diff --git a/catch/unit/vector_types/vector_types_common.hh b/catch/unit/vector_types/vector_types_common.hh index 0d2b71311..f852af283 100644 --- a/catch/unit/vector_types/vector_types_common.hh +++ b/catch/unit/vector_types/vector_types_common.hh @@ -1,21 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/catch/unit/virtualMemoryManagement/CMakeLists.txt b/catch/unit/virtualMemoryManagement/CMakeLists.txt index 3bf34bb85..e0fdb9c78 100644 --- a/catch/unit/virtualMemoryManagement/CMakeLists.txt +++ b/catch/unit/virtualMemoryManagement/CMakeLists.txt @@ -1,39 +1,23 @@ -# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT set(TEST_SRC hipMemGetAllocationGranularity.cc hipMemRetainAllocationHandle.cc) if(HIP_PLATFORM MATCHES "nvidia") -set(TEST_SRC + set(TEST_SRC ${TEST_SRC} hipMemMapArrayAsync.cc) endif() if(UNIX) -if(HIP_PLATFORM MATCHES "amd") - set(TEST_SRC + if(HIP_PLATFORM MATCHES "amd") + set(TEST_SRC ${TEST_SRC} hipMemGetHandleForAddressRange.cc) -endif() + endif() set(TEST_SRC ${TEST_SRC} hipMemExportToShareableHandle.cc @@ -55,8 +39,7 @@ set(TEST_SRC hipMemGetAllocationPropertiesFromHandle.cc hipMemMap.cc hipMemRelease.cc - hipMemUnmap.cc - hipMemVmm_old.cc) + hipMemUnmap.cc) hip_add_exe_to_target(NAME VirtualMemoryManagementTest TEST_SRC ${TEST_SRC} diff --git a/catch/unit/virtualMemoryManagement/hipGetProcAddressVmmApis.cc b/catch/unit/virtualMemoryManagement/hipGetProcAddressVmmApis.cc index d8f8c17a2..53fda4917 100644 --- a/catch/unit/virtualMemoryManagement/hipGetProcAddressVmmApis.cc +++ b/catch/unit/virtualMemoryManagement/hipGetProcAddressVmmApis.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -37,7 +24,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipGetProcAddress_VMM") { +TEST_CASE(Unit_hipGetProcAddress_VMM) { int value = 0; HIP_CHECK(hipDeviceGetAttribute(&value, hipDeviceAttributeVirtualMemoryManagementSupported, 0)); if (value == 0) { diff --git a/catch/unit/virtualMemoryManagement/hipMemAddressFree.cc b/catch/unit/virtualMemoryManagement/hipMemAddressFree.cc index b15efa284..3794cafbc 100644 --- a/catch/unit/virtualMemoryManagement/hipMemAddressFree.cc +++ b/catch/unit/virtualMemoryManagement/hipMemAddressFree.cc @@ -1,24 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemAddressFree hipMemAddressFree @@ -44,7 +28,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemAddressFree_negative") { +TEST_CASE(Unit_hipMemAddressFree_negative) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -75,7 +59,7 @@ TEST_CASE("Unit_hipMemAddressFree_negative") { CTX_DESTROY(); } -TEST_CASE("Unit_hipMemAddressFree_Capture") { +TEST_CASE(Unit_hipMemAddressFree_Capture) { CTX_CREATE(); size_t granularity = 0; size_t buffer_size = DATA_SIZE * sizeof(int); diff --git a/catch/unit/virtualMemoryManagement/hipMemAddressReserve.cc b/catch/unit/virtualMemoryManagement/hipMemAddressReserve.cc index f9afd24c2..57b942637 100644 --- a/catch/unit/virtualMemoryManagement/hipMemAddressReserve.cc +++ b/catch/unit/virtualMemoryManagement/hipMemAddressReserve.cc @@ -1,24 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemAddressReserve hipMemAddressReserve @@ -49,7 +33,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemAddressReserve_AlignmentTest") { +TEST_CASE(Unit_hipMemAddressReserve_AlignmentTest) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -113,7 +97,7 @@ TEST_CASE("Unit_hipMemAddressReserve_AlignmentTest") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemAddressReserve_Negative") { +TEST_CASE(Unit_hipMemAddressReserve_Negative) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -152,7 +136,7 @@ TEST_CASE("Unit_hipMemAddressReserve_Negative") { CTX_DESTROY(); } -TEST_CASE("Unit_hipMemAddressReserve_Capture") { +TEST_CASE(Unit_hipMemAddressReserve_Capture) { hipMemGenericAllocationHandle_t allocation_handle; size_t granularity = 0; constexpr size_t kAlignment = 2; diff --git a/catch/unit/virtualMemoryManagement/hipMemCreate.cc b/catch/unit/virtualMemoryManagement/hipMemCreate.cc index f4edbab94..0e35bc37d 100644 --- a/catch/unit/virtualMemoryManagement/hipMemCreate.cc +++ b/catch/unit/virtualMemoryManagement/hipMemCreate.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2023-25 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemCreate hipMemCreate @@ -60,7 +44,7 @@ static __global__ void square_kernel(int* Buff) { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemCreate_BasicAllocateDeAlloc_MultGranularity") { +TEST_CASE(Unit_hipMemCreate_BasicAllocateDeAlloc_MultGranularity) { size_t granularity = 0; int deviceId = 0; CTX_CREATE(); @@ -107,7 +91,7 @@ TEST_CASE("Unit_hipMemCreate_BasicAllocateDeAlloc_MultGranularity") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemCreate_ChkDev2HstMemcpy_ReleaseHdlPostUnmap") { +TEST_CASE(Unit_hipMemCreate_ChkDev2HstMemcpy_ReleaseHdlPostUnmap) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -176,7 +160,7 @@ TEST_CASE("Unit_hipMemCreate_ChkDev2HstMemcpy_ReleaseHdlPostUnmap") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemCreate_ChkDev2HstMemcpy_ReleaseHdlPreUse") { +TEST_CASE(Unit_hipMemCreate_ChkDev2HstMemcpy_ReleaseHdlPreUse) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -245,7 +229,7 @@ TEST_CASE("Unit_hipMemCreate_ChkDev2HstMemcpy_ReleaseHdlPreUse") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemCreate_ChkWithKerLaunch") { +TEST_CASE(Unit_hipMemCreate_ChkWithKerLaunch) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -318,7 +302,7 @@ TEST_CASE("Unit_hipMemCreate_ChkWithKerLaunch") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemCreate_MapNonContiguousChunks") { +TEST_CASE(Unit_hipMemCreate_MapNonContiguousChunks) { size_t granularity = 0; constexpr int numOfBuffers = NUM_OF_BUFFERS; constexpr int N = DATA_SIZE; @@ -404,7 +388,7 @@ TEST_CASE("Unit_hipMemCreate_MapNonContiguousChunks") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemCreate_ChkWithMemset") { +TEST_CASE(Unit_hipMemCreate_ChkWithMemset) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -468,7 +452,7 @@ TEST_CASE("Unit_hipMemCreate_ChkWithMemset") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemCreate_Negative") { +TEST_CASE(Unit_hipMemCreate_Negative) { size_t granularity = 0; int deviceId = 0; hipDevice_t device; @@ -522,7 +506,7 @@ TEST_CASE("Unit_hipMemCreate_Negative") { CTX_DESTROY(); } -TEST_CASE("Unit_hipMemCreate_Capture") { +TEST_CASE(Unit_hipMemCreate_Capture) { CTX_CREATE(); hipMemGenericAllocationHandle_t allocation_handle; diff --git a/catch/unit/virtualMemoryManagement/hipMemExportToShareableHandle.cc b/catch/unit/virtualMemoryManagement/hipMemExportToShareableHandle.cc index 299b8bc3a..ae092b51c 100644 --- a/catch/unit/virtualMemoryManagement/hipMemExportToShareableHandle.cc +++ b/catch/unit/virtualMemoryManagement/hipMemExportToShareableHandle.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemExportToShareableHandle hipMemExportToShareableHandle @@ -45,7 +29,7 @@ THE SOFTWARE. * - Host specific (LINUX) * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemExportToShareableHandle_Positive_Basic") { +TEST_CASE(Unit_hipMemExportToShareableHandle_Positive_Basic) { HIP_CHECK(hipFree(0)); hipDevice_t device; @@ -84,7 +68,7 @@ TEST_CASE("Unit_hipMemExportToShareableHandle_Positive_Basic") { * - Host specific (LINUX) * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemExportToShareableHandle_Negative_Parameters") { +TEST_CASE(Unit_hipMemExportToShareableHandle_Negative_Parameters) { HIP_CHECK(hipFree(0)); hipDevice_t device; @@ -133,7 +117,7 @@ TEST_CASE("Unit_hipMemExportToShareableHandle_Negative_Parameters") { HIP_CHECK(hipMemRelease(handle)); } -TEST_CASE("Unit_hipMemExportToShareableHandle_Capture") { +TEST_CASE(Unit_hipMemExportToShareableHandle_Capture) { CTX_CREATE(); hipDevice_t device; diff --git a/catch/unit/virtualMemoryManagement/hipMemGetAllocationGranularity.cc b/catch/unit/virtualMemoryManagement/hipMemGetAllocationGranularity.cc index b84557968..58bccea4c 100644 --- a/catch/unit/virtualMemoryManagement/hipMemGetAllocationGranularity.cc +++ b/catch/unit/virtualMemoryManagement/hipMemGetAllocationGranularity.cc @@ -1,24 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemGetAllocationGranularity hipMemGetAllocationGranularity @@ -58,7 +42,7 @@ void getGranularity(size_t* granularity, hipMemAllocationGranularity_flags optio * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemGetAllocationGranularity_AllGPUs") { +TEST_CASE(Unit_hipMemGetAllocationGranularity_AllGPUs) { HIP_CHECK(hipFree(0)); int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); @@ -91,7 +75,7 @@ TEST_CASE("Unit_hipMemGetAllocationGranularity_AllGPUs") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemGetAllocationGranularity_NegativeTests") { +TEST_CASE(Unit_hipMemGetAllocationGranularity_NegativeTests) { HIP_CHECK(hipFree(0)); size_t granularity = 0; hipDevice_t device; @@ -143,7 +127,7 @@ TEST_CASE("Unit_hipMemGetAllocationGranularity_NegativeTests") { #endif } -TEST_CASE("Unit_hipMemGetAllocationGranularity_Capture") { +TEST_CASE(Unit_hipMemGetAllocationGranularity_Capture) { CTX_CREATE(); size_t granularity = 0; diff --git a/catch/unit/virtualMemoryManagement/hipMemGetAllocationPropertiesFromHandle.cc b/catch/unit/virtualMemoryManagement/hipMemGetAllocationPropertiesFromHandle.cc index 3a1af54bd..93d0158b7 100644 --- a/catch/unit/virtualMemoryManagement/hipMemGetAllocationPropertiesFromHandle.cc +++ b/catch/unit/virtualMemoryManagement/hipMemGetAllocationPropertiesFromHandle.cc @@ -1,24 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemGetAllocationPropertiesFromHandle hipMemGetAllocationPropertiesFromHandle @@ -45,7 +29,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemGetAllocationPropertiesFromHandle_functional") { +TEST_CASE(Unit_hipMemGetAllocationPropertiesFromHandle_functional) { hipDevice_t device; CTX_CREATE(); HIP_CHECK(hipDeviceGet(&device, 0)); @@ -85,7 +69,7 @@ TEST_CASE("Unit_hipMemGetAllocationPropertiesFromHandle_functional") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemGetAllocationPropertiesFromHandle_Negative") { +TEST_CASE(Unit_hipMemGetAllocationPropertiesFromHandle_Negative) { CTX_CREATE(); hipDevice_t device; HIP_CHECK(hipDeviceGet(&device, 0)); @@ -121,7 +105,7 @@ TEST_CASE("Unit_hipMemGetAllocationPropertiesFromHandle_Negative") { CTX_DESTROY(); } -TEST_CASE("Unit_hipMemGetAllocationPropertiesFromHandle_Capture") { +TEST_CASE(Unit_hipMemGetAllocationPropertiesFromHandle_Capture) { CTX_CREATE(); hipDevice_t device; HIP_CHECK(hipDeviceGet(&device, 0)); diff --git a/catch/unit/virtualMemoryManagement/hipMemGetHandleForAddressRange.cc b/catch/unit/virtualMemoryManagement/hipMemGetHandleForAddressRange.cc index 48abcd643..e3bdf7c2d 100644 --- a/catch/unit/virtualMemoryManagement/hipMemGetHandleForAddressRange.cc +++ b/catch/unit/virtualMemoryManagement/hipMemGetHandleForAddressRange.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2025 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -105,7 +92,7 @@ hipMemGenericAllocationHandle_t GetPhysicalMemory(hipDevice_t device, size_t siz * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemGetHandleForAddressRange_Negative") { +TEST_CASE(Unit_hipMemGetHandleForAddressRange_Negative) { int handle = -1; int* dptr = nullptr; constexpr int size = 10; @@ -384,7 +371,7 @@ bool validateHandle(int handle, int size, int device = 0) { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemGetHandleForAddressRange_DeviceMemory") { +TEST_CASE(Unit_hipMemGetHandleForAddressRange_DeviceMemory) { constexpr int size = 1024; constexpr int sizeBytes = size * sizeof(int); CTX_CREATE(); @@ -423,7 +410,7 @@ TEST_CASE("Unit_hipMemGetHandleForAddressRange_DeviceMemory") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemGetHandleForAddressRange_VM") { +TEST_CASE(Unit_hipMemGetHandleForAddressRange_VM) { CTX_CREATE(); hipDevice_t device; constexpr int kDeviceId = 0; @@ -466,8 +453,7 @@ TEST_CASE("Unit_hipMemGetHandleForAddressRange_VM") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemGetHandleForAddressRange_DeviceMemory_InAnotherDevice", - "[multigpu]") { +TEST_CASE(Unit_hipMemGetHandleForAddressRange_DeviceMemory_InAnotherDevice) { CTX_CREATE(); int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); @@ -522,8 +508,7 @@ TEST_CASE("Unit_hipMemGetHandleForAddressRange_DeviceMemory_InAnotherDevice", * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemGetHandleForAddressRange_VM_InAnotherDevice", - "[multigpu]") { +TEST_CASE(Unit_hipMemGetHandleForAddressRange_VM_InAnotherDevice) { CTX_CREATE(); int deviceCount = 0; HIP_CHECK(hipGetDeviceCount(&deviceCount)); @@ -586,7 +571,7 @@ TEST_CASE("Unit_hipMemGetHandleForAddressRange_VM_InAnotherDevice", * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemGetHandleForAddressRange_MulProc_Socket_DeviceMem") { +TEST_CASE(Unit_hipMemGetHandleForAddressRange_MulProc_Socket_DeviceMem) { int fd[2], fdSig[2]; REQUIRE(pipe(fd) == 0); REQUIRE(pipe(fdSig) == 0); @@ -690,7 +675,7 @@ TEST_CASE("Unit_hipMemGetHandleForAddressRange_MulProc_Socket_DeviceMem") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemGetHandleForAddressRange_MulProc_Socket_VM") { +TEST_CASE(Unit_hipMemGetHandleForAddressRange_MulProc_Socket_VM) { int fd[2], fdSig[2]; REQUIRE(pipe(fd) == 0); REQUIRE(pipe(fdSig) == 0); @@ -833,7 +818,7 @@ void launchForVM() { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemGetHandleForAddressRange_MultipleThreads") { +TEST_CASE(Unit_hipMemGetHandleForAddressRange_MultipleThreads) { hipDevice_t device; constexpr int kDeviceId = 0; HIP_CHECK(hipDeviceGet(&device, kDeviceId)); @@ -880,7 +865,7 @@ TEST_CASE("Unit_hipMemGetHandleForAddressRange_MultipleThreads") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemGetHandleForAddressRange_DifferentOffsets") { +TEST_CASE(Unit_hipMemGetHandleForAddressRange_DifferentOffsets) { hipDevice_t device; constexpr int kDeviceId = 0; HIP_CHECK(hipDeviceGet(&device, kDeviceId)); diff --git a/catch/unit/virtualMemoryManagement/hipMemImportFromShareableHandle.cc b/catch/unit/virtualMemoryManagement/hipMemImportFromShareableHandle.cc index 7cb633872..6a004f573 100644 --- a/catch/unit/virtualMemoryManagement/hipMemImportFromShareableHandle.cc +++ b/catch/unit/virtualMemoryManagement/hipMemImportFromShareableHandle.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2023-2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemExportToShareableHandle hipMemExportToShareableHandle @@ -57,7 +41,7 @@ static __global__ void square_kernel(int* Buff) { * - Host specific (LINUX) * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemImportFromShareableHandle_Positive_Basic") { +TEST_CASE(Unit_hipMemImportFromShareableHandle_Positive_Basic) { CTX_CREATE(); hipDevice_t device; @@ -100,7 +84,7 @@ TEST_CASE("Unit_hipMemImportFromShareableHandle_Positive_Basic") { * - Host specific (LINUX) * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemImportFromShareableHandle_Negative_Parameters") { +TEST_CASE(Unit_hipMemImportFromShareableHandle_Negative_Parameters) { CTX_CREATE(); hipDevice_t device; @@ -156,7 +140,7 @@ TEST_CASE("Unit_hipMemImportFromShareableHandle_Negative_Parameters") { * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemImportFromShareableHandle_MulProc_ChldUseHdl") { +TEST_CASE(Unit_hipMemImportFromShareableHandle_MulProc_ChldUseHdl) { constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); int fd[2], fdSig[2]; @@ -281,7 +265,7 @@ TEST_CASE("Unit_hipMemImportFromShareableHandle_MulProc_ChldUseHdl") { * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemImportFromShareableHandle_MulProc_ParntChldUseHdl") { +TEST_CASE(Unit_hipMemImportFromShareableHandle_MulProc_ParntChldUseHdl) { constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); int fd[2], fdSig[2]; @@ -429,7 +413,7 @@ TEST_CASE("Unit_hipMemImportFromShareableHandle_MulProc_ParntChldUseHdl") { * - Host specific (LINUX) * - HIP_VERSION >= 6.2 */ -TEST_CASE("Unit_hipMemImportFromShareableHandle_MulProc_GrndChldUseHdl") { +TEST_CASE(Unit_hipMemImportFromShareableHandle_MulProc_GrndChldUseHdl) { constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); int fd[2], fdSig[2], fdpid[2]; @@ -560,7 +544,7 @@ TEST_CASE("Unit_hipMemImportFromShareableHandle_MulProc_GrndChldUseHdl") { } } -TEST_CASE("Unit_hipMemImportFromShareableHandle_Capture") { +TEST_CASE(Unit_hipMemImportFromShareableHandle_Capture) { CTX_CREATE(); hipDevice_t device; diff --git a/catch/unit/virtualMemoryManagement/hipMemMap.cc b/catch/unit/virtualMemoryManagement/hipMemMap.cc index 63c007571..9e0b6f812 100644 --- a/catch/unit/virtualMemoryManagement/hipMemMap.cc +++ b/catch/unit/virtualMemoryManagement/hipMemMap.cc @@ -1,24 +1,8 @@ /* -Copyright (c) 2023-25 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemMap hipMemMap @@ -61,7 +45,7 @@ static __global__ void square_kernel(int* Buff) { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemMap_SameMemoryReuse") { +TEST_CASE(Unit_hipMemMap_SameMemoryReuse) { constexpr int iterations = 20; size_t granularity = 0; size_t buffer_size = N * sizeof(int); @@ -138,7 +122,7 @@ TEST_CASE("Unit_hipMemMap_SameMemoryReuse") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemMap_PhysicalMemoryReuse_SingleGPU") { +TEST_CASE(Unit_hipMemMap_PhysicalMemoryReuse_SingleGPU) { size_t granularity = 0; size_t buffer_size = N * sizeof(int); CTX_CREATE(); @@ -219,7 +203,7 @@ TEST_CASE("Unit_hipMemMap_PhysicalMemoryReuse_SingleGPU") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemMap_PhysicalMemory_Map2MultVMMs") { +TEST_CASE(Unit_hipMemMap_PhysicalMemory_Map2MultVMMs) { size_t granularity = 0; size_t buffer_size = N * sizeof(int); CTX_CREATE(); @@ -364,7 +348,7 @@ void physicalMemoryReuse_MultiDev (hipMemAllocationProp prop) { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemMap_PhysicalMemoryReuse_MultiDev", "[multigpu]") { +TEST_CASE(Unit_hipMemMap_PhysicalMemoryReuse_MultiDev) { CHECK_P2P_SUPPORT SECTION("Memory Allocation Type as hipMemAllocationTypePinned") { hipMemAllocationProp prop{}; @@ -394,7 +378,7 @@ TEST_CASE("Unit_hipMemMap_PhysicalMemoryReuse_MultiDev", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemMap_VMMMemoryReuse_SingleGPU") { +TEST_CASE(Unit_hipMemMap_VMMMemoryReuse_SingleGPU) { size_t granularity = 0; size_t buffer_size = N * sizeof(int); CTX_CREATE(); @@ -554,7 +538,7 @@ void vMMMemoryReuse_MultiGPU (hipMemAllocationProp prop) { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemMap_VMMMemoryReuse_MultiGPU", "[multigpu]") { +TEST_CASE(Unit_hipMemMap_VMMMemoryReuse_MultiGPU) { CHECK_P2P_SUPPORT SECTION("Memory Allocation Type as hipMemAllocationTypePinned") { hipMemAllocationProp prop{}; @@ -583,7 +567,7 @@ TEST_CASE("Unit_hipMemMap_VMMMemoryReuse_MultiGPU", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 7.0 */ -TEST_CASE("Unit_hipMemMap_MapPartialVMMMem") { +TEST_CASE(Unit_hipMemMap_MapPartialVMMMem) { int deviceId = 0; size_t granularity = 0; size_t buffer_size = N * sizeof(int); @@ -648,7 +632,7 @@ TEST_CASE("Unit_hipMemMap_MapPartialVMMMem") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemMap_negative") { +TEST_CASE(Unit_hipMemMap_negative) { size_t granularity = 0; size_t buffer_size = N * sizeof(int); CTX_CREATE(); @@ -684,7 +668,7 @@ TEST_CASE("Unit_hipMemMap_negative") { CTX_DESTROY(); } -TEST_CASE("Unit_hipMemMap_Capture") { +TEST_CASE(Unit_hipMemMap_Capture) { hipMemGenericAllocationHandle_t handle; size_t granularity = 0; constexpr size_t kAlignment = 2; diff --git a/catch/unit/virtualMemoryManagement/hipMemMapArrayAsync.cc b/catch/unit/virtualMemoryManagement/hipMemMapArrayAsync.cc index 12bd4e1eb..a4754a7a1 100644 --- a/catch/unit/virtualMemoryManagement/hipMemMapArrayAsync.cc +++ b/catch/unit/virtualMemoryManagement/hipMemMapArrayAsync.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemMapArrayAsync hipMemMapArrayAsync @@ -46,7 +30,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemMapArrayAsync_Positive_Basic") { +TEST_CASE(Unit_hipMemMapArrayAsync_Positive_Basic) { HIP_CHECK(hipFree(0)); hipDevice_t device; diff --git a/catch/unit/virtualMemoryManagement/hipMemRelease.cc b/catch/unit/virtualMemoryManagement/hipMemRelease.cc index 62ddadbf0..327eac321 100644 --- a/catch/unit/virtualMemoryManagement/hipMemRelease.cc +++ b/catch/unit/virtualMemoryManagement/hipMemRelease.cc @@ -1,24 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemRelease hipMemRelease @@ -41,7 +25,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemRelease_negative") { +TEST_CASE(Unit_hipMemRelease_negative) { CTX_CREATE(); SECTION("Nullptr to handle") { REQUIRE(hipMemRelease((hipMemGenericAllocationHandle_t) nullptr) == hipErrorInvalidValue); @@ -49,7 +33,7 @@ TEST_CASE("Unit_hipMemRelease_negative") { CTX_DESTROY(); } -TEST_CASE("Unit_hipMemRelease_Capture") { +TEST_CASE(Unit_hipMemRelease_Capture) { CTX_CREATE(); hipMemGenericAllocationHandle_t allocation_handle; diff --git a/catch/unit/virtualMemoryManagement/hipMemRetainAllocationHandle.cc b/catch/unit/virtualMemoryManagement/hipMemRetainAllocationHandle.cc index e708a027f..19ef7b9c3 100644 --- a/catch/unit/virtualMemoryManagement/hipMemRetainAllocationHandle.cc +++ b/catch/unit/virtualMemoryManagement/hipMemRetainAllocationHandle.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemRetainAllocationHandle hipMemRetainAllocationHandle @@ -47,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemRetainAllocationHandle_SetGet") { +TEST_CASE(Unit_hipMemRetainAllocationHandle_SetGet) { HIP_CHECK(hipFree(0)); size_t granularity = 0; constexpr int N = DATA_SIZE; @@ -92,7 +76,7 @@ TEST_CASE("Unit_hipMemRetainAllocationHandle_SetGet") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemRetainAllocationHandle_NegTst") { +TEST_CASE(Unit_hipMemRetainAllocationHandle_NegTst) { HIP_CHECK(hipFree(0)); size_t granularity = 0; constexpr int N = DATA_SIZE; @@ -141,7 +125,7 @@ TEST_CASE("Unit_hipMemRetainAllocationHandle_NegTst") { HIP_CHECK(hipMemAddressFree(ptrA, size_mem)); } -TEST_CASE("Unit_hipMemRetainAllocationHandle_Capture") { +TEST_CASE(Unit_hipMemRetainAllocationHandle_Capture) { CTX_CREATE(); size_t granularity = 0; size_t buffer_size = DATA_SIZE * sizeof(int); diff --git a/catch/unit/virtualMemoryManagement/hipMemSetGetAccess.cc b/catch/unit/virtualMemoryManagement/hipMemSetGetAccess.cc index fa0e16938..9f3d0a497 100644 --- a/catch/unit/virtualMemoryManagement/hipMemSetGetAccess.cc +++ b/catch/unit/virtualMemoryManagement/hipMemSetGetAccess.cc @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemSetAccess hipMemSetAccess @@ -79,7 +63,7 @@ __global__ void copyFromHostMem(const int* hostMem, int* devOut, int N) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_SetGet") { +TEST_CASE(Unit_hipMemSetAccess_SetGet) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -148,7 +132,7 @@ TEST_CASE("Unit_hipMemSetAccess_SetGet") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_MultDevSetGet") { +TEST_CASE(Unit_hipMemSetAccess_MultDevSetGet) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -218,7 +202,7 @@ TEST_CASE("Unit_hipMemSetAccess_MultDevSetGet") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_EntireVMMRangeSetGet") { +TEST_CASE(Unit_hipMemSetAccess_EntireVMMRangeSetGet) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -276,7 +260,7 @@ TEST_CASE("Unit_hipMemSetAccess_EntireVMMRangeSetGet") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemGetAccess_NegTst") { +TEST_CASE(Unit_hipMemGetAccess_NegTst) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -340,7 +324,7 @@ TEST_CASE("Unit_hipMemGetAccess_NegTst") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_FuncTstOnMultDev", "[multigpu]") { +TEST_CASE(Unit_hipMemSetAccess_FuncTstOnMultDev) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -412,7 +396,7 @@ TEST_CASE("Unit_hipMemSetAccess_FuncTstOnMultDev", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_ChangeAccessProp") { +TEST_CASE(Unit_hipMemSetAccess_ChangeAccessProp) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -626,7 +610,7 @@ TEST_CASE("Unit_hipMemSetAccess_SegmentsAccess") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_Vmm2UnifiedMemCpy") { +TEST_CASE(Unit_hipMemSetAccess_Vmm2UnifiedMemCpy) { CTX_CREATE(); auto managed = HmmAttrPrint(); if (managed != 1) { @@ -702,7 +686,7 @@ TEST_CASE("Unit_hipMemSetAccess_Vmm2UnifiedMemCpy") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_Vmm2DevMemCpy") { +TEST_CASE(Unit_hipMemSetAccess_Vmm2DevMemCpy) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -762,7 +746,7 @@ TEST_CASE("Unit_hipMemSetAccess_Vmm2DevMemCpy") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_Vmm2PeerDevMemCpy", "[multigpu]") { +TEST_CASE(Unit_hipMemSetAccess_Vmm2PeerDevMemCpy) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -853,7 +837,7 @@ TEST_CASE("Unit_hipMemSetAccess_Vmm2PeerDevMemCpy", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_Vmm2PeerPeerMemCpy", "[multigpu]") { +TEST_CASE(Unit_hipMemSetAccess_Vmm2PeerPeerMemCpy) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -949,7 +933,7 @@ TEST_CASE("Unit_hipMemSetAccess_Vmm2PeerPeerMemCpy", "[multigpu]") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_Vmm2VMMMemCpy") { +TEST_CASE(Unit_hipMemSetAccess_Vmm2VMMMemCpy) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -1015,7 +999,7 @@ TEST_CASE("Unit_hipMemSetAccess_Vmm2VMMMemCpy") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_Vmm2VMMInterDevMemCpy", "[multigpu]") { +TEST_CASE(Unit_hipMemSetAccess_Vmm2VMMInterDevMemCpy) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -1229,7 +1213,7 @@ class vmm_resize_class { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_GrowVMM") { +TEST_CASE(Unit_hipMemSetAccess_GrowVMM) { hipDeviceptr_t ptr; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -1332,7 +1316,7 @@ void test_thread(hipDevice_t device) { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_Multithreaded") { +TEST_CASE(Unit_hipMemSetAccess_Multithreaded) { CTX_CREATE(); int deviceId = 0; hipDevice_t device; @@ -1360,7 +1344,7 @@ TEST_CASE("Unit_hipMemSetAccess_Multithreaded") { * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemSetAccess_negative") { +TEST_CASE(Unit_hipMemSetAccess_negative) { size_t granularity = 0; constexpr int N = DATA_SIZE; size_t buffer_size = N * sizeof(int); @@ -1453,7 +1437,7 @@ TEST_CASE("Unit_hipMemSetAccess_negative") { CTX_DESTROY(); } -TEST_CASE("Unit_hipMemSetGetAccess_Capture") { +TEST_CASE(Unit_hipMemSetGetAccess_Capture) { CTX_CREATE(); const size_t kBufferBytes = DATA_SIZE * sizeof(int); @@ -1512,7 +1496,7 @@ TEST_CASE("Unit_hipMemSetGetAccess_Capture") { CTX_DESTROY(); } -TEST_CASE("Unit_hipMemSetAccessHostDevice_hostalloc") { +TEST_CASE(Unit_hipMemSetAccessHostDevice_hostalloc) { // Ensure device 0 is selected REQUIRE(hipSetDevice(0) == hipSuccess); @@ -1584,7 +1568,7 @@ TEST_CASE("Unit_hipMemSetAccessHostDevice_hostalloc") { HIP_CHECK(hipMemRelease(handle)); } -TEST_CASE("Unit_hipMemSetAccessHost_devicealloc") { +TEST_CASE(Unit_hipMemSetAccessHost_devicealloc) { // Ensure device 0 is selected REQUIRE(hipSetDevice(0) == hipSuccess); diff --git a/catch/unit/virtualMemoryManagement/hipMemUnmap.cc b/catch/unit/virtualMemoryManagement/hipMemUnmap.cc index 5578aa218..2225a0672 100644 --- a/catch/unit/virtualMemoryManagement/hipMemUnmap.cc +++ b/catch/unit/virtualMemoryManagement/hipMemUnmap.cc @@ -1,24 +1,8 @@ /* -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 -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ /** * @addtogroup hipMemUnmap hipMemUnmap @@ -45,7 +29,7 @@ constexpr int N = (1 << 13); * ------------------------ * - HIP_VERSION >= 6.1 */ -TEST_CASE("Unit_hipMemUnmap_negative") { +TEST_CASE(Unit_hipMemUnmap_negative) { size_t granularity = 0; size_t buffer_size = N * sizeof(int); int deviceId = 0; @@ -87,7 +71,7 @@ TEST_CASE("Unit_hipMemUnmap_negative") { CTX_DESTROY(); } -TEST_CASE("Unit_hipMemUnmap_Capture") { +TEST_CASE(Unit_hipMemUnmap_Capture) { CTX_CREATE(); size_t granularity = 0; constexpr size_t kBufferSize = N * sizeof(int); diff --git a/catch/unit/virtualMemoryManagement/hipMemVmm_old.cc b/catch/unit/virtualMemoryManagement/hipMemVmm_old.cc deleted file mode 100644 index cc22d5672..000000000 --- a/catch/unit/virtualMemoryManagement/hipMemVmm_old.cc +++ /dev/null @@ -1,91 +0,0 @@ -/* -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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS 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 INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ - -/* Test Case Description: - 1) This testcase verifies the basic scenario - supported on - all devices -*/ - -#include - -#include -#include -#include - -/* - This testcase verifies HIP Mem VMM API basic scenario - supported on all devices - */ -TEST_CASE("Unit_hipMemVmm_Basic") { - CTX_CREATE(); - int vmm = 0; - HIP_CHECK(hipDeviceGetAttribute(&vmm, hipDeviceAttributeVirtualMemoryManagementSupported, 0)); - INFO("hipDeviceAttributeVirtualMemoryManagementSupported: " << vmm); - - if (vmm == 0) { - SUCCEED( - "GPU 0 doesn't support hipDeviceAttributeVirtualMemoryManagement " - "attribute. Hence skipping the testing with Pass result.\n"); - return; - } - - size_t granularity = 0; - - hipMemAllocationProp memAllocationProp{}; - memAllocationProp.type = hipMemAllocationTypePinned; - memAllocationProp.location.id = 0; - memAllocationProp.location.type = hipMemLocationTypeDevice; - - HIP_CHECK(hipMemGetAllocationGranularity(&granularity, &memAllocationProp, - hipMemAllocationGranularityRecommended)); - - size_t size = granularity; - void* reservedAddress{nullptr}; - HIP_CHECK(hipMemAddressReserve(&reservedAddress, size, 0, nullptr, 0)); - - hipMemGenericAllocationHandle_t gaHandle; - HIP_CHECK(hipMemCreate(&gaHandle, size, &memAllocationProp, 0)); - - HIP_CHECK(hipMemMap(reservedAddress, size, 0, gaHandle, 0)); - - hipDevice_t device; - HIP_CHECK(hipDeviceGet(&device, 0)); - hipMemAccessDesc desc; - desc.location.type = hipMemLocationTypeDevice; - desc.location.id = device; - desc.flags = hipMemAccessFlagsProtReadWrite; - std::vector values(size); - const char value = 1; - - HIP_CHECK(hipMemSetAccess(reservedAddress, size, &desc, 1)); - HIP_CHECK(hipMemset(reservedAddress, value, size)); - HIP_CHECK(hipMemcpy(&values[0], reservedAddress, size, hipMemcpyDeviceToHost)); - - for (size_t i = 0; i < size; ++i) { - REQUIRE(values[i] == value); - } - - HIP_CHECK(hipMemUnmap(reservedAddress, size)); - - HIP_CHECK(hipMemRelease(gaHandle)); - HIP_CHECK(hipMemAddressFree(reservedAddress, size)); - CTX_DESTROY(); -} diff --git a/catch/unit/virtualMemoryManagement/hip_vmm_common.hh b/catch/unit/virtualMemoryManagement/hip_vmm_common.hh index c9bd0b380..3d8652395 100644 --- a/catch/unit/virtualMemoryManagement/hip_vmm_common.hh +++ b/catch/unit/virtualMemoryManagement/hip_vmm_common.hh @@ -1,24 +1,8 @@ /* -Copyright (c) 2023 - 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once #ifdef __linux__ diff --git a/catch/unit/vulkan_interop/CMakeLists.txt b/catch/unit/vulkan_interop/CMakeLists.txt index f3b507374..73cef88ce 100644 --- a/catch/unit/vulkan_interop/CMakeLists.txt +++ b/catch/unit/vulkan_interop/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + set(COMMON_SHARED_SRC vulkan_test.cc) set(TEST_SRC diff --git a/catch/unit/vulkan_interop/graph_tests_common.hh b/catch/unit/vulkan_interop/graph_tests_common.hh index 430709388..80ddd9427 100644 --- a/catch/unit/vulkan_interop/graph_tests_common.hh +++ b/catch/unit/vulkan_interop/graph_tests_common.hh @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/vulkan_interop/hipDestroyExternalMemory.cc b/catch/unit/vulkan_interop/hipDestroyExternalMemory.cc index 85c78316f..8ca136343 100644 --- a/catch/unit/vulkan_interop/hipDestroyExternalMemory.cc +++ b/catch/unit/vulkan_interop/hipDestroyExternalMemory.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" @@ -25,7 +10,7 @@ THE SOFTWARE. constexpr bool enable_validation = false; #endif -TEST_CASE("Unit_hipDestroyExternalMemory_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipDestroyExternalMemory_Vulkan_Negative_Parameters) { SECTION("extMem == nullptr") { HIP_CHECK_ERROR(hipDestroyExternalMemory(nullptr), hipErrorInvalidValue); } @@ -57,7 +42,7 @@ TEST_CASE("Unit_hipDestroyExternalMemory_Vulkan_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDestroyExternalMemory_Vulkan_Capture") { +TEST_CASE(Unit_hipDestroyExternalMemory_Vulkan_Capture) { // Segfaults in CUDA // Disabled on AMD due to defect - EXSWHTEC-187 #if HT_AMD && 0 diff --git a/catch/unit/vulkan_interop/hipDestroyExternalSemaphore.cc b/catch/unit/vulkan_interop/hipDestroyExternalSemaphore.cc index 6a95927e0..5b0401b3e 100644 --- a/catch/unit/vulkan_interop/hipDestroyExternalSemaphore.cc +++ b/catch/unit/vulkan_interop/hipDestroyExternalSemaphore.cc @@ -1,29 +1,14 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" constexpr bool enable_validation = false; -TEST_CASE("Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters) { SECTION("extSem == nullptr") { HIP_CHECK_ERROR(hipDestroyExternalSemaphore(nullptr), hipErrorInvalidValue); } @@ -50,7 +35,7 @@ TEST_CASE("Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipDestroyExternalSemaphore_Vulkan_Capture") { +TEST_CASE(Unit_hipDestroyExternalSemaphore_Vulkan_Capture) { VulkanTest vkt(enable_validation); const auto semaphore = vkt.CreateExternalSemaphore(VK_SEMAPHORE_TYPE_BINARY); auto handle_desc = vkt.BuildSemaphoreDescriptor(semaphore, VK_SEMAPHORE_TYPE_BINARY); diff --git a/catch/unit/vulkan_interop/hipExternalMemoryGetMappedBuffer.cc b/catch/unit/vulkan_interop/hipExternalMemoryGetMappedBuffer.cc index 6262a5c79..e1d2569f5 100644 --- a/catch/unit/vulkan_interop/hipExternalMemoryGetMappedBuffer.cc +++ b/catch/unit/vulkan_interop/hipExternalMemoryGetMappedBuffer.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" @@ -25,7 +10,7 @@ constexpr bool enable_validation = false; template __global__ void Set(T* ptr, const T val) { ptr[threadIdx.x] = val; } -TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write") { +TEST_CASE(Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write) { VulkanTest vkt(enable_validation); using type = uint8_t; constexpr uint32_t count = 3; @@ -69,7 +54,7 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write") { } // Disabled on AMD due to defect - EXSWHTEC-175 -TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write_With_Offset") { +TEST_CASE(Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write_With_Offset) { VulkanTest vkt(enable_validation); using type = uint8_t; constexpr uint32_t count = 2; @@ -104,7 +89,7 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write_With HIP_CHECK(hipDestroyExternalMemory(hip_ext_memory)); } -TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters) { VulkanTest vkt(enable_validation); const auto vk_storage = vkt.CreateMappedStorage(1, VK_BUFFER_USAGE_TRANSFER_DST_BIT, true); if (vk_storage.memory == nullptr) { @@ -169,7 +154,7 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Capture") { +TEST_CASE(Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Capture) { VulkanTest vkt(enable_validation); using type = uint8_t; constexpr uint32_t count = 3; @@ -196,7 +181,7 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Capture") { REQUIRE(nullptr != hip_dev_ptr); } -TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write_Device_Memory") { +TEST_CASE(Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write_Device_Memory) { VulkanTest vkt(enable_validation); using type = uint8_t; constexpr uint32_t count = 3; @@ -281,7 +266,7 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write_Devi vkFreeMemory(vkt.GetDevice(), dst_staging_memory, nullptr); } -TEST_CASE("Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write_With_Offset_Device_Memory") { +TEST_CASE(Unit_hipExternalMemoryGetMappedBuffer_Vulkan_Positive_Read_Write_With_Offset_Device_Memory) { VulkanTest vkt(enable_validation); using type = uint8_t; constexpr uint32_t count = 2; diff --git a/catch/unit/vulkan_interop/hipExternalMemoryGetMappedMipmappedArray.cc b/catch/unit/vulkan_interop/hipExternalMemoryGetMappedMipmappedArray.cc index 3d8e340ee..23baeb886 100644 --- a/catch/unit/vulkan_interop/hipExternalMemoryGetMappedMipmappedArray.cc +++ b/catch/unit/vulkan_interop/hipExternalMemoryGetMappedMipmappedArray.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" @@ -48,7 +33,7 @@ template bool WriteAndValidateData(hipArray_t& array, size_t array_ return is_valid; } -TEST_CASE("Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Positive_Read_Write") { +TEST_CASE(Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Positive_Read_Write) { VulkanTest vkt(enable_validation); using type = uint8_t; constexpr uint32_t count = 16384; @@ -90,7 +75,7 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Positive_Read_Wr HIP_CHECK(hipDestroyExternalMemory(ext_memory)); } -TEST_CASE("Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Array_Layered") { +TEST_CASE(Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Array_Layered) { VulkanTest vkt(enable_validation); using type = uint8_t; constexpr uint32_t count = 16384; @@ -123,7 +108,7 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Array_Layered") HIP_CHECK(hipDestroyExternalMemory(ext_memory)); } -TEST_CASE("Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Array_Cubemap") { +TEST_CASE(Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Array_Cubemap) { VulkanTest vkt(enable_validation); using type = uint8_t; // cubemap HIP array is allocated if all three extents are non-zero and the hipArrayCubemap @@ -160,7 +145,7 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Array_Cubemap") HIP_CHECK(hipDestroyExternalMemory(ext_memory)); } -TEST_CASE("Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Negative_Parameters) { CHECK_IMAGE_SUPPORT VulkanTest vkt(enable_validation); @@ -224,7 +209,7 @@ TEST_CASE("Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Negative_Paramet * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Capture") { +TEST_CASE(Unit_hipExternalMemoryGetMappedMipmappedArray_Vulkan_Capture) { VulkanTest vkt(enable_validation); using type = uint8_t; // cubemap HIP array is allocated if all three extents are non-zero and the hipArrayCubemap diff --git a/catch/unit/vulkan_interop/hipGraphAddExternalSemaphoresSignalNode.cc b/catch/unit/vulkan_interop/hipGraphAddExternalSemaphoresSignalNode.cc index be1346a86..30e976896 100644 --- a/catch/unit/vulkan_interop/hipGraphAddExternalSemaphoresSignalNode.cc +++ b/catch/unit/vulkan_interop/hipGraphAddExternalSemaphoresSignalNode.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #ifdef _WIN64 #define NOMINMAX @@ -54,7 +39,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddExternalSemaphoresSignalNode_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddExternalSemaphoresSignalNode_Positive_Basic) { SignalExternalSemaphoreCommon(GraphExtSemaphoreSignalWrapper<>); } @@ -74,7 +59,7 @@ TEST_CASE("Unit_hipGraphAddExternalSemaphoresSignalNode_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddExternalSemaphoresSignalNode_Vulkan_Positive_Timeline_Semaphore") { +TEST_CASE(Unit_hipGraphAddExternalSemaphoresSignalNode_Vulkan_Positive_Timeline_Semaphore) { SignalExternalTimelineSemaphoreCommon(GraphExtSemaphoreSignalWrapper<>); } @@ -93,7 +78,7 @@ TEST_CASE("Unit_hipGraphAddExternalSemaphoresSignalNode_Vulkan_Positive_Timeline * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddExternalSemaphoresSignalNode_Vulkan_Positive_Multiple_Semaphores") { +TEST_CASE(Unit_hipGraphAddExternalSemaphoresSignalNode_Vulkan_Positive_Multiple_Semaphores) { SignalExternalMultipleSemaphoresCommon(GraphExtSemaphoreSignalWrapper<>); } #endif @@ -116,7 +101,7 @@ TEST_CASE("Unit_hipGraphAddExternalSemaphoresSignalNode_Vulkan_Positive_Multiple * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddExternalSemaphoresSignalNode_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipGraphAddExternalSemaphoresSignalNode_Vulkan_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/vulkan_interop/hipGraphAddExternalSemaphoresWaitNode.cc b/catch/unit/vulkan_interop/hipGraphAddExternalSemaphoresWaitNode.cc index 73491f56d..32a9907fb 100644 --- a/catch/unit/vulkan_interop/hipGraphAddExternalSemaphoresWaitNode.cc +++ b/catch/unit/vulkan_interop/hipGraphAddExternalSemaphoresWaitNode.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #ifdef _WIN64 #define NOMINMAX @@ -54,7 +39,7 @@ THE SOFTWARE. * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddExternalSemaphoresWaitNode_Positive_Basic") { +TEST_CASE(Unit_hipGraphAddExternalSemaphoresWaitNode_Positive_Basic) { WaitExternalSemaphoreCommon(GraphExtSemaphoreWaitWrapper<>); } @@ -74,7 +59,7 @@ TEST_CASE("Unit_hipGraphAddExternalSemaphoresWaitNode_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Positive_Timeline_Semaphore") { +TEST_CASE(Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Positive_Timeline_Semaphore) { WaitExternalTimelineSemaphoreCommon(GraphExtSemaphoreWaitWrapper<>); } #endif @@ -94,7 +79,7 @@ TEST_CASE("Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Positive_Timeline_S * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Positive_Multiple_Semaphores") { +TEST_CASE(Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Positive_Multiple_Semaphores) { WaitExternalMultipleSemaphoresCommon(GraphExtSemaphoreWaitWrapper<>); } @@ -115,7 +100,7 @@ TEST_CASE("Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Positive_Multiple_S * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipGraphAddExternalSemaphoresWaitNode_Vulkan_Negative_Parameters) { using namespace std::placeholders; hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/vulkan_interop/hipGraphExecExternalSemaphoresSignalNodeSetParams.cc b/catch/unit/vulkan_interop/hipGraphExecExternalSemaphoresSignalNodeSetParams.cc index 92521b317..13e9bfb86 100644 --- a/catch/unit/vulkan_interop/hipGraphExecExternalSemaphoresSignalNodeSetParams.cc +++ b/catch/unit/vulkan_interop/hipGraphExecExternalSemaphoresSignalNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" #include "signal_semaphore_common.hh" @@ -91,7 +76,7 @@ static hipError_t GraphExecSemaphoreSetParamsSignalWrapper( * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecExternalSemaphoresSignalNodeSetParams_Positive_Basic") { +TEST_CASE(Unit_hipGraphExecExternalSemaphoresSignalNodeSetParams_Positive_Basic) { SignalExternalSemaphoreCommon(GraphExecSemaphoreSetParamsSignalWrapper); } @@ -112,8 +97,7 @@ TEST_CASE("Unit_hipGraphExecExternalSemaphoresSignalNodeSetParams_Positive_Basic * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE( - "Unit_hipGraphExecExternalSemaphoresSignalNodeSetParams_Vulkan_Positive_Timeline_Semaphore") { +TEST_CASE(Unit_hipGraphExecExternalSemaphoresSignalNodeSetParams_Vulkan_Positive_Timeline_Semaphore) { SignalExternalTimelineSemaphoreCommon(GraphExecSemaphoreSetParamsSignalWrapper); } @@ -131,8 +115,7 @@ TEST_CASE( * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE( - "Unit_hipGraphExecExternalSemaphoresSignalNodeSetParams_Vulkan_Positive_Multiple_Semaphores") { +TEST_CASE(Unit_hipGraphExecExternalSemaphoresSignalNodeSetParams_Vulkan_Positive_Multiple_Semaphores) { SignalExternalMultipleSemaphoresCommon(GraphExecSemaphoreSetParamsSignalWrapper); } #endif @@ -152,7 +135,7 @@ TEST_CASE( * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecExternalSemaphoresSignalNodeSetParams_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExecExternalSemaphoresSignalNodeSetParams_Vulkan_Negative_Parameters) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/vulkan_interop/hipGraphExecExternalSemaphoresWaitNodeSetParams.cc b/catch/unit/vulkan_interop/hipGraphExecExternalSemaphoresWaitNodeSetParams.cc index 03ef3645e..302637b2a 100644 --- a/catch/unit/vulkan_interop/hipGraphExecExternalSemaphoresWaitNodeSetParams.cc +++ b/catch/unit/vulkan_interop/hipGraphExecExternalSemaphoresWaitNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" #include "wait_semaphore_common.hh" @@ -91,7 +76,7 @@ static hipError_t GraphExecSemaphoreSetParamsWaitWrapper( * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecExternalSemaphoresWaitNodeSetParams_Positive_Basic") { +TEST_CASE(Unit_hipGraphExecExternalSemaphoresWaitNodeSetParams_Positive_Basic) { WaitExternalSemaphoreCommon(GraphExecSemaphoreSetParamsWaitWrapper); } @@ -112,8 +97,7 @@ TEST_CASE("Unit_hipGraphExecExternalSemaphoresWaitNodeSetParams_Positive_Basic") * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE( - "Unit_hipGraphExecExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Timeline_Semaphore") { +TEST_CASE(Unit_hipGraphExecExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Timeline_Semaphore) { WaitExternalTimelineSemaphoreCommon(GraphExecSemaphoreSetParamsWaitWrapper); } #endif @@ -132,8 +116,7 @@ TEST_CASE( * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE( - "Unit_hipGraphExecExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Multiple_Semaphores") { +TEST_CASE(Unit_hipGraphExecExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Multiple_Semaphores) { WaitExternalMultipleSemaphoresCommon(GraphExecSemaphoreSetParamsWaitWrapper); } @@ -152,7 +135,7 @@ TEST_CASE( * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExecExternalSemaphoresWaitNodeSetParams_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExecExternalSemaphoresWaitNodeSetParams_Vulkan_Negative_Parameters) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/vulkan_interop/hipGraphExternalSemaphoresSignalNodeGetParams.cc b/catch/unit/vulkan_interop/hipGraphExternalSemaphoresSignalNodeGetParams.cc index 60a157818..4172a94df 100644 --- a/catch/unit/vulkan_interop/hipGraphExternalSemaphoresSignalNodeGetParams.cc +++ b/catch/unit/vulkan_interop/hipGraphExternalSemaphoresSignalNodeGetParams.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" #include "signal_semaphore_common.hh" @@ -52,7 +37,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExternalSemaphoresSignalNodeGetParams_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExternalSemaphoresSignalNodeGetParams_Negative_Parameters) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/vulkan_interop/hipGraphExternalSemaphoresSignalNodeSetParams.cc b/catch/unit/vulkan_interop/hipGraphExternalSemaphoresSignalNodeSetParams.cc index 80044059e..2ac99cfe3 100644 --- a/catch/unit/vulkan_interop/hipGraphExternalSemaphoresSignalNodeSetParams.cc +++ b/catch/unit/vulkan_interop/hipGraphExternalSemaphoresSignalNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" #include "signal_semaphore_common.hh" @@ -46,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Positive_Basic") { +TEST_CASE(Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Positive_Basic) { SignalExternalSemaphoreCommon(GraphExtSemaphoreSignalWrapper); } @@ -67,7 +52,7 @@ TEST_CASE("Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Vulkan_Positive_Timeline_Semaphore") { +TEST_CASE(Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Vulkan_Positive_Timeline_Semaphore) { SignalExternalTimelineSemaphoreCommon(GraphExtSemaphoreSignalWrapper); } @@ -85,8 +70,7 @@ TEST_CASE("Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Vulkan_Positive_Ti * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE( - "Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Vulkan_Positive_Multiple_Semaphores") { +TEST_CASE(Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Vulkan_Positive_Multiple_Semaphores) { SignalExternalMultipleSemaphoresCommon(GraphExtSemaphoreSignalWrapper); } #endif @@ -105,7 +89,7 @@ TEST_CASE( * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExternalSemaphoresSignalNodeSetParams_Vulkan_Negative_Parameters) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/vulkan_interop/hipGraphExternalSemaphoresWaitNodeGetParams.cc b/catch/unit/vulkan_interop/hipGraphExternalSemaphoresWaitNodeGetParams.cc index d618c0915..6e8bbf876 100644 --- a/catch/unit/vulkan_interop/hipGraphExternalSemaphoresWaitNodeGetParams.cc +++ b/catch/unit/vulkan_interop/hipGraphExternalSemaphoresWaitNodeGetParams.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" #include "wait_semaphore_common.hh" @@ -52,7 +37,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExternalSemaphoresWaitNodeGetParams_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExternalSemaphoresWaitNodeGetParams_Negative_Parameters) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/vulkan_interop/hipGraphExternalSemaphoresWaitNodeSetParams.cc b/catch/unit/vulkan_interop/hipGraphExternalSemaphoresWaitNodeSetParams.cc index b2715e9e0..15ddc7882 100644 --- a/catch/unit/vulkan_interop/hipGraphExternalSemaphoresWaitNodeSetParams.cc +++ b/catch/unit/vulkan_interop/hipGraphExternalSemaphoresWaitNodeSetParams.cc @@ -1,23 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" #include "wait_semaphore_common.hh" @@ -46,7 +31,7 @@ THE SOFTWARE. * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Positive_Basic") { +TEST_CASE(Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Positive_Basic) { WaitExternalSemaphoreCommon(GraphExtSemaphoreWaitWrapper); } @@ -67,7 +52,7 @@ TEST_CASE("Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Positive_Basic") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Timeline_Semaphore") { +TEST_CASE(Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Timeline_Semaphore) { WaitExternalTimelineSemaphoreCommon(GraphExtSemaphoreWaitWrapper); } #endif @@ -86,7 +71,7 @@ TEST_CASE("Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Time * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Multiple_Semaphores") { +TEST_CASE(Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Multiple_Semaphores) { WaitExternalMultipleSemaphoresCommon(GraphExtSemaphoreWaitWrapper); } @@ -104,7 +89,7 @@ TEST_CASE("Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Vulkan_Positive_Mult * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipGraphExternalSemaphoresWaitNodeSetParams_Vulkan_Negative_Parameters) { hipGraph_t graph = nullptr; HIP_CHECK(hipGraphCreate(&graph, 0)); diff --git a/catch/unit/vulkan_interop/hipImportExternalMemory.cc b/catch/unit/vulkan_interop/hipImportExternalMemory.cc index 10cb9697c..e9e842fce 100644 --- a/catch/unit/vulkan_interop/hipImportExternalMemory.cc +++ b/catch/unit/vulkan_interop/hipImportExternalMemory.cc @@ -1,29 +1,14 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" constexpr bool enable_validation = false; -TEST_CASE("Unit_hipImportExternalMemory_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipImportExternalMemory_Vulkan_Negative_Parameters) { VulkanTest vkt(enable_validation); #if HT_NVIDIA const auto storage = vkt.CreateMappedStorage(1, VK_BUFFER_USAGE_TRANSFER_DST_BIT, true); @@ -90,7 +75,7 @@ TEST_CASE("Unit_hipImportExternalMemory_Vulkan_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipImportExternalMemory_Vulkan_Capture") { +TEST_CASE(Unit_hipImportExternalMemory_Vulkan_Capture) { VulkanTest vkt(enable_validation); using type = uint8_t; constexpr uint32_t count = 2; diff --git a/catch/unit/vulkan_interop/hipImportExternalSemaphore.cc b/catch/unit/vulkan_interop/hipImportExternalSemaphore.cc index b3f9d704f..5d133828b 100644 --- a/catch/unit/vulkan_interop/hipImportExternalSemaphore.cc +++ b/catch/unit/vulkan_interop/hipImportExternalSemaphore.cc @@ -1,29 +1,14 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" constexpr bool enable_validation = false; -TEST_CASE("Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters) { VulkanTest vkt(enable_validation); const auto semaphore = vkt.CreateExternalSemaphore(VK_SEMAPHORE_TYPE_BINARY); auto handle_desc = vkt.BuildSemaphoreDescriptor(semaphore, VK_SEMAPHORE_TYPE_BINARY); @@ -68,7 +53,7 @@ TEST_CASE("Unit_hipImportExternalSemaphore_Vulkan_Negative_Parameters") { * ------------------------ * - HIP_VERSION >= 6.0 */ -TEST_CASE("Unit_hipImportExternalSemaphore_Vulkan_Capture") { +TEST_CASE(Unit_hipImportExternalSemaphore_Vulkan_Capture) { VulkanTest vkt(enable_validation); const auto semaphore = vkt.CreateExternalSemaphore(VK_SEMAPHORE_TYPE_BINARY); auto handle_desc = vkt.BuildSemaphoreDescriptor(semaphore, VK_SEMAPHORE_TYPE_BINARY); diff --git a/catch/unit/vulkan_interop/hipSignalExternalSemaphoresAsync.cc b/catch/unit/vulkan_interop/hipSignalExternalSemaphoresAsync.cc index 0dca07cbd..28dae55d4 100644 --- a/catch/unit/vulkan_interop/hipSignalExternalSemaphoresAsync.cc +++ b/catch/unit/vulkan_interop/hipSignalExternalSemaphoresAsync.cc @@ -1,43 +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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" #include "signal_semaphore_common.hh" -TEST_CASE("Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore") { +TEST_CASE(Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore) { SignalExternalSemaphoreCommon(hipSignalExternalSemaphoresAsync); } // Timeline semaphores unsupported on AMD #if HT_NVIDIA -TEST_CASE("Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Timeline_Semaphore") { +TEST_CASE(Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Timeline_Semaphore) { SignalExternalTimelineSemaphoreCommon(hipSignalExternalSemaphoresAsync); } -TEST_CASE("Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores") { +TEST_CASE(Unit_hipSignalExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores) { SignalExternalMultipleSemaphoresCommon(hipSignalExternalSemaphoresAsync); } #endif -TEST_CASE("Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipSignalExternalSemaphoresAsync_Vulkan_Negative_Parameters) { VulkanTest vkt(enable_validation); hipExternalSemaphoreSignalParams signal_params = {}; signal_params.params.fence.value = 1; diff --git a/catch/unit/vulkan_interop/hipWaitExternalSemaphoresAsync.cc b/catch/unit/vulkan_interop/hipWaitExternalSemaphoresAsync.cc index ee8a175b6..4af67756e 100644 --- a/catch/unit/vulkan_interop/hipWaitExternalSemaphoresAsync.cc +++ b/catch/unit/vulkan_interop/hipWaitExternalSemaphoresAsync.cc @@ -1,43 +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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" #include "wait_semaphore_common.hh" -TEST_CASE("Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore") { +TEST_CASE(Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Binary_Semaphore) { WaitExternalSemaphoreCommon(hipWaitExternalSemaphoresAsync); } // Timeline semaphores unsupported on AMD #if HT_NVIDIA -TEST_CASE("Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Timeline_Semaphore") { +TEST_CASE(Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Timeline_Semaphore) { WaitExternalTimelineSemaphoreCommon(hipWaitExternalSemaphoresAsync); } #endif -TEST_CASE("Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores") { +TEST_CASE(Unit_hipWaitExternalSemaphoresAsync_Vulkan_Positive_Multiple_Semaphores) { WaitExternalMultipleSemaphoresCommon(hipWaitExternalSemaphoresAsync); } -TEST_CASE("Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters") { +TEST_CASE(Unit_hipWaitExternalSemaphoresAsync_Vulkan_Negative_Parameters) { VulkanTest vkt(enable_validation); hipExternalSemaphoreWaitParams wait_params = {}; wait_params.params.fence.value = 1; diff --git a/catch/unit/vulkan_interop/signal_semaphore_common.hh b/catch/unit/vulkan_interop/signal_semaphore_common.hh index 2c8b2f1c8..05e374305 100644 --- a/catch/unit/vulkan_interop/signal_semaphore_common.hh +++ b/catch/unit/vulkan_interop/signal_semaphore_common.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/vulkan_interop/vulkan_test.cc b/catch/unit/vulkan_interop/vulkan_test.cc index 997a08a85..ef3fa2856 100644 --- a/catch/unit/vulkan_interop/vulkan_test.cc +++ b/catch/unit/vulkan_interop/vulkan_test.cc @@ -1,23 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "vulkan_test.hh" diff --git a/catch/unit/vulkan_interop/vulkan_test.hh b/catch/unit/vulkan_interop/vulkan_test.hh index 6221c2c89..7d5dc4a84 100644 --- a/catch/unit/vulkan_interop/vulkan_test.hh +++ b/catch/unit/vulkan_interop/vulkan_test.hh @@ -1,21 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/vulkan_interop/wait_semaphore_common.hh b/catch/unit/vulkan_interop/wait_semaphore_common.hh index e590a6d54..18f9c0cf1 100644 --- a/catch/unit/vulkan_interop/wait_semaphore_common.hh +++ b/catch/unit/vulkan_interop/wait_semaphore_common.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/catch/unit/warp/CMakeLists.txt b/catch/unit/warp/CMakeLists.txt index 9918ac936..79d735de5 100644 --- a/catch/unit/warp/CMakeLists.txt +++ b/catch/unit/warp/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # Common Tests - Test independent of all platforms set(TEST_SRC warp_ballot.cc @@ -24,15 +28,16 @@ if(HIP_PLATFORM MATCHES "amd") ) endif() - if(HIP_PLATFORM MATCHES "nvidia") - set_source_files_properties(hipMatchSyncAllTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") - set_source_files_properties(hipMatchSyncAnyTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") - set_source_files_properties(hipShflSyncDownTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") - set_source_files_properties(hipShflSyncUpTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") - set_source_files_properties(hipShflSyncXorTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") - set_source_files_properties(hipShflSyncTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") - set_source_files_properties(hipVoteSyncTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") - endif() +if(HIP_PLATFORM MATCHES "nvidia") + set_source_files_properties(hipMatchSyncAllTests.cc PROPERTIES COMPILE_FLAGS "-arch=compute_75") + set_source_files_properties(hipMatchSyncAnyTests.cc PROPERTIES COMPILE_FLAGS "-arch=compute_75") + set_source_files_properties(hipShflSyncDownTests.cc PROPERTIES COMPILE_FLAGS "-arch=compute_75") + set_source_files_properties(hipShflSyncUpTests.cc PROPERTIES COMPILE_FLAGS "-arch=compute_75") + set_source_files_properties(hipShflSyncXorTests.cc PROPERTIES COMPILE_FLAGS "-arch=compute_75") + set_source_files_properties(hipShflSyncTests.cc PROPERTIES COMPILE_FLAGS "-arch=compute_75") + set_source_files_properties(hipVoteSyncTests.cc PROPERTIES COMPILE_FLAGS "-arch=compute_75") + # set_source_files_properties(warp_ballot.cc PROPERTIES COMPILE_FLAGS "-arch=compute_60 -code=sm_60") +endif() hip_add_exe_to_target(NAME WarpTest TEST_SRC ${TEST_SRC} diff --git a/catch/unit/warp/hipMatchSyncAllTests.cc b/catch/unit/warp/hipMatchSyncAllTests.cc index 23026c301..5a4100f9d 100644 --- a/catch/unit/warp/hipMatchSyncAllTests.cc +++ b/catch/unit/warp/hipMatchSyncAllTests.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_common.hh" #include @@ -330,7 +317,7 @@ static void runTestMatchAll_4() { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipMatchSync_All") { +TEST_CASE(Unit_hipMatchSync_All) { CHECK_WARP_MATCH_FUNCTIONS_SUPPORT SECTION("run test for int") { diff --git a/catch/unit/warp/hipMatchSyncAnyTests.cc b/catch/unit/warp/hipMatchSyncAnyTests.cc index 5896e7b95..bc27f289c 100644 --- a/catch/unit/warp/hipMatchSyncAnyTests.cc +++ b/catch/unit/warp/hipMatchSyncAnyTests.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_common.hh" #include @@ -205,7 +192,7 @@ static void runTestMatchAny_3() { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipMatchSync_Any") { +TEST_CASE(Unit_hipMatchSync_Any) { CHECK_WARP_MATCH_FUNCTIONS_SUPPORT SECTION("run test for int") { diff --git a/catch/unit/warp/hipShflSyncDownTests.cc b/catch/unit/warp/hipShflSyncDownTests.cc index 1868aefe6..c023071a1 100644 --- a/catch/unit/warp/hipShflSyncDownTests.cc +++ b/catch/unit/warp/hipShflSyncDownTests.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_common.hh" #include @@ -229,7 +216,7 @@ static void runTestShflDown_4() { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipShflSync_Down") { +TEST_CASE(Unit_hipShflSync_Down) { CHECK_WARP_MATCH_FUNCTIONS_SUPPORT SECTION("run test for short") { diff --git a/catch/unit/warp/hipShflSyncTests.cc b/catch/unit/warp/hipShflSyncTests.cc index 20d622f7f..30636a8cf 100644 --- a/catch/unit/warp/hipShflSyncTests.cc +++ b/catch/unit/warp/hipShflSyncTests.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_common.hh" #include @@ -171,7 +158,7 @@ static void runTestShfl_3() { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipShflSync") { +TEST_CASE(Unit_hipShflSync) { CHECK_WARP_MATCH_FUNCTIONS_SUPPORT SECTION("run test for short") { diff --git a/catch/unit/warp/hipShflSyncUpTests.cc b/catch/unit/warp/hipShflSyncUpTests.cc index d55ee500d..2b92a59d9 100644 --- a/catch/unit/warp/hipShflSyncUpTests.cc +++ b/catch/unit/warp/hipShflSyncUpTests.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_common.hh" #include @@ -211,7 +198,7 @@ static void runTestShflUp_4() { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipShflSync_Up") { +TEST_CASE(Unit_hipShflSync_Up) { CHECK_WARP_MATCH_FUNCTIONS_SUPPORT SECTION("run test for short") { diff --git a/catch/unit/warp/hipShflSyncXorTests.cc b/catch/unit/warp/hipShflSyncXorTests.cc index b70b636f3..44de35d7f 100644 --- a/catch/unit/warp/hipShflSyncXorTests.cc +++ b/catch/unit/warp/hipShflSyncXorTests.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_common.hh" #include @@ -288,7 +275,7 @@ static void runTestShflXor_4() { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipShflSync_Xor") { +TEST_CASE(Unit_hipShflSync_Xor) { CHECK_WARP_MATCH_FUNCTIONS_SUPPORT SECTION("run test for short") { diff --git a/catch/unit/warp/hipShflTests.cc b/catch/unit/warp/hipShflTests.cc index 0337bc417..5d00ef412 100644 --- a/catch/unit/warp/hipShflTests.cc +++ b/catch/unit/warp/hipShflTests.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -165,7 +152,7 @@ template static void runTest() { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipShflTests") { +TEST_CASE(Unit_hipShflTests) { SECTION("run test for int") { runTest(); } SECTION("run test for float") { runTest(); } SECTION("run test for double") { runTest(); } @@ -211,7 +198,7 @@ __global__ void testShflWithUndefArgs(unsigned long total_out_strings, unsigned out[lane]++; } } -TEST_CASE("Unit_hipShflUndefArgs") { +TEST_CASE(Unit_hipShflUndefArgs) { hipDeviceProp_t prop; int device; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/warp/hipShflUpDownTest.cc b/catch/unit/warp/hipShflUpDownTest.cc index 0a95f5281..cecf48080 100644 --- a/catch/unit/warp/hipShflUpDownTest.cc +++ b/catch/unit/warp/hipShflUpDownTest.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include @@ -152,7 +139,7 @@ template static void runTestShflXor() { * ticket SWDEV-379177 */ -TEST_CASE("Unit_runTestShfl_up") { +TEST_CASE(Unit_runTestShfl_up) { SECTION("runTestShflUp for int") { runTestShflUp(); } SECTION("runTestShflUp for float") { runTestShflUp(); } SECTION("runTestShflUp for double") { runTestShflUp(); } @@ -189,7 +176,7 @@ TEST_CASE("Unit_runTestShfl_up") { * ticket SWDEV-379177 */ -TEST_CASE("Unit_runTestShfl_Down") { +TEST_CASE(Unit_runTestShfl_Down) { SECTION("runTestShflDown for int") { runTestShflDown(); } SECTION("runTestShflDown for float") { runTestShflDown(); } SECTION("runTestShflDown for double") { runTestShflDown(); } @@ -226,7 +213,7 @@ TEST_CASE("Unit_runTestShfl_Down") { * ticket SWDEV-379177 */ -TEST_CASE("Unit_runTestShfl_Xor") { +TEST_CASE(Unit_runTestShfl_Xor) { SECTION("runTestShflXor for int") { runTestShflXor(); } SECTION("runTestShflXor for float") { runTestShflXor(); } SECTION("runTestShflXor for double") { runTestShflXor(); } diff --git a/catch/unit/warp/hipVoteSyncTests.cc b/catch/unit/warp/hipVoteSyncTests.cc index 0bb0a8e2a..44e27f6ac 100644 --- a/catch/unit/warp/hipVoteSyncTests.cc +++ b/catch/unit/warp/hipVoteSyncTests.cc @@ -1,21 +1,8 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_common.hh" #include @@ -567,7 +554,7 @@ static void runTestBallot_3() { * - HIP_VERSION >= 5.6 */ -TEST_CASE("Unit_hipVoteSync_Any") { +TEST_CASE(Unit_hipVoteSync_Any) { CHECK_WARP_MATCH_FUNCTIONS_SUPPORT runTestAny_1(); @@ -577,7 +564,7 @@ TEST_CASE("Unit_hipVoteSync_Any") { runTestAny_4(); } -TEST_CASE("Unit_hipVoteSync_All") { +TEST_CASE(Unit_hipVoteSync_All) { CHECK_WARP_MATCH_FUNCTIONS_SUPPORT runTestAll_1_w64(); @@ -587,7 +574,7 @@ TEST_CASE("Unit_hipVoteSync_All") { runTestAll_4(); } -TEST_CASE("Unit_hipVoteSync_Ballot") { +TEST_CASE(Unit_hipVoteSync_Ballot) { CHECK_WARP_MATCH_FUNCTIONS_SUPPORT runTestBallot_1(); diff --git a/catch/unit/warp/warp_all.cc b/catch/unit/warp/warp_all.cc index 885836b61..231f4fdca 100644 --- a/catch/unit/warp/warp_all.cc +++ b/catch/unit/warp/warp_all.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_vote_common.hh" @@ -49,9 +36,14 @@ __global__ void kernel_all(uint64_t* const out, const uint64_t* const active_mas const auto grid = cg::this_grid(); const auto warp = cg::tiled_partition(cg::this_thread_block(), warpSize); - int pred = MASK_SHIFT(predicate, warp.thread_rank()); + +#if HT_AMD out[grid.thread_rank()] = __all(pred); +#else + unsigned mask = 0xFFFFFFFF; + out[grid.thread_rank()] = __all_sync(mask, pred); +#endif } class WarpAll : public WarpVoteTest { @@ -109,7 +101,7 @@ class WarpAll : public WarpVoteTest { * - HIP_VERSION >= 5.2 * - Device supports warp vote */ -TEST_CASE("Unit_Warp_Vote_All_Positive_Basic") { +TEST_CASE(Unit_Warp_Vote_All_Positive_Basic) { int device; hipDeviceProp_t device_properties; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/warp/warp_any.cc b/catch/unit/warp/warp_any.cc index 694d85e62..27aeed4c9 100644 --- a/catch/unit/warp/warp_any.cc +++ b/catch/unit/warp/warp_any.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_vote_common.hh" @@ -40,9 +27,14 @@ __global__ void kernel_any(uint64_t* const out, const uint64_t* const active_mas const auto grid = cg::this_grid(); const auto warp = cg::tiled_partition(cg::this_thread_block(), warpSize); - int pred = MASK_SHIFT(predicate, warp.thread_rank()); + +#if HT_AMD out[grid.thread_rank()] = __any(pred); +#else + unsigned mask = 0xFFFFFFFF; + out[grid.thread_rank()] = __any_sync(mask, pred); +#endif } class WarpAny : public WarpVoteTest { @@ -100,7 +92,7 @@ class WarpAny : public WarpVoteTest { * - HIP_VERSION >= 5.2 * - Device supports warp vote */ -TEST_CASE("Unit_Warp_Vote_Any_Positive_Basic") { +TEST_CASE(Unit_Warp_Vote_Any_Positive_Basic) { int device; hipDeviceProp_t device_properties; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/warp/warp_ballot.cc b/catch/unit/warp/warp_ballot.cc index 58e537890..96b9ef8a3 100644 --- a/catch/unit/warp/warp_ballot.cc +++ b/catch/unit/warp/warp_ballot.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_vote_common.hh" @@ -39,9 +26,14 @@ __global__ void kernel_ballot(uint64_t* const out, const uint64_t* const active_ const auto grid = cg::this_grid(); const auto warp = cg::tiled_partition(cg::this_thread_block(), warpSize); - int pred = MASK_SHIFT(predicate, warp.thread_rank()); + +#if HT_AMD out[grid.thread_rank()] = __ballot(pred); +#else + unsigned mask = 0xFFFFFFFF; + out[grid.thread_rank()] = __ballot_sync(mask, pred); +#endif } class WarpBallot : public WarpVoteTest { @@ -99,7 +91,7 @@ class WarpBallot : public WarpVoteTest { * - HIP_VERSION >= 5.2 * - Device supports warp ballot */ -TEST_CASE("Unit_Warp_Ballot_Positive_Basic") { +TEST_CASE(Unit_Warp_Ballot_Positive_Basic) { int device; hipDeviceProp_t device_properties; HIP_CHECK(hipGetDevice(&device)); diff --git a/catch/unit/warp/warp_reduce.cc b/catch/unit/warp/warp_reduce.cc index e400f3e68..817795feb 100644 --- a/catch/unit/warp/warp_reduce.cc +++ b/catch/unit/warp/warp_reduce.cc @@ -1,21 +1,9 @@ /* -Copyright (c) 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ + #define HIP_ENABLE_WARP_SYNC_BUILTINS #define HIP_ENABLE_EXTRA_WARP_SYNC_TYPES @@ -131,7 +119,7 @@ template void runTestMultipleMasks(unsigned long long masks[], int num } } -TEMPLATE_TEST_CASE("Unit_hipReduceSingleMasks", "", int, unsigned int, long long, +TEMPLATE_TEST_CASE(Unit_hipReduceSingleMasks, int, unsigned int, long long, unsigned long long, float, half, double) { unsigned long long fullMask = getWarpSize() == 64 ? ~0ul : 0xFFFFFFFF; unsigned long long oneBitMasks[] = {0b1 & fullMask}; @@ -145,7 +133,7 @@ TEMPLATE_TEST_CASE("Unit_hipReduceSingleMasks", "", int, unsigned int, long long runTestMultipleMasks(everyFifthButNinethMasks, NELEMS(everyFifthButNinethMasks)); } -TEMPLATE_TEST_CASE("Unit_hipReduceMultipleMasks", "", int, unsigned int, long long, +TEMPLATE_TEST_CASE(Unit_hipReduceMultipleMasks, int, unsigned int, long long, unsigned long long, float, half, double) { if (getWarpSize() == 64) { unsigned long long masks[] = {0b0110011, 0x0F0F0F0F00000000, 0xF0F0F0F000000000, @@ -198,7 +186,7 @@ void runTestReduceForTypes(const std::tuple) { runTestReduceForTypes(remainingTypes); } -TEST_CASE("Unit_hipReduceRandom") { +TEST_CASE(Unit_hipReduceRandom) { const std::tuple allTypes; const std::tuple integralTypes; diff --git a/catch/unit/warp/warp_shfl.cc b/catch/unit/warp/warp_shfl.cc index 1d757f86d..a6dd9f832 100644 --- a/catch/unit/warp/warp_shfl.cc +++ b/catch/unit/warp/warp_shfl.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_shfl_common.hh" @@ -99,7 +86,7 @@ template class WarpShfl : public WarpShflTest, T> { * - HIP_VERSION >= 5.2 * - Device supports warp shuffle */ -TEMPLATE_TEST_CASE("Unit_Warp_Shfl_Positive_Basic", "", int, unsigned int, long, unsigned long, +TEMPLATE_TEST_CASE(Unit_Warp_Shfl_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double, __half, __half2) { int device; hipDeviceProp_t device_properties; diff --git a/catch/unit/warp/warp_shfl_common.hh b/catch/unit/warp/warp_shfl_common.hh index d8fc75eb0..acc9a6419 100644 --- a/catch/unit/warp/warp_shfl_common.hh +++ b/catch/unit/warp/warp_shfl_common.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once @@ -39,9 +26,9 @@ template class WarpShflTest { WarpShflTest() : warp_size_{get_warp_size()} {} void run(bool random = false) { - const auto blocks = GenerateBlockDimensionsForShuffle(); + const auto blocks = GenerateBlockDimensionsForShuffleWarp(); INFO("Grid dimensions: x " << blocks.x << ", y " << blocks.y << ", z " << blocks.z); - const auto threads = GenerateThreadDimensionsForShuffle(); + const auto threads = GenerateThreadDimensionsForShuffleWarp(); INFO("Block dimensions: x " << threads.x << ", y " << threads.y << ", z " << threads.z); grid_ = CPUGrid(blocks, threads); diff --git a/catch/unit/warp/warp_shfl_down.cc b/catch/unit/warp/warp_shfl_down.cc index 964389a01..e50641d53 100644 --- a/catch/unit/warp/warp_shfl_down.cc +++ b/catch/unit/warp/warp_shfl_down.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_shfl_common.hh" @@ -99,7 +86,7 @@ template class WarpShflDown : public WarpShflTest, * - HIP_VERSION >= 5.2 * - Device supports warp shuffle */ -TEMPLATE_TEST_CASE("Unit_Warp_Shfl_Down_Positive_Basic", "", int, unsigned int, long, unsigned long, +TEMPLATE_TEST_CASE(Unit_Warp_Shfl_Down_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double, __half, __half2) { int device; hipDeviceProp_t device_properties; diff --git a/catch/unit/warp/warp_shfl_up.cc b/catch/unit/warp/warp_shfl_up.cc index c9edaf7ab..098d611d1 100644 --- a/catch/unit/warp/warp_shfl_up.cc +++ b/catch/unit/warp/warp_shfl_up.cc @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_shfl_common.hh" @@ -98,7 +85,7 @@ template class WarpShflUp : public WarpShflTest, T> { * - HIP_VERSION >= 5.2 * - Device supports warp shuffle */ -TEMPLATE_TEST_CASE("Unit_Warp_Shfl_Up_Positive_Basic", "", int, unsigned int, long, unsigned long, +TEMPLATE_TEST_CASE(Unit_Warp_Shfl_Up_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double, __half, __half2) { int device; hipDeviceProp_t device_properties; diff --git a/catch/unit/warp/warp_shfl_xor.cc b/catch/unit/warp/warp_shfl_xor.cc index 25d9e37c5..ae328b48f 100644 --- a/catch/unit/warp/warp_shfl_xor.cc +++ b/catch/unit/warp/warp_shfl_xor.cc @@ -1,23 +1,11 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "warp_shfl_common.hh" +#include "warp_common.hh" #include @@ -46,10 +34,18 @@ template __global__ void shfl_xor(T* const out, const T* const in, template class WarpShflXOR : public WarpShflTest, T> { public: void launch_kernel(T* const arr_dev, T* const input_dev, const uint64_t* const active_masks) { + const auto inv_reduction_factor = 1 / GetTestReductionFactor(); + + std::vector lane_masks; + for (double i = 0; i < this->warp_size_; i += inv_reduction_factor) { + lane_masks.emplace_back(static_cast(std::floor(i))); + } + width_ = generate_width(this->warp_size_); INFO("Width: " << width_); - lane_mask_ = GENERATE_COPY(range(0, this->warp_size_)); + lane_mask_ = GENERATE_COPY(from_range(lane_masks.begin(), lane_masks.end())); INFO("Lane mask: " << lane_mask_); + shfl_xor<<grid_.grid_dim_, this->grid_.block_dim_>>>(arr_dev, input_dev, active_masks, lane_mask_, width_); } @@ -96,7 +92,7 @@ template class WarpShflXOR : public WarpShflTest, T> * - HIP_VERSION >= 5.2 * - Device supports warp shuffle */ -TEMPLATE_TEST_CASE("Unit_Warp_Shfl_XOR_Positive_Basic", "", int, unsigned int, long, unsigned long, +TEMPLATE_TEST_CASE(Unit_Warp_Shfl_XOR_Positive_Basic, int, unsigned int, long, unsigned long, long long, unsigned long long, float, double, __half, __half2) { int device; hipDeviceProp_t device_properties; diff --git a/catch/unit/warp/warp_vote_common.hh b/catch/unit/warp/warp_vote_common.hh index 36809b750..80ecbef44 100644 --- a/catch/unit/warp/warp_vote_common.hh +++ b/catch/unit/warp/warp_vote_common.hh @@ -1,21 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #pragma once diff --git a/samples/0_Intro/CMakeLists.txt b/samples/0_Intro/CMakeLists.txt index ed73f09e3..e5fe36dfd 100644 --- a/samples/0_Intro/CMakeLists.txt +++ b/samples/0_Intro/CMakeLists.txt @@ -1,27 +1,12 @@ -# Copyright (c) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT +cmake_minimum_required(VERSION 3.21.3) add_custom_target(build_intro) add_subdirectory(bit_extract) add_subdirectory(module_api) add_subdirectory(module_api_global) add_subdirectory(square) -add_subdirectory(generic_target) \ No newline at end of file +add_subdirectory(generic_target) diff --git a/samples/0_Intro/bit_extract/CMakeLists.txt b/samples/0_Intro/bit_extract/CMakeLists.txt index a3c726217..e4660772f 100644 --- a/samples/0_Intro/bit_extract/CMakeLists.txt +++ b/samples/0_Intro/bit_extract/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/0_Intro/bit_extract/bit_extract.cpp b/samples/0_Intro/bit_extract/bit_extract.cpp index d3a57d0c3..b0689bada 100644 --- a/samples/0_Intro/bit_extract/bit_extract.cpp +++ b/samples/0_Intro/bit_extract/bit_extract.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/0_Intro/generic_target/CMakeLists.txt b/samples/0_Intro/generic_target/CMakeLists.txt index b486f3246..7af46853e 100644 --- a/samples/0_Intro/generic_target/CMakeLists.txt +++ b/samples/0_Intro/generic_target/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/0_Intro/generic_target/saxpy.cpp b/samples/0_Intro/generic_target/saxpy.cpp index a7e063e25..f082d1a4d 100644 --- a/samples/0_Intro/generic_target/saxpy.cpp +++ b/samples/0_Intro/generic_target/saxpy.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2025 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/0_Intro/generic_target/square.cpp b/samples/0_Intro/generic_target/square.cpp index 5c3bece72..f562ad9bf 100644 --- a/samples/0_Intro/generic_target/square.cpp +++ b/samples/0_Intro/generic_target/square.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2024 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "hip/hip_runtime.h" diff --git a/samples/0_Intro/module_api/CMakeLists.txt b/samples/0_Intro/module_api/CMakeLists.txt index 89d7561f8..0e3665d47 100644 --- a/samples/0_Intro/module_api/CMakeLists.txt +++ b/samples/0_Intro/module_api/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) @@ -59,7 +43,7 @@ add_executable(defaultDriver.hip.out ${EXCLUDE_OPTION} defaultDriver.cpp) # Note: Build for all detected architectures to support multiple GPUs (like hipcc does) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vcpy_kernel.code - COMMAND ${CMAKE_HIP_COMPILER} -x hip --cuda-device-only ${OFFLOAD_ARCH_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/vcpy_kernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} -x hip --cuda-device-only ${OFFLOAD_ARCH_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/vcpy_kernel.code DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp COMMENT "Generating code object vcpy_kernel.code for ${CMAKE_HIP_ARCHITECTURES}" VERBATIM diff --git a/samples/0_Intro/module_api/defaultDriver.cpp b/samples/0_Intro/module_api/defaultDriver.cpp index 6eb9576cd..717bd1598 100644 --- a/samples/0_Intro/module_api/defaultDriver.cpp +++ b/samples/0_Intro/module_api/defaultDriver.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" #include diff --git a/samples/0_Intro/module_api/launchKernelHcc.cpp b/samples/0_Intro/module_api/launchKernelHcc.cpp index 160c2b97d..695f3deef 100644 --- a/samples/0_Intro/module_api/launchKernelHcc.cpp +++ b/samples/0_Intro/module_api/launchKernelHcc.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" #include "hip/hip_runtime_api.h" diff --git a/samples/0_Intro/module_api/runKernel.cpp b/samples/0_Intro/module_api/runKernel.cpp index b3bf68f73..54433dcdd 100644 --- a/samples/0_Intro/module_api/runKernel.cpp +++ b/samples/0_Intro/module_api/runKernel.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" #include "hip/hip_runtime_api.h" diff --git a/samples/0_Intro/module_api/vcpy_kernel.cpp b/samples/0_Intro/module_api/vcpy_kernel.cpp index 79877e4c9..0dbb1501b 100644 --- a/samples/0_Intro/module_api/vcpy_kernel.cpp +++ b/samples/0_Intro/module_api/vcpy_kernel.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" diff --git a/samples/0_Intro/module_api_global/CMakeLists.txt b/samples/0_Intro/module_api_global/CMakeLists.txt index 08ff5f013..2a0413e5f 100644 --- a/samples/0_Intro/module_api_global/CMakeLists.txt +++ b/samples/0_Intro/module_api_global/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) @@ -54,7 +38,7 @@ add_executable(runKernel1.hip.out ${EXCLUDE_OPTION} runKernel.cpp) # Note: Build for all detected architectures to support multiple GPUs (like hipcc does) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vcpy_kernel.code - COMMAND ${CMAKE_HIP_COMPILER} -x hip --cuda-device-only ${OFFLOAD_ARCH_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/vcpy_kernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} -x hip --cuda-device-only ${OFFLOAD_ARCH_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/vcpy_kernel.code DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/vcpy_kernel.cpp COMMENT "Generating code object vcpy_kernel.code for ${CMAKE_HIP_ARCHITECTURES}" VERBATIM diff --git a/samples/0_Intro/module_api_global/runKernel.cpp b/samples/0_Intro/module_api_global/runKernel.cpp index 4993b9f46..2d84b7bbb 100644 --- a/samples/0_Intro/module_api_global/runKernel.cpp +++ b/samples/0_Intro/module_api_global/runKernel.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2017 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" #include "hip/hip_runtime_api.h" diff --git a/samples/0_Intro/module_api_global/vcpy_kernel.cpp b/samples/0_Intro/module_api_global/vcpy_kernel.cpp index 0dfd5afb5..50e3b5b41 100644 --- a/samples/0_Intro/module_api_global/vcpy_kernel.cpp +++ b/samples/0_Intro/module_api_global/vcpy_kernel.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2017 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" diff --git a/samples/0_Intro/square/CMakeLists.txt b/samples/0_Intro/square/CMakeLists.txt index 78d81daa5..ff568de74 100644 --- a/samples/0_Intro/square/CMakeLists.txt +++ b/samples/0_Intro/square/CMakeLists.txt @@ -1,28 +1,47 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT #Follow "README.md" to generate square.cpp if it's missing cmake_minimum_required(VERSION 3.21) -if(UNIX) +# Platform-specific ROCM_PATH setup +if(WIN32) + if(NOT DEFINED ROCM_PATH) + if(DEFINED ENV{ROCM_PATH}) + set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") + elseif(DEFINED ENV{HIP_PATH}) + set(ROCM_PATH $ENV{HIP_PATH} CACHE STRING "ROCM Path from HIP_PATH") + else() + # Derive ROCM_PATH from compiler location (more reliable than relative source paths) + # CMAKE_CXX_COMPILER = .../build/lib/llvm/bin/clang++.exe -> go up 3 levels to get build dir + get_filename_component(COMPILER_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY) + get_filename_component(ROCM_PATH "${COMPILER_DIR}/../../.." ABSOLUTE) + set(ROCM_PATH "${ROCM_PATH}" CACHE STRING "ROCM Path (from compiler)") + endif() + endif() + + # CUDA path for hipify-clang on Windows + if(NOT DEFINED CUDA_PATH) + if(DEFINED ENV{CUDA_PATH}) + set(CUDA_PATH $ENV{CUDA_PATH} CACHE STRING "CUDA Path") + else() + # Auto-detect CUDA installation + file(GLOB CUDA_VERSIONS "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v*") + if(CUDA_VERSIONS) + list(SORT CUDA_VERSIONS) + list(GET CUDA_VERSIONS -1 CUDA_PATH) + set(CUDA_PATH "${CUDA_PATH}" CACHE STRING "CUDA Path (auto-detected)") + else() + message(FATAL_ERROR "CUDA not found. Please set CUDA_PATH environment variable or -DCUDA_PATH=") + endif() + endif() + endif() + + list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) + +elseif(UNIX) if(NOT DEFINED ROCM_PATH) if(DEFINED ENV{ROCM_PATH}) set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") @@ -36,15 +55,81 @@ endif() project(square LANGUAGES CXX HIP) -# create square.cpp -execute_process(COMMAND sh -c "${ROCM_PATH}/bin/hipify-perl \ - ${CMAKE_CURRENT_SOURCE_DIR}/square.cu > ${CMAKE_CURRENT_BINARY_DIR}/square.cpp") +# Create square.cpp using platform-specific hipify tool +set(SQUARE_CPP "${CMAKE_CURRENT_BINARY_DIR}/square.cpp") + +# Allow user to provide a pre-converted file +if(DEFINED HIPIFY_SKIP AND HIPIFY_SKIP) + if(NOT EXISTS "${SQUARE_CPP}") + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/square.cpp") + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/square.cpp" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") + else() + message(FATAL_ERROR "HIPIFY_SKIP is set but no square.cpp found.") + endif() + endif() +elseif(WIN32) + # On Windows, use hipify-clang.exe + + # Allow user to override CLANG_RESOURCE_DIR + if(NOT DEFINED CLANG_RESOURCE_DIR) + # Find clang resource directory - TheRock layout: ${ROCM_PATH}/lib/llvm/lib/clang/ + file(GLOB CLANG_VERSIONS "${ROCM_PATH}/lib/llvm/lib/clang/*") + if(CLANG_VERSIONS) + list(SORT CLANG_VERSIONS) + list(GET CLANG_VERSIONS -1 CLANG_RESOURCE_DIR) + else() + message(FATAL_ERROR "Clang resource directory not found. Please set -DCLANG_RESOURCE_DIR=") + endif() + endif() + + # Find hipify-clang.exe + find_program(HIPIFY_CLANG_EXE + NAMES hipify-clang.exe hipify-clang + HINTS + "${ROCM_PATH}/bin" + "$ENV{HIP_PATH}/bin" + ) + + if(NOT HIPIFY_CLANG_EXE) + set(HIPIFY_CLANG_EXE "${ROCM_PATH}/bin/hipify-clang.exe") + endif() + + # Convert all paths to use forward slashes consistently + file(TO_CMAKE_PATH "${CLANG_RESOURCE_DIR}" CLANG_RESOURCE_DIR_FWD) + file(TO_CMAKE_PATH "${CUDA_PATH}" CUDA_PATH_FWD) + file(TO_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/square.cu" SOURCE_FILE_FWD) + file(TO_CMAKE_PATH "${SQUARE_CPP}" OUTPUT_FILE_FWD) + + # Execute hipify-clang + execute_process( + COMMAND "${HIPIFY_CLANG_EXE}" + "--clang-resource-directory=${CLANG_RESOURCE_DIR_FWD}" + "--cuda-path=${CUDA_PATH_FWD}" + "${SOURCE_FILE_FWD}" + "-o" "${OUTPUT_FILE_FWD}" + RESULT_VARIABLE HIPIFY_RESULT + OUTPUT_VARIABLE HIPIFY_OUTPUT + ERROR_VARIABLE HIPIFY_ERROR + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + ) + + if(NOT HIPIFY_RESULT EQUAL 0) + if(NOT EXISTS "${SQUARE_CPP}") + message(FATAL_ERROR "hipify-clang failed. Error: ${HIPIFY_ERROR}") + endif() + endif() + +else() + # On Unix, use hipify-perl + execute_process(COMMAND sh -c "${ROCM_PATH}/bin/hipify-perl \ + ${CMAKE_CURRENT_SOURCE_DIR}/square.cu > ${CMAKE_CURRENT_BINARY_DIR}/square.cpp") +endif() # Create the excutable if(TARGET build_intro) -set(EXCLUDE_OPTION EXCLUDE_FROM_ALL) + set(EXCLUDE_OPTION EXCLUDE_FROM_ALL) else() -set(EXCLUDE_OPTION) + set(EXCLUDE_OPTION) endif() # Mark source file as HIP code (contains __global__ kernels) @@ -61,5 +146,5 @@ if(UNIX) endif() if(TARGET build_intro) -add_dependencies(build_intro square) + add_dependencies(build_intro square) endif() diff --git a/samples/0_Intro/square/square.cu b/samples/0_Intro/square/square.cu index cc1a21d61..00dd3fc9f 100644 --- a/samples/0_Intro/square/square.cu +++ b/samples/0_Intro/square/square.cu @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/0_Intro/square/square.hipref.cpp b/samples/0_Intro/square/square.hipref.cpp index a881d2a42..cbadd174b 100644 --- a/samples/0_Intro/square/square.hipref.cpp +++ b/samples/0_Intro/square/square.hipref.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "hip/hip_runtime.h" diff --git a/samples/1_Utils/CMakeLists.txt b/samples/1_Utils/CMakeLists.txt index 714316ed9..c853d16bb 100644 --- a/samples/1_Utils/CMakeLists.txt +++ b/samples/1_Utils/CMakeLists.txt @@ -1,22 +1,8 @@ -# Copyright (c) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT + +cmake_minimum_required(VERSION 3.21.3) add_custom_target(build_utils) add_subdirectory(hipDispatchLatency) add_subdirectory(hipInfo) \ No newline at end of file diff --git a/samples/1_Utils/hipDispatchLatency/CMakeLists.txt b/samples/1_Utils/hipDispatchLatency/CMakeLists.txt index 343c8bcfe..753c2d3b1 100644 --- a/samples/1_Utils/hipDispatchLatency/CMakeLists.txt +++ b/samples/1_Utils/hipDispatchLatency/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) @@ -58,7 +42,7 @@ add_executable(hipDispatchEnqueueRateMT ${EXCLUDE_OPTION} hipDispatchEnqueueRate # Note: Build for all detected architectures to support multiple GPUs (like hipcc does) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_kernel.code - COMMAND ${CMAKE_HIP_COMPILER} -x hip --cuda-device-only ${OFFLOAD_ARCH_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/test_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/test_kernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} -x hip --cuda-device-only ${OFFLOAD_ARCH_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/test_kernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/test_kernel.code DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/test_kernel.cpp COMMENT "Generating code object test_kernel.code for ${CMAKE_HIP_ARCHITECTURES}" VERBATIM @@ -86,4 +70,4 @@ set_property(TARGET hipDispatchEnqueueRateMT PROPERTY CXX_STANDARD 11) if(TARGET build_utils) add_dependencies(build_utils hipDispatchLatency hipDispatchEnqueueRateMT) -endif() \ No newline at end of file +endif() diff --git a/samples/1_Utils/hipDispatchLatency/hipDispatchEnqueueRateMT.cpp b/samples/1_Utils/hipDispatchLatency/hipDispatchEnqueueRateMT.cpp index 692b23b4f..4a2e3033c 100644 --- a/samples/1_Utils/hipDispatchLatency/hipDispatchEnqueueRateMT.cpp +++ b/samples/1_Utils/hipDispatchLatency/hipDispatchEnqueueRateMT.cpp @@ -1,21 +1,8 @@ /* -Copyright (c) 2020 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include "hip/hip_runtime.h" diff --git a/samples/1_Utils/hipDispatchLatency/hipDispatchLatency.cpp b/samples/1_Utils/hipDispatchLatency/hipDispatchLatency.cpp index 85af3d7a7..c99cafb53 100644 --- a/samples/1_Utils/hipDispatchLatency/hipDispatchLatency.cpp +++ b/samples/1_Utils/hipDispatchLatency/hipDispatchLatency.cpp @@ -1,21 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" #ifdef __HIP_PLATFORM_AMD__ diff --git a/samples/1_Utils/hipDispatchLatency/test_kernel.cpp b/samples/1_Utils/hipDispatchLatency/test_kernel.cpp index 272d67e29..75d993d25 100644 --- a/samples/1_Utils/hipDispatchLatency/test_kernel.cpp +++ b/samples/1_Utils/hipDispatchLatency/test_kernel.cpp @@ -1,21 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" diff --git a/samples/1_Utils/hipInfo/CMakeLists.txt b/samples/1_Utils/hipInfo/CMakeLists.txt index c0d6dfa51..4994d330b 100644 --- a/samples/1_Utils/hipInfo/CMakeLists.txt +++ b/samples/1_Utils/hipInfo/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/1_Utils/hipInfo/hipInfo.cpp b/samples/1_Utils/hipInfo/hipInfo.cpp index e41ce8152..77c8f8272 100644 --- a/samples/1_Utils/hipInfo/hipInfo.cpp +++ b/samples/1_Utils/hipInfo/hipInfo.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt b/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt index 4c46acb0a..e02608223 100644 --- a/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt +++ b/samples/2_Cookbook/0_MatrixTranspose/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/0_MatrixTranspose/MatrixTranspose.cpp b/samples/2_Cookbook/0_MatrixTranspose/MatrixTranspose.cpp index a7bd0059a..17216aa36 100644 --- a/samples/2_Cookbook/0_MatrixTranspose/MatrixTranspose.cpp +++ b/samples/2_Cookbook/0_MatrixTranspose/MatrixTranspose.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/10_inline_asm/CMakeLists.txt b/samples/2_Cookbook/10_inline_asm/CMakeLists.txt index ed5f7c284..68f7e410b 100644 --- a/samples/2_Cookbook/10_inline_asm/CMakeLists.txt +++ b/samples/2_Cookbook/10_inline_asm/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/10_inline_asm/inline_asm.cpp b/samples/2_Cookbook/10_inline_asm/inline_asm.cpp index de49a260f..2974e0d4a 100644 --- a/samples/2_Cookbook/10_inline_asm/inline_asm.cpp +++ b/samples/2_Cookbook/10_inline_asm/inline_asm.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/11_texture_driver/CMakeLists.txt b/samples/2_Cookbook/11_texture_driver/CMakeLists.txt index 45618bb4f..92871d99e 100644 --- a/samples/2_Cookbook/11_texture_driver/CMakeLists.txt +++ b/samples/2_Cookbook/11_texture_driver/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) @@ -46,7 +30,7 @@ else() set(EXCLUDE_OPTION) endif() -# Mark source files as HIP code +# Mark source files as HIP code set_source_files_properties(texture2dDrv.cpp PROPERTIES LANGUAGE HIP) set_source_files_properties(tex2dKernel.cpp PROPERTIES LANGUAGE HIP) @@ -56,7 +40,7 @@ add_executable(texture2dDrv ${EXCLUDE_OPTION} texture2dDrv.cpp) # Note: Build for all detected architectures to support multiple GPUs (like hipcc does) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/tex2dKernel.code - COMMAND ${CMAKE_HIP_COMPILER} -x hip --cuda-device-only ${OFFLOAD_ARCH_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tex2dKernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/tex2dKernel.code + COMMAND ${CMAKE_HIP_COMPILER} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} -x hip --cuda-device-only ${OFFLOAD_ARCH_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/tex2dKernel.cpp -o ${CMAKE_CURRENT_BINARY_DIR}/tex2dKernel.code DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tex2dKernel.cpp COMMENT "Generating code object tex2dKernel.code for ${CMAKE_HIP_ARCHITECTURES}" VERBATIM diff --git a/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp b/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp index d9295f3d8..c6e4cbb58 100644 --- a/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp +++ b/samples/2_Cookbook/11_texture_driver/tex2dKernel.cpp @@ -1,24 +1,9 @@ /* -Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ -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" extern "C" __global__ void tex2dKernelChar(char* outputData, hipTextureObject_t texObj, int width, diff --git a/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp b/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp index 93c1d3112..679af4ee3 100644 --- a/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp +++ b/samples/2_Cookbook/11_texture_driver/texture2dDrv.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" #include diff --git a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt index c716ff6e5..e7f0c37d4 100644 --- a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt +++ b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2021 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.10) if(UNIX) @@ -39,7 +23,13 @@ endif() # Search for rocm in common locations list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) -set(CMAKE_MODULE_PATH "${HIP_PATH}/lib/cmake/hip/" ${CMAKE_MODULE_PATH}) +# On Windows, FindHIP.cmake is installed in /cmake +# On Linux, FindHIP.cmake is installed in /lib/cmake/hip +if(WIN32) + set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH}) +else() + set(CMAKE_MODULE_PATH "${HIP_PATH}/lib/cmake/hip/" ${CMAKE_MODULE_PATH}) +endif() set(CMAKE_HIP_ARCHITECTURES OFF) # Set RPATH for all executables built with hip_add_executable diff --git a/samples/2_Cookbook/12_cmake_hip_add_executable/MatrixTranspose.cpp b/samples/2_Cookbook/12_cmake_hip_add_executable/MatrixTranspose.cpp index a7bd0059a..17216aa36 100644 --- a/samples/2_Cookbook/12_cmake_hip_add_executable/MatrixTranspose.cpp +++ b/samples/2_Cookbook/12_cmake_hip_add_executable/MatrixTranspose.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/12_cmake_hip_add_executable/Readme.md b/samples/2_Cookbook/12_cmake_hip_add_executable/Readme.md index 6c04e36aa..32231aea8 100644 --- a/samples/2_Cookbook/12_cmake_hip_add_executable/Readme.md +++ b/samples/2_Cookbook/12_cmake_hip_add_executable/Readme.md @@ -48,6 +48,8 @@ $ ./MatrixTranspose Device name PASSED! ``` +## On TheRock build : +Pass GPU arch to cmake i.e. -DHIP_HIPCC_FLAGS="--offload-arch=gfx1102" for windows. ## More Info: diff --git a/samples/2_Cookbook/13_occupancy/CMakeLists.txt b/samples/2_Cookbook/13_occupancy/CMakeLists.txt index f886615d5..46195e3c6 100644 --- a/samples/2_Cookbook/13_occupancy/CMakeLists.txt +++ b/samples/2_Cookbook/13_occupancy/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/13_occupancy/occupancy.cpp b/samples/2_Cookbook/13_occupancy/occupancy.cpp index 7fce284f2..0e9e42d3c 100644 --- a/samples/2_Cookbook/13_occupancy/occupancy.cpp +++ b/samples/2_Cookbook/13_occupancy/occupancy.cpp @@ -1,21 +1,8 @@ /* -Copyright (c) 2015 - 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" #include diff --git a/samples/2_Cookbook/14_gpu_arch/CMakeLists.txt b/samples/2_Cookbook/14_gpu_arch/CMakeLists.txt index 69f579e3d..934c09f39 100644 --- a/samples/2_Cookbook/14_gpu_arch/CMakeLists.txt +++ b/samples/2_Cookbook/14_gpu_arch/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/14_gpu_arch/gpuarch.cpp b/samples/2_Cookbook/14_gpu_arch/gpuarch.cpp index c0316445a..eaa3cd840 100644 --- a/samples/2_Cookbook/14_gpu_arch/gpuarch.cpp +++ b/samples/2_Cookbook/14_gpu_arch/gpuarch.cpp @@ -1,21 +1,8 @@ /* -Copyright (c) 2020 - 2021 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 WARRANNTY OF ANY KIND, EXPRESS OR -IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hip/hip_runtime.h" #include diff --git a/samples/2_Cookbook/15_static_library/device_functions/CMakeLists.txt b/samples/2_Cookbook/15_static_library/device_functions/CMakeLists.txt index ee155709a..874717743 100644 --- a/samples/2_Cookbook/15_static_library/device_functions/CMakeLists.txt +++ b/samples/2_Cookbook/15_static_library/device_functions/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) @@ -35,9 +19,43 @@ endif() project(static_lib LANGUAGES CXX HIP) # For windows, AR is MS Librarian and that is picked by Visual Studio's command prompt. +# If using LLVM/Clang toolchain, use llvm-ar instead. if(WIN32) - find_program(libpath NAMES lib.exe) - set(CMAKE_AR ${libpath}) + # Get the directory of the compiler + get_filename_component(LLVM_BIN_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY) + + # First try to find llvm-ar (for LLVM/Clang toolchain) + # LLVM_BIN_DIR is derived from CMAKE_CXX_COMPILER path + find_program(llvm_ar NAMES llvm-ar llvm-ar.exe + HINTS + "${LLVM_BIN_DIR}" + "$ENV{HIP_PATH}/bin" + "$ENV{ROCM_PATH}/llvm/bin" + ) + if(llvm_ar) + set(CMAKE_AR ${llvm_ar}) + else() + # Fall back to MSVC lib.exe + find_program(libpath NAMES lib.exe) + set(CMAKE_AR ${libpath}) + endif() + + # Find lld-link for linking + # LLVM_BIN_DIR is derived from CMAKE_CXX_COMPILER path + find_program(lld_link NAMES lld-link lld-link.exe + HINTS + "${LLVM_BIN_DIR}" + "$ENV{HIP_PATH}/bin" + "$ENV{ROCM_PATH}/llvm/bin" + ) + if(lld_link) + set(CMAKE_LINKER ${lld_link}) + # Use --ld-path= to specify full path to linker (works better than -fuse-ld= with full paths) + set(CMAKE_HIP_USING_LINKER_DEFAULT "--ld-path=${lld_link}") + set(CMAKE_HIP_USING_LINKER_LLD "--ld-path=${lld_link}") + set(CMAKE_CXX_USING_LINKER_DEFAULT "--ld-path=${lld_link}") + set(CMAKE_CXX_USING_LINKER_LLD "--ld-path=${lld_link}") + endif() endif() set(CMAKE_BUILD_TYPE Release) @@ -49,7 +67,14 @@ set(CPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hipDevice.cpp) # For windows, We need to tell cmake how to create static library. if(WIN32) - set(CMAKE_CXX_CREATE_STATIC_LIBRARY " /out: ") + if(llvm_ar) + # LLVM ar uses different syntax + set(CMAKE_CXX_CREATE_STATIC_LIBRARY " qc ") + set(CMAKE_HIP_CREATE_STATIC_LIBRARY " qc ") + else() + set(CMAKE_CXX_CREATE_STATIC_LIBRARY " /out: ") + set(CMAKE_HIP_CREATE_STATIC_LIBRARY " /out: ") + endif() endif() if(TARGET build_cookbook) @@ -76,14 +101,40 @@ add_executable(test_device_static ${EXCLUDE_OPTION} ${TEST_SOURCES}) add_dependencies(test_device_static HipDevice) target_compile_options(test_device_static PRIVATE -fgpu-rdc) +# Get the ROCm lib directory (three levels up from llvm/bin, then into lib) +if(WIN32) + get_filename_component(ROCM_LIB_DIR "${LLVM_BIN_DIR}/../../.." ABSOLUTE) + set(ROCM_LIB_DIR "${ROCM_LIB_DIR}/lib") +endif() + # For windows, Change in a way to pass lib details if(WIN32) - target_link_libraries(test_device_static PRIVATE -lHipDevice -L${CMAKE_CURRENT_BINARY_DIR}) + # Add library search paths for ROCm libraries + target_link_directories(test_device_static PRIVATE + ${CMAKE_CURRENT_BINARY_DIR} + "${ROCM_LIB_DIR}" + ) + target_link_libraries(test_device_static PRIVATE HipDevice) else() target_link_libraries(test_device_static PRIVATE HipDevice) endif() -target_link_libraries(test_device_static PRIVATE -fgpu-rdc amdhip64 amd_comgr) +target_link_libraries(test_device_static PRIVATE -fgpu-rdc) + +# Link ROCm runtime libraries +if(WIN32) + # Find the actual library files (amd_comgr may have version suffix like amd_comgr0702.lib) + file(GLOB AMD_COMGR_LIB "${ROCM_LIB_DIR}/amd_comgr*.lib") + if(NOT AMD_COMGR_LIB) + message(WARNING "amd_comgr library not found in ${ROCM_LIB_DIR}") + endif() + target_link_libraries(test_device_static PRIVATE + "${ROCM_LIB_DIR}/amdhip64.lib" + "${AMD_COMGR_LIB}" + ) +else() + target_link_libraries(test_device_static PRIVATE amdhip64 amd_comgr) +endif() # Set RPATH so executable can find HIP libraries at runtime if(UNIX) diff --git a/samples/2_Cookbook/15_static_library/device_functions/hipDevice.cpp b/samples/2_Cookbook/15_static_library/device_functions/hipDevice.cpp index 4c6c4831d..6ed1bdc10 100644 --- a/samples/2_Cookbook/15_static_library/device_functions/hipDevice.cpp +++ b/samples/2_Cookbook/15_static_library/device_functions/hipDevice.cpp @@ -1,24 +1,8 @@ /* - * Copyright (c) 2020 - 2021 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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. - * */ + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/15_static_library/device_functions/hipMain2.cpp b/samples/2_Cookbook/15_static_library/device_functions/hipMain2.cpp index e97bd8412..57bb7af15 100644 --- a/samples/2_Cookbook/15_static_library/device_functions/hipMain2.cpp +++ b/samples/2_Cookbook/15_static_library/device_functions/hipMain2.cpp @@ -1,24 +1,8 @@ /* - * Copyright (c) 2020 - 2021 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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. - * */ + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/15_static_library/host_functions/CMakeLists.txt b/samples/2_Cookbook/15_static_library/host_functions/CMakeLists.txt index 8028c292f..67f417e6a 100644 --- a/samples/2_Cookbook/15_static_library/host_functions/CMakeLists.txt +++ b/samples/2_Cookbook/15_static_library/host_functions/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) @@ -35,9 +19,43 @@ endif() project(static_lib LANGUAGES CXX HIP) # For windows, AR is MS Librarian and that is picked by Visual Studio's command prompt. +# If using LLVM/Clang toolchain, use llvm-ar instead. if(WIN32) - find_program(libpath NAMES lib.exe) - set(CMAKE_AR ${libpath}) + # Get the directory of the compiler + get_filename_component(LLVM_BIN_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY) + + # First try to find llvm-ar (for LLVM/Clang toolchain) + # LLVM_BIN_DIR is derived from CMAKE_CXX_COMPILER path + find_program(llvm_ar NAMES llvm-ar llvm-ar.exe + HINTS + "${LLVM_BIN_DIR}" + "$ENV{HIP_PATH}/bin" + "$ENV{ROCM_PATH}/llvm/bin" + ) + if(llvm_ar) + set(CMAKE_AR ${llvm_ar}) + else() + # Fall back to MSVC lib.exe + find_program(libpath NAMES lib.exe) + set(CMAKE_AR ${libpath}) + endif() + + # Find lld-link for linking + # LLVM_BIN_DIR is derived from CMAKE_CXX_COMPILER path + find_program(lld_link NAMES lld-link lld-link.exe + HINTS + "${LLVM_BIN_DIR}" + "$ENV{HIP_PATH}/bin" + "$ENV{ROCM_PATH}/llvm/bin" + ) + if(lld_link) + set(CMAKE_LINKER ${lld_link}) + # Use --ld-path= to specify full path to linker (works better than -fuse-ld= with full paths) + set(CMAKE_HIP_USING_LINKER_DEFAULT "--ld-path=${lld_link}") + set(CMAKE_HIP_USING_LINKER_LLD "--ld-path=${lld_link}") + set(CMAKE_CXX_USING_LINKER_DEFAULT "--ld-path=${lld_link}") + set(CMAKE_CXX_USING_LINKER_LLD "--ld-path=${lld_link}") + endif() endif() set(CMAKE_BUILD_TYPE Release) @@ -49,7 +67,14 @@ set(CPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/hipOptLibrary.cpp) # For windows, We need to tell cmake how to create static library. if(WIN32) - set(CMAKE_CXX_CREATE_STATIC_LIBRARY " /out: ") + if(llvm_ar) + # LLVM ar uses different syntax + set(CMAKE_CXX_CREATE_STATIC_LIBRARY " qc ") + set(CMAKE_HIP_CREATE_STATIC_LIBRARY " qc ") + else() + set(CMAKE_CXX_CREATE_STATIC_LIBRARY " /out: ") + set(CMAKE_HIP_CREATE_STATIC_LIBRARY " /out: ") + endif() endif() if(TARGET build_cookbook) @@ -69,15 +94,48 @@ add_library(HipOptLibrary ${EXCLUDE_OPTION} STATIC ${CPP_SOURCES}) # Set-up the correct flags to generate the static library target_link_options(HipOptLibrary PRIVATE --emit-static-lib) -target_include_directories(HipOptLibrary PRIVATE /opt/rocm/hsa/include) + +# Include directory for HSA headers +if(WIN32) + # On Windows, use path relative to LLVM_BIN_DIR or skip if not needed + # HSA headers location varies; add if available +else() + target_include_directories(HipOptLibrary PRIVATE ${ROCM_PATH}/hsa/include) +endif() # Create test executable that uses libHipOptLibrary.a add_executable(test_opt_static ${EXCLUDE_OPTION} ${TEST_SOURCES}) add_dependencies(test_opt_static HipOptLibrary) -target_link_libraries(test_opt_static PRIVATE -lHipOptLibrary -L${CMAKE_CURRENT_BINARY_DIR}) +# Get the ROCm lib directory (three levels up from llvm/bin, then into lib) if(WIN32) - target_link_libraries(test_opt_static PRIVATE amdhip64 amd_comgr) + get_filename_component(ROCM_LIB_DIR "${LLVM_BIN_DIR}/../../.." ABSOLUTE) + set(ROCM_LIB_DIR "${ROCM_LIB_DIR}/lib") +endif() + +# Link the static library +if(WIN32) + # Add library search paths for ROCm libraries + target_link_directories(test_opt_static PRIVATE + ${CMAKE_CURRENT_BINARY_DIR} + "${ROCM_LIB_DIR}" + ) + target_link_libraries(test_opt_static PRIVATE HipOptLibrary) +else() + target_link_libraries(test_opt_static PRIVATE -lHipOptLibrary -L${CMAKE_CURRENT_BINARY_DIR}) +endif() + +# Link ROCm runtime libraries +if(WIN32) + # Find the actual library files (amd_comgr may have version suffix like amd_comgr0702.lib) + file(GLOB AMD_COMGR_LIB "${ROCM_LIB_DIR}/amd_comgr*.lib") + if(NOT AMD_COMGR_LIB) + message(WARNING "amd_comgr library not found in ${ROCM_LIB_DIR}") + endif() + target_link_libraries(test_opt_static PRIVATE + "${ROCM_LIB_DIR}/amdhip64.lib" + "${AMD_COMGR_LIB}" + ) else() target_link_libraries(test_opt_static PRIVATE amdhip64 amd_comgr hsa-runtime64) endif() diff --git a/samples/2_Cookbook/15_static_library/host_functions/hipMain1.cpp b/samples/2_Cookbook/15_static_library/host_functions/hipMain1.cpp index 86431a75c..dbc0fcc2a 100644 --- a/samples/2_Cookbook/15_static_library/host_functions/hipMain1.cpp +++ b/samples/2_Cookbook/15_static_library/host_functions/hipMain1.cpp @@ -1,24 +1,8 @@ /* - * Copyright (c) 2020 - 2021 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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. - * */ + * SPDX-License-Identifier: MIT + */ extern void run_test1(); diff --git a/samples/2_Cookbook/15_static_library/host_functions/hipOptLibrary.cpp b/samples/2_Cookbook/15_static_library/host_functions/hipOptLibrary.cpp index 3c6b98ace..fced840e1 100644 --- a/samples/2_Cookbook/15_static_library/host_functions/hipOptLibrary.cpp +++ b/samples/2_Cookbook/15_static_library/host_functions/hipOptLibrary.cpp @@ -1,24 +1,8 @@ /* - * Copyright (c) 2020 - 2021 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * - * 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. - * */ + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/16_assembly_to_executable/CMakeLists.txt b/samples/2_Cookbook/16_assembly_to_executable/CMakeLists.txt index 32ad1a30a..c1c9490f2 100644 --- a/samples/2_Cookbook/16_assembly_to_executable/CMakeLists.txt +++ b/samples/2_Cookbook/16_assembly_to_executable/CMakeLists.txt @@ -1,26 +1,26 @@ -# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) -if(UNIX) +# Windows ROCM_PATH setup +if(WIN32) + if(NOT DEFINED ROCM_PATH) + if(DEFINED ENV{ROCM_PATH}) + set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") + elseif(DEFINED ENV{HIP_PATH}) + set(ROCM_PATH $ENV{HIP_PATH} CACHE STRING "ROCM Path from HIP_PATH") + else() + # Derive from compiler path + get_filename_component(COMPILER_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY) + get_filename_component(ROCM_PATH "${COMPILER_DIR}/../../.." ABSOLUTE) + set(ROCM_PATH "${ROCM_PATH}" CACHE STRING "ROCM Path (from compiler)") + endif() + endif() + set(HIP_PATH ${ROCM_PATH}) + list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) +elseif(UNIX) if(NOT DEFINED ROCM_PATH) if(DEFINED ENV{ROCM_PATH}) set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") @@ -45,20 +45,43 @@ find_package(hip REQUIRED) # Set compiler and toolchain paths - using amdclang++ directly set(HIP_CLANG ${CMAKE_HIP_COMPILER}) -set(CLANG ${HIP_PATH}/llvm/bin/clang) -set(LLVM_MC ${HIP_PATH}/llvm/bin/llvm-mc) -set(CLANG_OFFLOAD_BUNDLER ${HIP_PATH}/llvm/bin/clang-offload-bundler) +if(WIN32) + set(CLANG "${ROCM_PATH}/lib/llvm/bin/clang.exe") + set(LLVM_MC "${ROCM_PATH}/lib/llvm/bin/llvm-mc.exe") + set(CLANG_OFFLOAD_BUNDLER "${ROCM_PATH}/lib/llvm/bin/clang-offload-bundler.exe") +else() + set(CLANG ${HIP_PATH}/llvm/bin/clang) + set(LLVM_MC ${HIP_PATH}/llvm/bin/llvm-mc) + set(CLANG_OFFLOAD_BUNDLER ${HIP_PATH}/llvm/bin/clang-offload-bundler) +endif() set(INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../../common) set(SRCS ${CMAKE_CURRENT_SOURCE_DIR}/square.cpp) set(SQ_HOST_ASM ${CMAKE_CURRENT_BINARY_DIR}/square_host.s) -set(SQ_HOST_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_host.o) +if(WIN32) + set(SQ_HOST_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_host.obj) + set(SQ_DEVICE_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_device.obj) + set(SQ_ASM_EXE ${CMAKE_CURRENT_BINARY_DIR}/square_asm.exe) + set(OBJ_EXT ".obj") + set(HOST_TARGET "x86_64-pc-windows-msvc") + set(NULL_DEVICE "NUL") +else() + set(SQ_HOST_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_host.o) + set(SQ_DEVICE_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_device.o) + set(SQ_ASM_EXE ${CMAKE_CURRENT_BINARY_DIR}/square_asm.out) + set(OBJ_EXT ".o") + set(HOST_TARGET "x86_64-linux-gnu") + set(NULL_DEVICE "/dev/null") +endif() set(SQ_DEVICE_HIPFB ${CMAKE_CURRENT_BINARY_DIR}/offload_bundle.hipfb) -set(SQ_DEVICE_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_device.o) -set(SQ_ASM_EXE ${CMAKE_CURRENT_BINARY_DIR}/square_asm.out) -set(MCIN_OBJ_GEN ${CMAKE_CURRENT_SOURCE_DIR}/hip_obj_gen.mcin) +# Use platform-specific mcin file (ELF vs COFF assembly syntax) +if(WIN32) + set(MCIN_OBJ_GEN ${CMAKE_CURRENT_SOURCE_DIR}/hip_obj_gen_win.mcin) +else() + set(MCIN_OBJ_GEN ${CMAKE_CURRENT_SOURCE_DIR}/hip_obj_gen.mcin) +endif() # Append Current device arch from amdgpu-arch # if amdgpu-arch is not found, support --offload-arch @@ -69,7 +92,12 @@ else() set(ARCH_PATH "${ROCM_PATH}/bin/amdgpu-arch") endif() -if(NOT DEFINED OFFLOAD_ARCH_STR +# On Windows, prefer CMAKE_HIP_ARCHITECTURES if set +if(WIN32 AND DEFINED CMAKE_HIP_ARCHITECTURES AND NOT CMAKE_HIP_ARCHITECTURES STREQUAL "") + foreach(_hip_gpu_arch ${CMAKE_HIP_ARCHITECTURES}) + list(APPEND GPU_ARCH ${_hip_gpu_arch}) + endforeach() +elseif(NOT DEFINED OFFLOAD_ARCH_STR AND EXISTS "${ARCH_PATH}" AND HIP_PLATFORM STREQUAL "amd") execute_process(COMMAND "${ARCH_PATH}" @@ -99,29 +127,52 @@ else() set(ALL_OPTION ALL) endif() +string(TOUPPER "${CMAKE_BUILD_TYPE}" _HIP_BUILD_TYPE_UPPER) +separate_arguments(HIP_DEVICE_BUILD_FLAGS_NO_ARCH NATIVE_COMMAND + "${CMAKE_HIP_FLAGS} ${CMAKE_HIP_FLAGS_${_HIP_BUILD_TYPE_UPPER}}") +list(FILTER HIP_DEVICE_BUILD_FLAGS_NO_ARCH EXCLUDE REGEX "--offload-arch=") + list(JOIN GPU_ARCH "," OFFLOAD_ARCH) add_custom_target(src_to_asm ${ALL_OPTION} - COMMAND ${HIP_CLANG} -x hip -c -S -I${INCLUDES} --cuda-host-only -fuse-cuid=none -target x86_64-linux-gnu -o ${SQ_HOST_ASM} ${SRCS} - COMMAND ${HIP_CLANG} -x hip -c -S -I${INCLUDES} --cuda-device-only --offload-arch=${OFFLOAD_ARCH} ${SRCS} + COMMAND ${HIP_CLANG} -x hip -c -S -I${INCLUDES} --cuda-host-only -fuse-cuid=none -target ${HOST_TARGET} -o ${SQ_HOST_ASM} ${SRCS} + COMMAND ${HIP_CLANG} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} -x hip -c -S -I${INCLUDES} --cuda-device-only --offload-arch=${OFFLOAD_ARCH} ${SRCS} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -add_custom_command(OUTPUT host_obj COMMAND ${HIP_CLANG} -c ${SQ_HOST_ASM} -o ${SQ_HOST_OBJ}) +add_custom_command(OUTPUT host_obj + COMMAND ${HIP_CLANG} -c ${SQ_HOST_ASM} -o ${SQ_HOST_OBJ} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) foreach(ARCH ${GPU_ARCH}) list(APPEND TARGETS hip-amdgcn-amd-amdhsa--${ARCH}) - list(APPEND INPUTS square-hip-amdgcn-amd-amdhsa-${ARCH}.o) + list(APPEND INPUTS square-hip-amdgcn-amd-amdhsa-${ARCH}${OBJ_EXT}) set(arch_obj ${ARCH}_obj) - add_custom_command(OUTPUT ${arch_obj} COMMAND ${CLANG} -target amdgcn-amd-amdhsa -mcpu=${ARCH} square-hip-amdgcn-amd-amdhsa-${ARCH}.s -o square-hip-amdgcn-amd-amdhsa-${ARCH}.o) + add_custom_command(OUTPUT ${arch_obj} + COMMAND ${CLANG} -target amdgcn-amd-amdhsa -mcpu=${ARCH} square-hip-amdgcn-amd-amdhsa-${ARCH}.s -o square-hip-amdgcn-amd-amdhsa-${ARCH}${OBJ_EXT} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) list(APPEND arch_obj_targets ${arch_obj}) endforeach() list(JOIN TARGETS "," TARGET_STR) list(TRANSFORM INPUTS PREPEND "-input=") -add_custom_target(asm_to_exec ${ALL_OPTION} DEPENDS src_to_asm host_obj ${arch_obj_targets} - COMMAND ${CLANG_OFFLOAD_BUNDLER} -type=o -bundle-align=4096 -targets=host-x86_64-unknown--linux,${TARGET_STR} -input=/dev/null ${INPUTS} -output=${SQ_DEVICE_HIPFB} - COMMAND ${LLVM_MC} ${MCIN_OBJ_GEN} -o ${SQ_DEVICE_OBJ} --filetype=obj - COMMAND ${HIP_CLANG} ${SQ_HOST_OBJ} ${SQ_DEVICE_OBJ} -o ${SQ_ASM_EXE} -L${ROCM_PATH}/lib -lamdhip64 -Wl,-rpath,${ROCM_PATH}/lib -) + +if(WIN32) + set(BUNDLE_HOST_TARGET "host-x86_64-pc-windows-msvc") + add_custom_target(asm_to_exec ${ALL_OPTION} DEPENDS src_to_asm host_obj ${arch_obj_targets} + COMMAND ${CLANG_OFFLOAD_BUNDLER} -type=o -bundle-align=4096 -targets=${BUNDLE_HOST_TARGET},${TARGET_STR} -input=${NULL_DEVICE} ${INPUTS} -output=${SQ_DEVICE_HIPFB} + COMMAND ${LLVM_MC} ${MCIN_OBJ_GEN} -o ${SQ_DEVICE_OBJ} --filetype=obj -triple=x86_64-pc-windows-msvc + COMMAND ${HIP_CLANG} ${SQ_HOST_OBJ} ${SQ_DEVICE_OBJ} -o ${SQ_ASM_EXE} -L${ROCM_PATH}/lib ${ROCM_PATH}/lib/amdhip64.lib + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) +else() + add_custom_target(asm_to_exec ${ALL_OPTION} DEPENDS src_to_asm host_obj ${arch_obj_targets} + COMMAND ${CLANG_OFFLOAD_BUNDLER} -type=o -bundle-align=4096 -targets=host-x86_64-unknown--linux,${TARGET_STR} -input=/dev/null ${INPUTS} -output=${SQ_DEVICE_HIPFB} + COMMAND ${LLVM_MC} ${MCIN_OBJ_GEN} -o ${SQ_DEVICE_OBJ} --filetype=obj + COMMAND ${HIP_CLANG} ${SQ_HOST_OBJ} ${SQ_DEVICE_OBJ} -o ${SQ_ASM_EXE} -L${ROCM_PATH}/lib -lamdhip64 -Wl,-rpath,${ROCM_PATH}/lib + ) +endif() if(TARGET build_cookbook) add_dependencies(build_cookbook src_to_asm asm_to_exec) diff --git a/samples/2_Cookbook/16_assembly_to_executable/square.cpp b/samples/2_Cookbook/16_assembly_to_executable/square.cpp index e1ae16964..175215202 100644 --- a/samples/2_Cookbook/16_assembly_to_executable/square.cpp +++ b/samples/2_Cookbook/16_assembly_to_executable/square.cpp @@ -1,21 +1,8 @@ /* -Copyright (c) 2020 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/17_llvm_ir_to_executable/CMakeLists.txt b/samples/2_Cookbook/17_llvm_ir_to_executable/CMakeLists.txt index ddf904caa..d1154b11b 100644 --- a/samples/2_Cookbook/17_llvm_ir_to_executable/CMakeLists.txt +++ b/samples/2_Cookbook/17_llvm_ir_to_executable/CMakeLists.txt @@ -1,26 +1,23 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) -if(UNIX) +# Windows ROCM_PATH setup +if(WIN32) + if(NOT DEFINED ROCM_PATH) + if(DEFINED ENV{ROCM_PATH}) + set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") + elseif(DEFINED ENV{HIP_PATH}) + set(ROCM_PATH $ENV{HIP_PATH} CACHE STRING "ROCM Path from HIP_PATH") + endif() + endif() + if(DEFINED ROCM_PATH) + set(HIP_PATH ${ROCM_PATH}) + list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) + endif() +elseif(UNIX) if(NOT DEFINED ROCM_PATH) if(DEFINED ENV{ROCM_PATH}) set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") @@ -45,23 +42,48 @@ find_package(hip REQUIRED) # Set compiler and toolchain paths - using amdclang++ directly set(HIP_CLANG ${CMAKE_HIP_COMPILER}) -set(CLANG ${HIP_PATH}/llvm/bin/clang) -set(LLVM_MC ${HIP_PATH}/llvm/bin/llvm-mc) -set(CLANG_OFFLOAD_BUNDLER ${HIP_PATH}/llvm/bin/clang-offload-bundler) -set(LLVM_AS ${HIP_PATH}/llvm/bin/llvm-as) -set(LLVM_DIS ${HIP_PATH}/llvm/bin/llvm-dis) +if(WIN32) + set(CLANG "${ROCM_PATH}/lib/llvm/bin/clang.exe") + set(LLVM_MC "${ROCM_PATH}/lib/llvm/bin/llvm-mc.exe") + set(CLANG_OFFLOAD_BUNDLER "${ROCM_PATH}/lib/llvm/bin/clang-offload-bundler.exe") + set(LLVM_AS "${ROCM_PATH}/lib/llvm/bin/llvm-as.exe") + set(LLVM_DIS "${ROCM_PATH}/lib/llvm/bin/llvm-dis.exe") +else() + set(CLANG ${HIP_PATH}/llvm/bin/clang) + set(LLVM_MC ${HIP_PATH}/llvm/bin/llvm-mc) + set(CLANG_OFFLOAD_BUNDLER ${HIP_PATH}/llvm/bin/clang-offload-bundler) + set(LLVM_AS ${HIP_PATH}/llvm/bin/llvm-as) + set(LLVM_DIS ${HIP_PATH}/llvm/bin/llvm-dis) +endif() set(INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../../common) set(SRCS ${CMAKE_CURRENT_SOURCE_DIR}/square.cpp) set(SQ_HOST_BC ${CMAKE_CURRENT_BINARY_DIR}/square_host.bc) set(SQ_HOST_LL ${CMAKE_CURRENT_BINARY_DIR}/square_host.ll) -set(SQ_HOST_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_host.o) +if(WIN32) + set(SQ_HOST_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_host.obj) + set(SQ_DEVICE_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_device.obj) + set(SQ_IR_EXE ${CMAKE_CURRENT_BINARY_DIR}/square_ir.exe) + set(OBJ_EXT ".obj") + set(HOST_TARGET "x86_64-pc-windows-msvc") + set(NULL_DEVICE "NUL") +else() + set(SQ_HOST_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_host.o) + set(SQ_DEVICE_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_device.o) + set(SQ_IR_EXE ${CMAKE_CURRENT_BINARY_DIR}/square_ir.out) + set(OBJ_EXT ".o") + set(HOST_TARGET "x86_64-linux-gnu") + set(NULL_DEVICE "/dev/null") +endif() set(SQ_DEVICE_HIPFB ${CMAKE_CURRENT_BINARY_DIR}/offload_bundle.hipfb) -set(SQ_DEVICE_OBJ ${CMAKE_CURRENT_BINARY_DIR}/square_device.o) -set(SQ_IR_EXE ${CMAKE_CURRENT_BINARY_DIR}/square_ir.out) -set(MCIN_OBJ_GEN ${CMAKE_CURRENT_SOURCE_DIR}/hip_obj_gen.mcin) +# Use platform-specific mcin file (ELF vs COFF assembly syntax) +if(WIN32) + set(MCIN_OBJ_GEN ${CMAKE_CURRENT_SOURCE_DIR}/hip_obj_gen_win.mcin) +else() + set(MCIN_OBJ_GEN ${CMAKE_CURRENT_SOURCE_DIR}/hip_obj_gen.mcin) +endif() # Append Current device arch from amdgpu-arch # if amdgpu-arch is not found, support --offload-arch @@ -73,7 +95,12 @@ else() set(ARCH_PATH "${ROCM_PATH}/bin/amdgpu-arch") endif() -if(NOT DEFINED OFFLOAD_ARCH_STR +# On Windows, prefer CMAKE_HIP_ARCHITECTURES if set +if(WIN32 AND DEFINED CMAKE_HIP_ARCHITECTURES AND NOT CMAKE_HIP_ARCHITECTURES STREQUAL "") + foreach(_hip_gpu_arch ${CMAKE_HIP_ARCHITECTURES}) + list(APPEND GPU_ARCH ${_hip_gpu_arch}) + endforeach() +elseif(NOT DEFINED OFFLOAD_ARCH_STR AND EXISTS "${ARCH_PATH}" AND HIP_PLATFORM STREQUAL "amd") execute_process(COMMAND "${ARCH_PATH}" @@ -103,51 +130,86 @@ else() set(ALL_OPTION ALL) endif() +string(TOUPPER "${CMAKE_BUILD_TYPE}" _HIP_BUILD_TYPE_UPPER) +separate_arguments(HIP_DEVICE_BUILD_FLAGS_NO_ARCH NATIVE_COMMAND + "${CMAKE_HIP_FLAGS} ${CMAKE_HIP_FLAGS_${_HIP_BUILD_TYPE_UPPER}}") +list(FILTER HIP_DEVICE_BUILD_FLAGS_NO_ARCH EXCLUDE REGEX "--offload-arch=") + list(JOIN GPU_ARCH "," OFFLOAD_ARCH) add_custom_target(src_to_ir ${ALL_OPTION} - COMMAND ${HIP_CLANG} -x hip -c -emit-llvm -I${INCLUDES} --cuda-host-only -fuse-cuid=none -target x86_64-linux-gnu -o ${SQ_HOST_BC} ${SRCS} - COMMAND ${HIP_CLANG} -x hip -c -emit-llvm -I${INCLUDES} --cuda-device-only --offload-arch=${OFFLOAD_ARCH} ${SRCS} + COMMAND ${HIP_CLANG} -x hip -c -emit-llvm -I${INCLUDES} --cuda-host-only -fuse-cuid=none -target ${HOST_TARGET} -o ${SQ_HOST_BC} ${SRCS} + COMMAND ${HIP_CLANG} ${HIP_DEVICE_BUILD_FLAGS_NO_ARCH} -x hip -c -emit-llvm -I${INCLUDES} --cuda-device-only --offload-arch=${OFFLOAD_ARCH} ${SRCS} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) # Target for BC to LL -add_custom_command(OUTPUT ll_obj COMMAND ${LLVM_DIS} ${SQ_HOST_BC} -o ${SQ_HOST_LL}) +add_custom_command(OUTPUT ll_obj + COMMAND ${LLVM_DIS} ${SQ_HOST_BC} -o ${SQ_HOST_LL} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) foreach(ARCH ${GPU_ARCH}) set(arch_obj ${ARCH}_ll_obj) - add_custom_command(OUTPUT ${arch_obj} COMMAND ${LLVM_DIS} square-hip-amdgcn-amd-amdhsa-${ARCH}.bc -o square-hip-amdgcn-amd-amdhsa-${ARCH}.ll) + add_custom_command(OUTPUT ${arch_obj} + COMMAND ${LLVM_DIS} square-hip-amdgcn-amd-amdhsa-${ARCH}.bc -o square-hip-amdgcn-amd-amdhsa-${ARCH}.ll + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) list(APPEND arch_ll_obj ${arch_obj}) endforeach() add_custom_target(bc_to_ll ${ALL_OPTION} DEPENDS src_to_ir ll_obj ${arch_ll_obj}) # Target for LL to BC -add_custom_command(OUTPUT bc_obj COMMAND ${LLVM_AS} ${SQ_HOST_LL} -o ${SQ_HOST_BC}) +add_custom_command(OUTPUT bc_obj + COMMAND ${LLVM_AS} ${SQ_HOST_LL} -o ${SQ_HOST_BC} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) foreach(ARCH ${GPU_ARCH}) set(arch_obj ${ARCH}_bc_obj) - add_custom_command(OUTPUT ${arch_obj} COMMAND ${LLVM_AS} square-hip-amdgcn-amd-amdhsa-${ARCH}.ll -o square-hip-amdgcn-amd-amdhsa-${ARCH}.bc) + add_custom_command(OUTPUT ${arch_obj} + COMMAND ${LLVM_AS} square-hip-amdgcn-amd-amdhsa-${ARCH}.ll -o square-hip-amdgcn-amd-amdhsa-${ARCH}.bc + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) list(APPEND arch_bc_obj ${arch_obj}) endforeach() add_custom_target(ll_to_bc ${ALL_OPTION} DEPENDS bc_to_ll bc_obj ${arch_bc_obj}) # Target for IR to EXEC -add_custom_command(OUTPUT host_obj COMMAND ${HIP_CLANG} -c ${SQ_HOST_BC} -o ${SQ_HOST_OBJ}) +add_custom_command(OUTPUT host_obj + COMMAND ${HIP_CLANG} -c ${SQ_HOST_BC} -o ${SQ_HOST_OBJ} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +) foreach(ARCH ${GPU_ARCH}) set(arch_obj ${ARCH}_obj) - add_custom_command(OUTPUT ${arch_obj} COMMAND ${CLANG} -target amdgcn-amd-amdhsa -mcpu=${ARCH} square-hip-amdgcn-amd-amdhsa-${ARCH}.bc -o square-hip-amdgcn-amd-amdhsa-${ARCH}.o) + add_custom_command(OUTPUT ${arch_obj} + COMMAND ${CLANG} -target amdgcn-amd-amdhsa -mcpu=${ARCH} square-hip-amdgcn-amd-amdhsa-${ARCH}.bc -o square-hip-amdgcn-amd-amdhsa-${ARCH}${OBJ_EXT} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) list(APPEND arch_obj_list ${arch_obj}) list(APPEND TARGETS hip-amdgcn-amd-amdhsa--${ARCH}) - list(APPEND INPUTS square-hip-amdgcn-amd-amdhsa-${ARCH}.o) + list(APPEND INPUTS square-hip-amdgcn-amd-amdhsa-${ARCH}${OBJ_EXT}) endforeach() list(JOIN TARGETS "," TARGET_STR) list(TRANSFORM INPUTS PREPEND "-input=") -add_custom_target(ir_to_exec ${ALL_OPTION} DEPENDS ll_to_bc host_obj ${arch_obj_list} - COMMAND ${CLANG_OFFLOAD_BUNDLER} -type=o -bundle-align=4096 -targets=host-x86_64-unknown--linux,${TARGET_STR} -input=/dev/null ${INPUTS} -output=${SQ_DEVICE_HIPFB} - COMMAND ${LLVM_MC} ${MCIN_OBJ_GEN} -o ${SQ_DEVICE_OBJ} --filetype=obj - COMMAND ${HIP_CLANG} ${SQ_HOST_OBJ} ${SQ_DEVICE_OBJ} -o ${SQ_IR_EXE} -L${ROCM_PATH}/lib -lamdhip64 -Wl,-rpath,${ROCM_PATH}/lib -) + +if(WIN32) + set(BUNDLE_HOST_TARGET "host-x86_64-pc-windows-msvc") + add_custom_target(ir_to_exec ${ALL_OPTION} DEPENDS ll_to_bc host_obj ${arch_obj_list} + COMMAND ${CLANG_OFFLOAD_BUNDLER} -type=o -bundle-align=4096 -targets=${BUNDLE_HOST_TARGET},${TARGET_STR} -input=${NULL_DEVICE} ${INPUTS} -output=${SQ_DEVICE_HIPFB} + COMMAND ${LLVM_MC} ${MCIN_OBJ_GEN} -o ${SQ_DEVICE_OBJ} --filetype=obj -triple=x86_64-pc-windows-msvc + COMMAND ${HIP_CLANG} ${SQ_HOST_OBJ} ${SQ_DEVICE_OBJ} -o ${SQ_IR_EXE} -L${ROCM_PATH}/lib ${ROCM_PATH}/lib/amdhip64.lib + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) +else() + add_custom_target(ir_to_exec ${ALL_OPTION} DEPENDS ll_to_bc host_obj ${arch_obj_list} + COMMAND ${CLANG_OFFLOAD_BUNDLER} -type=o -bundle-align=4096 -targets=host-x86_64-unknown--linux,${TARGET_STR} -input=/dev/null ${INPUTS} -output=${SQ_DEVICE_HIPFB} + COMMAND ${LLVM_MC} ${MCIN_OBJ_GEN} -o ${SQ_DEVICE_OBJ} --filetype=obj + COMMAND ${HIP_CLANG} ${SQ_HOST_OBJ} ${SQ_DEVICE_OBJ} -o ${SQ_IR_EXE} -L${ROCM_PATH}/lib -lamdhip64 -Wl,-rpath,${ROCM_PATH}/lib + ) +endif() if(TARGET build_cookbook) add_dependencies(build_cookbook src_to_ir bc_to_ll ll_to_bc ir_to_exec) diff --git a/samples/2_Cookbook/17_llvm_ir_to_executable/square.cpp b/samples/2_Cookbook/17_llvm_ir_to_executable/square.cpp index 516dd942d..6f069e1c3 100644 --- a/samples/2_Cookbook/17_llvm_ir_to_executable/square.cpp +++ b/samples/2_Cookbook/17_llvm_ir_to_executable/square.cpp @@ -1,21 +1,8 @@ /* -Copyright (c) 2020 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/18_cmake_hip_device/CMakeLists.txt b/samples/2_Cookbook/18_cmake_hip_device/CMakeLists.txt index 3cbebb242..8292c5453 100644 --- a/samples/2_Cookbook/18_cmake_hip_device/CMakeLists.txt +++ b/samples/2_Cookbook/18_cmake_hip_device/CMakeLists.txt @@ -1,30 +1,23 @@ -# Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. - -project(cmake_hip_device_test) +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.10.2) -include_directories(../../common) - -if(UNIX) +# Windows ROCM_PATH setup +if(WIN32) + if(NOT DEFINED ROCM_PATH) + if(DEFINED ENV{ROCM_PATH}) + set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") + elseif(DEFINED ENV{HIP_PATH}) + set(ROCM_PATH $ENV{HIP_PATH} CACHE STRING "ROCM Path from HIP_PATH") + endif() + endif() + if(DEFINED ROCM_PATH) + list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) + endif() + set(CMAKE_CXX_COMPILER "${ROCM_PATH}/lib/llvm/bin/clang++.exe") +elseif(UNIX) if(NOT DEFINED ROCM_PATH) if(DEFINED ENV{ROCM_PATH}) set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") @@ -36,7 +29,14 @@ if(UNIX) list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) endif() -set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++") +project(cmake_hip_device_test) + +# Set compiler after project() for Linux to avoid reconfiguration loop in subdirectory builds +if(UNIX) + set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++") +endif() + +include_directories(../../common) # Find hip find_package(hip REQUIRED) @@ -51,6 +51,13 @@ add_executable(test_cpp ${EXCLUDE_OPTION} square.cpp) target_include_directories(test_cpp PRIVATE ../../common) +# Add GPU architecture for device code compilation +if(WIN32 AND DEFINED CMAKE_HIP_ARCHITECTURES) + foreach(_arch ${CMAKE_HIP_ARCHITECTURES}) + target_compile_options(test_cpp PRIVATE --offload-arch=${_arch}) + endforeach() +endif() + # Link with HIP target_link_libraries(test_cpp hip::device) diff --git a/samples/2_Cookbook/18_cmake_hip_device/square.cpp b/samples/2_Cookbook/18_cmake_hip_device/square.cpp index abe38338d..95feab79a 100644 --- a/samples/2_Cookbook/18_cmake_hip_device/square.cpp +++ b/samples/2_Cookbook/18_cmake_hip_device/square.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015-2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/19_cmake_lang/CMakeLists.txt b/samples/2_Cookbook/19_cmake_lang/CMakeLists.txt index 08f79e90f..0d94d66c4 100644 --- a/samples/2_Cookbook/19_cmake_lang/CMakeLists.txt +++ b/samples/2_Cookbook/19_cmake_lang/CMakeLists.txt @@ -1,6 +1,16 @@ +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. +# +# SPDX-License-Identifier: MIT + # The test must be with CMake 3.18 or above which supports LINK_LANGUAGE that is necessary for # Fortran build. cmake_minimum_required(VERSION 3.18.0) +# Flang (LLVM Fortran) is available in TheRock on Windows, but CMake doesn't fully support it yet. +# CMake fails with "Fortran compiler identification is unknown" for LLVM Flang. +if(WIN32) + message(STATUS "This sample is disabled on Windows - CMake doesn't fully support LLVM Flang yet.") + return() +endif() if(ENABLE_ADDRESS_SANITIZER) message(STATUS "This fortran sample is temporarily disabled due to SWDEV-462616.") return() diff --git a/samples/2_Cookbook/19_cmake_lang/MatrixTranspose.cpp b/samples/2_Cookbook/19_cmake_lang/MatrixTranspose.cpp index 97789ae7b..c73dd0443 100644 --- a/samples/2_Cookbook/19_cmake_lang/MatrixTranspose.cpp +++ b/samples/2_Cookbook/19_cmake_lang/MatrixTranspose.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015-2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/1_hipEvent/CMakeLists.txt b/samples/2_Cookbook/1_hipEvent/CMakeLists.txt index e6c8df24c..abf951953 100644 --- a/samples/2_Cookbook/1_hipEvent/CMakeLists.txt +++ b/samples/2_Cookbook/1_hipEvent/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/1_hipEvent/hipEvent.cpp b/samples/2_Cookbook/1_hipEvent/hipEvent.cpp index b3061e195..6aeb676b2 100644 --- a/samples/2_Cookbook/1_hipEvent/hipEvent.cpp +++ b/samples/2_Cookbook/1_hipEvent/hipEvent.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/21_cmake_hip_cxx_clang/CMakeLists.txt b/samples/2_Cookbook/21_cmake_hip_cxx_clang/CMakeLists.txt index 923683d97..b046aaf49 100644 --- a/samples/2_Cookbook/21_cmake_hip_cxx_clang/CMakeLists.txt +++ b/samples/2_Cookbook/21_cmake_hip_cxx_clang/CMakeLists.txt @@ -1,30 +1,23 @@ -# Copyright (C) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21.3) -project(cmake_cxx_amdclang++_test - DESCRIPTION "Verifies CXX Language Support with amdclang++" - LANGUAGES CXX) - -if(UNIX) +# Path setup (must be before project()) +if(WIN32) + if(NOT DEFINED ROCM_PATH) + if(DEFINED ENV{ROCM_PATH}) + set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") + elseif(DEFINED ENV{HIP_PATH}) + set(ROCM_PATH $ENV{HIP_PATH} CACHE STRING "ROCM Path from HIP_PATH") + endif() + endif() + if(DEFINED ROCM_PATH) + list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) + endif() + set(CMAKE_CXX_COMPILER "${ROCM_PATH}/lib/llvm/bin/clang++.exe") +elseif(UNIX) if(NOT DEFINED ROCM_PATH) if(DEFINED ENV{ROCM_PATH}) set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") @@ -36,7 +29,14 @@ if(UNIX) list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) endif() -set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++") +project(cmake_cxx_amdclang++_test + DESCRIPTION "Verifies CXX Language Support with amdclang++" + LANGUAGES CXX) + +# Set compiler after project() for Linux to avoid reconfiguration loop in subdirectory builds +if(UNIX) + set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++") +endif() # Find HIP find_package(hip REQUIRED) @@ -51,6 +51,13 @@ add_executable(square1 ${EXCLUDE_OPTION} square.cpp) target_include_directories(square1 PRIVATE ../../common) +# Add GPU architecture for device code compilation (Windows) +if(WIN32 AND DEFINED CMAKE_HIP_ARCHITECTURES) + foreach(_arch ${CMAKE_HIP_ARCHITECTURES}) + target_compile_options(square1 PRIVATE --offload-arch=${_arch}) + endforeach() +endif() + # Link with HIP target_link_libraries(square1 hip::device) diff --git a/samples/2_Cookbook/21_cmake_hip_cxx_clang/square.cpp b/samples/2_Cookbook/21_cmake_hip_cxx_clang/square.cpp index 12fce46b0..af580b1bb 100644 --- a/samples/2_Cookbook/21_cmake_hip_cxx_clang/square.cpp +++ b/samples/2_Cookbook/21_cmake_hip_cxx_clang/square.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015-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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/22_cmake_hip_lang/CMakeLists.txt b/samples/2_Cookbook/22_cmake_hip_lang/CMakeLists.txt index 1fa0f1b03..ee6c2ce38 100644 --- a/samples/2_Cookbook/22_cmake_hip_lang/CMakeLists.txt +++ b/samples/2_Cookbook/22_cmake_hip_lang/CMakeLists.txt @@ -1,38 +1,30 @@ -# Copyright (C) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21.3) -if(UNIX) +# Path setup (must be before project()) +if(WIN32) if(NOT DEFINED ROCM_PATH) - set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.") + if(DEFINED ENV{ROCM_PATH}) + set(ROCM_PATH "$ENV{ROCM_PATH}" CACHE STRING "ROCM Path") + elseif(DEFINED ENV{HIP_PATH}) + set(ROCM_PATH "$ENV{HIP_PATH}" CACHE STRING "ROCM Path from HIP_PATH") + endif() + endif() + if(DEFINED ROCM_PATH) + # Convert backslashes to forward slashes for CMake + file(TO_CMAKE_PATH "${ROCM_PATH}" ROCM_PATH) list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) endif() +elseif(UNIX) + if(NOT DEFINED ROCM_PATH) + set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.") + endif() + list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) endif() -if( NOT DEFINED CMAKE_HIP_COMPILER_ROCM) - set(CMAKE_HIP_COMPILER_ROCM_ROOT ${ROCM_PATH}) -endif() - -set(CMAKE_HIP_COMPILER ${ROCM_PATH}/llvm/bin/clang++) - project(cmake_hip_lang_support VERSION 1.0 DESCRIPTION "HIP Language Support with upstream CMake" LANGUAGES HIP) diff --git a/samples/2_Cookbook/22_cmake_hip_lang/square.hip b/samples/2_Cookbook/22_cmake_hip_lang/square.hip index 8092dbc12..c702616bc 100644 --- a/samples/2_Cookbook/22_cmake_hip_lang/square.hip +++ b/samples/2_Cookbook/22_cmake_hip_lang/square.hip @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/23_cmake_hiprtc/CMakeLists.txt b/samples/2_Cookbook/23_cmake_hiprtc/CMakeLists.txt index 48bd7eaf0..e6bae385c 100644 --- a/samples/2_Cookbook/23_cmake_hiprtc/CMakeLists.txt +++ b/samples/2_Cookbook/23_cmake_hiprtc/CMakeLists.txt @@ -1,28 +1,23 @@ -# Copyright (C) 2022 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. - -project(cmake_hiprtc_test CXX) +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.10.2) -if(UNIX) +# Path setup (must be before project()) +if(WIN32) + if(NOT DEFINED ROCM_PATH) + if(DEFINED ENV{ROCM_PATH}) + set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") + elseif(DEFINED ENV{HIP_PATH}) + set(ROCM_PATH $ENV{HIP_PATH} CACHE STRING "ROCM Path from HIP_PATH") + endif() + endif() + if(DEFINED ROCM_PATH) + list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) + endif() + set(CMAKE_CXX_COMPILER "${ROCM_PATH}/lib/llvm/bin/clang++.exe") +elseif(UNIX) if(NOT DEFINED ROCM_PATH) if(DEFINED ENV{ROCM_PATH}) set(ROCM_PATH $ENV{ROCM_PATH} CACHE STRING "ROCM Path") @@ -34,7 +29,12 @@ if(UNIX) list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) endif() -set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++") +project(cmake_hiprtc_test CXX) + +# Set compiler after project() for Linux to avoid reconfiguration loop in subdirectory builds +if(UNIX) + set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++") +endif() # Find hiprtc find_package(hiprtc REQUIRED) @@ -49,6 +49,15 @@ set(EXCLUDE_OPTION ) endif() add_executable(test ${EXCLUDE_OPTION} saxpy.cpp) +target_include_directories(test PRIVATE ../../common) + +# Add GPU architecture for device code compilation (Windows) +if(WIN32 AND DEFINED CMAKE_HIP_ARCHITECTURES) + foreach(_arch ${CMAKE_HIP_ARCHITECTURES}) + target_compile_options(test PRIVATE --offload-arch=${_arch}) + endforeach() +endif() + # Link with HIPRTC target_link_libraries(test hiprtc) # Link with HIP @@ -58,8 +67,6 @@ if(NOT BUILD_SHARED_LIBS) target_link_libraries(test hiprtc-builtins) endif() -target_include_directories(test PRIVATE ../../common) - if(TARGET build_cookbook) add_dependencies(build_cookbook test) endif() diff --git a/samples/2_Cookbook/23_cmake_hiprtc/saxpy.cpp b/samples/2_Cookbook/23_cmake_hiprtc/saxpy.cpp index 4cbb88964..e8ba8f25b 100644 --- a/samples/2_Cookbook/23_cmake_hiprtc/saxpy.cpp +++ b/samples/2_Cookbook/23_cmake_hiprtc/saxpy.cpp @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/3_shared_memory/CMakeLists.txt b/samples/2_Cookbook/3_shared_memory/CMakeLists.txt index 0a326dd48..94f66df75 100644 --- a/samples/2_Cookbook/3_shared_memory/CMakeLists.txt +++ b/samples/2_Cookbook/3_shared_memory/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/3_shared_memory/sharedMemory.cpp b/samples/2_Cookbook/3_shared_memory/sharedMemory.cpp index 1878c733b..7c44bd3c3 100644 --- a/samples/2_Cookbook/3_shared_memory/sharedMemory.cpp +++ b/samples/2_Cookbook/3_shared_memory/sharedMemory.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/4_shfl/CMakeLists.txt b/samples/2_Cookbook/4_shfl/CMakeLists.txt index 5cb163914..9443bdbc0 100644 --- a/samples/2_Cookbook/4_shfl/CMakeLists.txt +++ b/samples/2_Cookbook/4_shfl/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/4_shfl/shfl.cpp b/samples/2_Cookbook/4_shfl/shfl.cpp index 16fac3ee8..9657ab6c2 100644 --- a/samples/2_Cookbook/4_shfl/shfl.cpp +++ b/samples/2_Cookbook/4_shfl/shfl.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/5_2dshfl/2dshfl.cpp b/samples/2_Cookbook/5_2dshfl/2dshfl.cpp index 936ccdbfb..88f5f71e4 100644 --- a/samples/2_Cookbook/5_2dshfl/2dshfl.cpp +++ b/samples/2_Cookbook/5_2dshfl/2dshfl.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/5_2dshfl/CMakeLists.txt b/samples/2_Cookbook/5_2dshfl/CMakeLists.txt index 130fcaaec..da4af9db8 100644 --- a/samples/2_Cookbook/5_2dshfl/CMakeLists.txt +++ b/samples/2_Cookbook/5_2dshfl/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt b/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt index 0560c896d..18927161b 100644 --- a/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt +++ b/samples/2_Cookbook/6_dynamic_shared/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/6_dynamic_shared/dynamic_shared.cpp b/samples/2_Cookbook/6_dynamic_shared/dynamic_shared.cpp index 69377b6c1..661cbc4c7 100644 --- a/samples/2_Cookbook/6_dynamic_shared/dynamic_shared.cpp +++ b/samples/2_Cookbook/6_dynamic_shared/dynamic_shared.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/7_streams/CMakeLists.txt b/samples/2_Cookbook/7_streams/CMakeLists.txt index 15dc215b9..f29c1980a 100644 --- a/samples/2_Cookbook/7_streams/CMakeLists.txt +++ b/samples/2_Cookbook/7_streams/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/7_streams/stream.cpp b/samples/2_Cookbook/7_streams/stream.cpp index f2acd0a1f..12055da82 100644 --- a/samples/2_Cookbook/7_streams/stream.cpp +++ b/samples/2_Cookbook/7_streams/stream.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/8_peer2peer/CMakeLists.txt b/samples/2_Cookbook/8_peer2peer/CMakeLists.txt index 7e46757cc..927b91afe 100644 --- a/samples/2_Cookbook/8_peer2peer/CMakeLists.txt +++ b/samples/2_Cookbook/8_peer2peer/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/8_peer2peer/peer2peer.cpp b/samples/2_Cookbook/8_peer2peer/peer2peer.cpp index f7974063a..413169463 100644 --- a/samples/2_Cookbook/8_peer2peer/peer2peer.cpp +++ b/samples/2_Cookbook/8_peer2peer/peer2peer.cpp @@ -1,21 +1,8 @@ /* -Copyright (c) 2015 - 2021 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 WARRANUMTY OF ANY KIND, EXPRESS OR -IMPLIED, INUMCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNUMESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANUMY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER INUM AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR INUM CONUMECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/2_Cookbook/9_unroll/CMakeLists.txt b/samples/2_Cookbook/9_unroll/CMakeLists.txt index cb112c4e7..44dfb814c 100644 --- a/samples/2_Cookbook/9_unroll/CMakeLists.txt +++ b/samples/2_Cookbook/9_unroll/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2020 - 2023 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.21) diff --git a/samples/2_Cookbook/9_unroll/unroll.cpp b/samples/2_Cookbook/9_unroll/unroll.cpp index 437e573c1..bf8834dec 100644 --- a/samples/2_Cookbook/9_unroll/unroll.cpp +++ b/samples/2_Cookbook/9_unroll/unroll.cpp @@ -1,24 +1,8 @@ /* -Copyright (c) 2015 - 2021 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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include diff --git a/samples/2_Cookbook/CMakeLists.txt b/samples/2_Cookbook/CMakeLists.txt index ebcfd3e1a..7d0d4b5f9 100644 --- a/samples/2_Cookbook/CMakeLists.txt +++ b/samples/2_Cookbook/CMakeLists.txt @@ -1,22 +1,8 @@ -# Copyright (c) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT + +cmake_minimum_required(VERSION 3.21.3) add_custom_target(build_cookbook) add_subdirectory(0_MatrixTranspose) add_subdirectory(1_hipEvent) @@ -35,9 +21,20 @@ add_subdirectory(14_gpu_arch) add_subdirectory(15_static_library/device_functions) add_subdirectory(15_static_library/host_functions) # Disable samples that call hipcc directly for static builds. +# Also check for required LLVM tools on Windows if(BUILD_SHARED_LIBS) add_subdirectory(16_assembly_to_executable) - add_subdirectory(17_llvm_ir_to_executable) + + # 17_llvm_ir_to_executable requires llvm-dis which may not be available + find_program(LLVM_DIS_EXE + NAMES llvm-dis llvm-dis.exe + HINTS "${ROCM_PATH}/lib/llvm/bin" "${HIP_PATH}/lib/llvm/bin" + ) + if(LLVM_DIS_EXE) + add_subdirectory(17_llvm_ir_to_executable) + else() + message(STATUS "Skipping 17_llvm_ir_to_executable - llvm-dis not found") + endif() endif() add_subdirectory(18_cmake_hip_device) add_subdirectory(19_cmake_lang) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 955817883..e8d6ad3cb 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -1,23 +1,8 @@ -# Copyright (c) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT + cmake_minimum_required(VERSION 3.16.8) project(hip-samples) @@ -49,12 +34,27 @@ endif() # both are not set if(NOT DEFINED HIP_PATH AND NOT DEFINED ROCM_PATH) - set(HIP_PATH "/opt/rocm") - set(ROCM_PATH "/opt/rocm") + if(WIN32) + # On Windows, default to HIP_PATH from environment or fail + if(DEFINED ENV{HIP_PATH}) + set(HIP_PATH $ENV{HIP_PATH} CACHE STRING "HIP Path") + set(ROCM_PATH ${HIP_PATH} CACHE STRING "ROCM Path") + else() + message(FATAL_ERROR "HIP_PATH environment variable not set. Please set HIP_PATH to your ROCm installation.") + endif() + else() + set(HIP_PATH "/opt/rocm") + set(ROCM_PATH "/opt/rocm") + endif() elseif(DEFINED HIP_PATH AND NOT DEFINED ROCM_PATH) - execute_process(COMMAND ${HIP_PATH}/bin/${HIPCONFIG_EXEC} --rocmpath - OUTPUT_VARIABLE ROCM_PATH - OUTPUT_STRIP_TRAILING_WHITESPACE) + if(WIN32) + # On Windows, ROCM_PATH is typically the same as HIP_PATH + set(ROCM_PATH ${HIP_PATH} CACHE STRING "ROCM Path") + else() + execute_process(COMMAND ${HIP_PATH}/bin/${HIPCONFIG_EXEC} --rocmpath + OUTPUT_VARIABLE ROCM_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() elseif(DEFINED ROCM_PATH AND NOT DEFINED HIP_PATH) set(HIP_PATH ${ROCM_PATH}) endif() diff --git a/samples/common/DetectGPUArchs.cmake b/samples/common/DetectGPUArchs.cmake index 0adc0a36c..51eae28c9 100644 --- a/samples/common/DetectGPUArchs.cmake +++ b/samples/common/DetectGPUArchs.cmake @@ -1,27 +1,11 @@ -# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT # Detect unique GPU architectures for add_custom_command if(NOT DEFINED HIP_ARCH_DETECTION_DONE) set(HIP_ARCH_DETECTION_DONE TRUE CACHE INTERNAL "HIP architecture detection completed") - + # Detect GPU architectures for code object generation # Note: CMake's HIP language support may not deduplicate architectures # Fix any duplicates in CMAKE_HIP_ARCHITECTURES if already set @@ -41,14 +25,14 @@ if(NOT DEFINED HIP_ARCH_DETECTION_DONE) set(ROCM_PATH "/opt/rocm") endif() endif() - + execute_process( COMMAND ${ROCM_PATH}/bin/rocm_agent_enumerator OUTPUT_VARIABLE DETECTED_GPUS OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET ) - + if(DETECTED_GPUS) string(REPLACE "\n" ";" GPU_ARCH_LIST "${DETECTED_GPUS}") list(REMOVE_ITEM GPU_ARCH_LIST "gfx000" "") @@ -69,3 +53,8 @@ foreach(arch ${CMAKE_HIP_ARCHITECTURES}) list(APPEND OFFLOAD_ARCH_FLAGS "--offload-arch=${arch}") endforeach() +# Build flags for device-only compilation (CMAKE_HIP_FLAGS minus --offload-arch) +string(TOUPPER "${CMAKE_BUILD_TYPE}" _HIP_BUILD_TYPE_UPPER) +separate_arguments(HIP_DEVICE_BUILD_FLAGS_NO_ARCH NATIVE_COMMAND + "${CMAKE_HIP_FLAGS} ${CMAKE_HIP_FLAGS_${_HIP_BUILD_TYPE_UPPER}}") +list(FILTER HIP_DEVICE_BUILD_FLAGS_NO_ARCH EXCLUDE REGEX "--offload-arch=") diff --git a/samples/common/hip_helper.h b/samples/common/hip_helper.h index 98547d438..deebb21f3 100644 --- a/samples/common/hip_helper.h +++ b/samples/common/hip_helper.h @@ -1,24 +1,8 @@ /* -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 -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/samples/packaging/CMakeLists.txt b/samples/packaging/CMakeLists.txt index 78779eb98..61f4e3dd5 100644 --- a/samples/packaging/CMakeLists.txt +++ b/samples/packaging/CMakeLists.txt @@ -1,23 +1,8 @@ -# Copyright (c) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT + cmake_minimum_required(VERSION 3.16.8) # vc 19.31.31107.0 gives issue while packaging using makefile # To avoid error NMAKE : fatal error U1065: invalid option 'w' diff --git a/utils/coverage/CMakeLists.txt b/utils/coverage/CMakeLists.txt index 252e6e4af..e5f36388d 100644 --- a/utils/coverage/CMakeLists.txt +++ b/utils/coverage/CMakeLists.txt @@ -1,22 +1,6 @@ -# Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. +# Copyright (c) Advanced Micro Devices, Inc., or its affiliates. # -# 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. +# SPDX-License-Identifier: MIT cmake_minimum_required(VERSION 3.0) project(generateHipAPICoverage) diff --git a/utils/coverage/hipAPI.cpp b/utils/coverage/hipAPI.cpp index b6b81c34e..7641def2e 100644 --- a/utils/coverage/hipAPI.cpp +++ b/utils/coverage/hipAPI.cpp @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hipAPI.h" diff --git a/utils/coverage/hipAPI.h b/utils/coverage/hipAPI.h index 72a435aba..41650a267 100644 --- a/utils/coverage/hipAPI.h +++ b/utils/coverage/hipAPI.h @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/utils/coverage/hipAPICoverageUtils.cpp b/utils/coverage/hipAPICoverageUtils.cpp index 112fc54aa..a0b9e7292 100644 --- a/utils/coverage/hipAPICoverageUtils.cpp +++ b/utils/coverage/hipAPICoverageUtils.cpp @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hipAPICoverageUtils.h" diff --git a/utils/coverage/hipAPICoverageUtils.h b/utils/coverage/hipAPICoverageUtils.h index a62c9485d..6d8e57916 100644 --- a/utils/coverage/hipAPICoverageUtils.h +++ b/utils/coverage/hipAPICoverageUtils.h @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include #include diff --git a/utils/coverage/hipAPIGroup.cpp b/utils/coverage/hipAPIGroup.cpp index 14a7e0cc9..bbfdebaa4 100644 --- a/utils/coverage/hipAPIGroup.cpp +++ b/utils/coverage/hipAPIGroup.cpp @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hipAPIGroup.h" diff --git a/utils/coverage/hipAPIGroup.h b/utils/coverage/hipAPIGroup.h index 7687f623a..45a096801 100644 --- a/utils/coverage/hipAPIGroup.h +++ b/utils/coverage/hipAPIGroup.h @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hipAPI.h" #include diff --git a/utils/coverage/mainCoverage.cpp b/utils/coverage/mainCoverage.cpp index e07633e3d..e12abdd0a 100644 --- a/utils/coverage/mainCoverage.cpp +++ b/utils/coverage/mainCoverage.cpp @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "reportGenerators.h" diff --git a/utils/coverage/reportGenerators.cpp b/utils/coverage/reportGenerators.cpp index 9b82c761e..da7ea8583 100644 --- a/utils/coverage/reportGenerators.cpp +++ b/utils/coverage/reportGenerators.cpp @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "reportGenerators.h" diff --git a/utils/coverage/reportGenerators.h b/utils/coverage/reportGenerators.h index 15986f8d2..fa213acba 100644 --- a/utils/coverage/reportGenerators.h +++ b/utils/coverage/reportGenerators.h @@ -1,24 +1,8 @@ /* -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. -*/ + * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. + * + * SPDX-License-Identifier: MIT + */ #include "hipAPICoverageUtils.h"