├── .azuredevops └── rocm-ci.yml ├── .clang-format ├── .gitattributes ├── .github ├── palamida.yml ├── pull_request_template.md ├── scripts │ └── validate_pr_description.py └── workflows │ ├── keyword-check.yml │ ├── kws-caller.yml │ ├── pr-title-validate.yml │ ├── rocm-ci-caller.yml │ └── validate-pr-description.yml ├── .gitignore ├── .jenkins └── jenkinsfile ├── CODEOWNERS ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── catch ├── ABM │ ├── AddKernels │ │ ├── CMakeLists.txt │ │ └── add.cc │ └── CMakeLists.txt ├── CMakeLists.txt ├── DoxyfileTests ├── README.md ├── TypeQualifiers │ ├── CMakeLists.txt │ └── hipManagedKeyword.cc ├── catchProp_in_rc.in ├── external │ ├── Catch2 │ │ ├── LICENSE.txt │ │ ├── catch.hpp │ │ └── cmake │ │ │ └── Catch2 │ │ │ ├── Catch.cmake │ │ │ ├── Catch2Config.cmake │ │ │ ├── Catch2ConfigVersion.cmake │ │ │ ├── Catch2Targets.cmake │ │ │ ├── CatchAddTests.cmake │ │ │ ├── ParseAndAddCatchTests.cmake │ │ │ └── catch_include.cmake │ └── picojson │ │ ├── LICENSE │ │ └── picojson.h ├── hipTestMain │ ├── CMakeLists.txt │ ├── config │ │ ├── config_amd_linux │ │ ├── config_amd_windows │ │ ├── config_amd_wsl.json │ │ ├── config_nvidia_linux.json │ │ └── config_nvidia_windows.json │ ├── hip_test_context.cc │ ├── hip_test_features.cc │ ├── main.cc │ └── standalone_main.cc ├── include │ ├── cmd_options.hh │ ├── cpu_grid.h │ ├── hipMallocManagedCommon.hh │ ├── hip_array_common.hh │ ├── hip_test_checkers.hh │ ├── hip_test_common.hh │ ├── hip_test_context.hh │ ├── hip_test_defgroups.hh │ ├── hip_test_features.hh │ ├── hip_test_filesystem.hh │ ├── hip_test_helper.hh │ ├── hip_test_kernels.hh │ ├── hip_test_process.hh │ ├── hip_test_rtc.hh │ ├── hip_test_smi.hh │ ├── hip_texture_helper.hh │ ├── kernel_mapping.hh │ ├── kernels.hh │ ├── memcpy1d_tests_common.hh │ ├── memcpy3d_tests_common.hh │ ├── performance_common.hh │ ├── resource_guards.hh │ ├── threaded_zig_zag_test.hh │ ├── utils.hh │ └── warp_common.hh ├── kernels │ ├── CMakeLists.txt │ ├── Set.cpp │ └── vectorADD.inl ├── multiproc │ ├── CMakeLists.txt │ ├── childMalloc.cc │ ├── deviceAllocationMproc.cc │ ├── dummy_kernel.cpp │ ├── hipDeviceComputeCapabilityMproc.cc │ ├── hipDeviceGetPCIBusIdMproc.cc │ ├── hipDeviceTotalMemMproc.cc │ ├── hipGetDeviceAttributeMproc.cc │ ├── hipGetDeviceCountMproc.cc │ ├── hipGetDevicePropertiesMproc.cc │ ├── hipIpcEventHandle.cc │ ├── hipIpcMemAccessTest.cc │ ├── hipMallocConcurrencyMproc.cc │ ├── hipMemCoherencyTstMProc.cc │ ├── hipMemGetInfoMProc.cc │ ├── hipNoGpuTsts.cc │ └── hipSetGetDeviceMproc.cc ├── packaging │ └── CMakeLists.txt ├── performance │ ├── CMakeLists.txt │ ├── event │ │ ├── CMakeLists.txt │ │ ├── hipEventCreate.cc │ │ ├── hipEventCreateWithFlags.cc │ │ ├── hipEventDestroy.cc │ │ ├── hipEventElapsedTime.cc │ │ ├── hipEventQuery.cc │ │ ├── hipEventRecord.cc │ │ └── hipEventSynchronize.cc │ ├── example │ │ ├── CMakeLists.txt │ │ └── example.cc │ ├── kernelLaunch │ │ ├── CMakeLists.txt │ │ ├── hipExtLaunchKernel.cc │ │ ├── hipExtLaunchKernelGGL.cc │ │ ├── hipLaunchCooperativeKernel.cc │ │ ├── hipLaunchKernel.cc │ │ ├── kernel_launch_common.cc │ │ ├── kernel_launch_common.hh │ │ └── triple_chevron.cc │ ├── memcpy │ │ ├── CMakeLists.txt │ │ ├── hipMemcpy.cc │ │ ├── hipMemcpy2D.cc │ │ ├── hipMemcpy2DAsync.cc │ │ ├── hipMemcpy2DFromArray.cc │ │ ├── hipMemcpy2DFromArrayAsync.cc │ │ ├── hipMemcpy2DToArray.cc │ │ ├── hipMemcpy2DToArrayAsync.cc │ │ ├── hipMemcpy3D.cc │ │ ├── hipMemcpy3DAsync.cc │ │ ├── hipMemcpyAsync.cc │ │ ├── hipMemcpyAtoH.cc │ │ ├── hipMemcpyDtoD.cc │ │ ├── hipMemcpyDtoDAsync.cc │ │ ├── hipMemcpyDtoH.cc │ │ ├── hipMemcpyDtoHAsync.cc │ │ ├── hipMemcpyFromSymbol.cc │ │ ├── hipMemcpyFromSymbolAsync.cc │ │ ├── hipMemcpyHtoA.cc │ │ ├── hipMemcpyHtoD.cc │ │ ├── hipMemcpyHtoDAsync.cc │ │ ├── hipMemcpyParam2D.cc │ │ ├── hipMemcpyParam2DAsync.cc │ │ ├── hipMemcpyToSymbol.cc │ │ ├── hipMemcpyToSymbolAsync.cc │ │ ├── hipMemcpyWithKernel.cc │ │ ├── hipMemcpyWithStream.cc │ │ └── memcpy_performance_common.hh │ ├── memset │ │ ├── CMakeLists.txt │ │ ├── hipMemset.cc │ │ ├── hipMemset2D.cc │ │ ├── hipMemset2DAsync.cc │ │ ├── hipMemset3D.cc │ │ ├── hipMemset3DAsync.cc │ │ ├── hipMemsetAsync.cc │ │ ├── hipMemsetD16.cc │ │ ├── hipMemsetD16Async.cc │ │ ├── hipMemsetD32.cc │ │ ├── hipMemsetD32Async.cc │ │ ├── hipMemsetD8.cc │ │ └── hipMemsetD8Async.cc │ ├── stream │ │ ├── CMakeLists.txt │ │ ├── hipExtStreamCreateWithCUMask.cc │ │ ├── hipExtStreamGetCUMask.cc │ │ ├── hipFreeAsync.cc │ │ ├── hipMallocAsync.cc │ │ ├── hipMallocFromPoolAsync.cc │ │ ├── hipMemPoolCreate.cc │ │ ├── hipMemPoolDestroy.cc │ │ ├── hipMemPoolExportPointer.cc │ │ ├── hipMemPoolExportToShareableHandle.cc │ │ ├── hipMemPoolGetAccess.cc │ │ ├── hipMemPoolGetAttribute.cc │ │ ├── hipMemPoolImportFromShareableHandle.cc │ │ ├── hipMemPoolImportPointer.cc │ │ ├── hipMemPoolSetAccess.cc │ │ ├── hipMemPoolSetAttribute.cc │ │ ├── hipMemPoolTrimTo.cc │ │ ├── hipStreamAddCallback.cc │ │ ├── hipStreamBasic.cc │ │ ├── hipStreamGetFlags.cc │ │ ├── hipStreamGetPriority.cc │ │ ├── hipStreamWaitEvent.cc │ │ ├── hipStreamWaitValue.cc │ │ ├── hipStreamWriteValue.cc │ │ └── mem_pools_performance_common.hh │ └── warpSync │ │ ├── CMakeLists.txt │ │ └── warpSync.cc ├── perftests │ ├── CMakeLists.txt │ ├── compute │ │ ├── CMakeLists.txt │ │ ├── hipPerfDotProduct.cc │ │ └── hipPerfMandelbrot.cc │ ├── dispatch │ │ ├── CMakeLists.txt │ │ └── hipPerfDispatchSpeed.cc │ ├── event │ │ ├── CMakeLists.txt │ │ ├── hipEventOverFlowPerf.cc │ │ └── hipKernelLookUpPerf.cc │ ├── graph │ │ ├── CMakeLists.txt │ │ ├── hipPerfGraphLaunch.cc │ │ └── parallelGraph.cc │ ├── memory │ │ ├── CMakeLists.txt │ │ ├── hipPerfBufferCopyRectSpeed.cc │ │ ├── hipPerfBufferCopySpeed.cc │ │ ├── hipPerfBufferCopySpeedAll2All.cc │ │ ├── hipPerfBufferCopySpeedP2P.cc │ │ ├── hipPerfDevMemReadSpeed.cc │ │ ├── hipPerfDevMemWriteSpeed.cc │ │ ├── hipPerfDeviceHeapMemory.cc │ │ ├── hipPerfHostNumaAlloc.cc │ │ ├── hipPerfMemFill.cc │ │ ├── hipPerfMemMallocCpyFree.cc │ │ ├── hipPerfMemcpy.cc │ │ ├── hipPerfMempool.cc │ │ ├── hipPerfMemset.cc │ │ ├── hipPerfSampleRate.cc │ │ └── hipPerfSharedMemReadSpeed.cc │ └── stream │ │ ├── CMakeLists.txt │ │ ├── hipPerfDeviceConcurrency.cc │ │ ├── hipPerfIncreasingNumberOfStreams.cc │ │ ├── hipPerfStreamConcurrency.cc │ │ └── hipPerfStreamCreateCopyDestroy.cc ├── stress │ ├── CMakeLists.txt │ ├── deviceallocation │ │ ├── CMakeLists.txt │ │ └── Stress_deviceAllocationStress.cc │ ├── memory │ │ ├── CMakeLists.txt │ │ ├── hipHmmOvrSubscriptionTst.cc │ │ ├── hipHostMallocStress.cc │ │ ├── hipHostRegisterStress.cc │ │ ├── hipMalloc.cc │ │ ├── hipMallocManagedStress.cc │ │ ├── hipMemPrftchAsyncStressTst.cc │ │ ├── hipMemcpyMThreadMSize.cc │ │ ├── hold_memory.cc │ │ └── memcpy.cc │ ├── module │ │ ├── CMakeLists.txt │ │ └── hipModuleLoadUnload.cc │ ├── printf │ │ ├── CMakeLists.txt │ │ ├── Stress_printf_ComplexKernels.cc │ │ ├── Stress_printf_SimpleKernels.cc │ │ └── printf_common.h │ └── stream │ │ ├── CMakeLists.txt │ │ ├── Stress_hipStreamCreate.cc │ │ └── streamEnqueue.cc └── unit │ ├── CMakeLists.txt │ ├── assertion │ ├── CMakeLists.txt │ ├── assert.cc │ ├── static_assert.cc │ ├── static_assert_kernels_negative.cc │ ├── static_assert_kernels_positive.cc │ └── static_assert_kernels_rtc.hh │ ├── atomics │ ├── CMakeLists.txt │ ├── __hip_atomic_compare_exchange_strong.cc │ ├── __hip_atomic_exchange.cc │ ├── __hip_atomic_fetch_add.cc │ ├── __hip_atomic_fetch_and.cc │ ├── __hip_atomic_fetch_max.cc │ ├── __hip_atomic_fetch_min.cc │ ├── __hip_atomic_fetch_or.cc │ ├── __hip_atomic_fetch_xor.cc │ ├── acquire_release.cc │ ├── arithmetic_common.hh │ ├── atomicAdd.cc │ ├── atomicAdd_negative_kernels.cc │ ├── atomicAdd_negative_kernels_rtc.hh │ ├── atomicAdd_system.cc │ ├── atomicAnd.cc │ ├── atomicAnd_negative_kernels.cc │ ├── atomicAnd_negative_kernels_rtc.hh │ ├── atomicAnd_system.cc │ ├── atomicCAS.cc │ ├── atomicCAS_negative_kernels.cc │ ├── atomicCAS_negative_kernels_rtc.hh │ ├── atomicCAS_system.cc │ ├── atomicDec.cc │ ├── atomicDec_negative_kernels.cc │ ├── atomicDec_negative_kernels_rtc.hh │ ├── atomicExch.cc │ ├── atomicExch_common.hh │ ├── atomicExch_negative_kernels.cc │ ├── atomicExch_negative_kernels_rtc.hh │ ├── atomicExch_system.cc │ ├── atomicExch_system_negative_kernels.cc │ ├── atomicExch_system_negative_kernels_rtc.hh │ ├── atomicInc.cc │ ├── atomicInc_negative_kernels.cc │ ├── atomicInc_negative_kernels_rtc.hh │ ├── atomicMax.cc │ ├── atomicMax_negative_kernels.cc │ ├── atomicMax_negative_kernels_rtc.hh │ ├── atomicMax_system.cc │ ├── atomicMin.cc │ ├── atomicMin_negative_kernels.cc │ ├── atomicMin_negative_kernels_rtc.hh │ ├── atomicMin_system.cc │ ├── atomicOr.cc │ ├── atomicOr_negative_kernels.cc │ ├── atomicOr_negative_kernels_rtc.hh │ ├── atomicOr_system.cc │ ├── atomicSub.cc │ ├── atomicSub_negative_kernels.cc │ ├── atomicSub_negative_kernels_rtc.hh │ ├── atomicSub_system.cc │ ├── atomicXor.cc │ ├── atomicXor_negative_kernels.cc │ ├── atomicXor_negative_kernels_rtc.hh │ ├── atomicXor_system.cc │ ├── atomic_builtin_kernels.cc │ ├── atomic_builtins.cc │ ├── atomic_builtins_kernels_rtc.hh │ ├── bitwise_common.hh │ ├── memory_order_common.hh │ ├── min_max_common.hh │ ├── safeAtomicAdd.cc │ ├── safeAtomicMax.cc │ ├── safeAtomicMin.cc │ ├── sequential_consistency.cc │ ├── unsafeAtomicAdd.cc │ ├── unsafeAtomicMax.cc │ └── unsafeAtomicMin.cc │ ├── c_compilation │ ├── CMakeLists.txt │ ├── hipGetDeviceProp.c │ └── hipGetDeviceProp.cc │ ├── callback │ ├── CMakeLists.txt │ ├── SimpleKernel.cc │ ├── hipApiName.cc │ ├── hipGetStreamDeviceId.cc │ ├── hipKernelNameRef.cc │ └── hipKernelNameRefByPtr.cc │ ├── channelDescriptor │ ├── CMakeLists.txt │ ├── channel_descriptor.cc │ └── channel_descriptor_common.hh │ ├── clock │ ├── CMakeLists.txt │ └── hipClockCheck.cc │ ├── compileAndCaptureOutput.py │ ├── compiler │ ├── CMakeLists.txt │ ├── hipClassKernel.cc │ ├── hipClassKernel.h │ ├── hipSquare.cc │ └── hipSquareGenericTarget.cc │ ├── complex │ ├── CMakeLists.txt │ ├── complex.cc │ ├── complex_basic_common.hh │ ├── complex_cast_negative_kernels.cc │ ├── complex_cast_negative_kernels_rtc.hh │ ├── complex_function_common.hh │ ├── complex_make_negative_kernels.cc │ ├── complex_make_negative_kernels_rtc.hh │ ├── complex_negative_kernels_1Arg_double.cc │ ├── complex_negative_kernels_1Arg_float.cc │ ├── complex_negative_kernels_1Arg_rtc.hh │ ├── complex_negative_kernels_2Arg_double.cc │ ├── complex_negative_kernels_2Arg_float.cc │ ├── complex_negative_kernels_2Arg_rtc.hh │ ├── complex_negative_kernels_3Arg.cc │ └── complex_negative_kernels_3Arg_rtc.hh │ ├── context │ ├── CMakeLists.txt │ ├── hipDrvGetPCIBusId.cc │ ├── hipDrvMemcpy.cc │ └── hipMemsetD8.cc │ ├── cooperativeGrps │ ├── CMakeLists.txt │ ├── binary_partition.cc │ ├── cg_any_all.cc │ ├── cg_ballot.cc │ ├── cg_common_kernels.hh │ ├── coalesced_group.cc │ ├── coalesced_group_tiled_partition.cc │ ├── coalesced_groups_shfl_down_old.cc │ ├── coalesced_groups_shfl_up_old.cc │ ├── coalesced_tiled_groups_metagrp.cc │ ├── cooperative_groups_common.hh │ ├── grid_group.cc │ ├── hipCGCoalescedGroups_old.cc │ ├── hipCGGridGroupType_old.cc │ ├── hipCGMultiGridGroupType_old.cc │ ├── hipCGThreadBlockTileTypeShfl_old.cc │ ├── hipCGThreadBlockType_old.cc │ ├── hipCGTiledPartitionType_old.cc │ ├── hipLaunchCooperativeKernelMultiDevice_old.cc │ ├── hipLaunchCooperativeKernel_old.cc │ ├── hip_cg_common.hh │ ├── multi_grid_group.cc │ ├── thread_block.cc │ └── thread_block_tile.cc │ ├── device │ ├── CMakeLists.txt │ ├── ResetUUIDInChild_Exe.cc │ ├── chkUUIDFrmChildProc_Exe.cc │ ├── chkUUIDInGrandChild_Exe.cc │ ├── getDeviceCount_exe.cc │ ├── getUUIDfrmRocinfo_Exe.cc │ ├── hipChooseDevice.cc │ ├── hipDeviceAPUCheck.cc │ ├── hipDeviceCanAccessPeer.cc │ ├── hipDeviceComputeCapability.cc │ ├── hipDeviceEnableDisablePeerAccess.cc │ ├── hipDeviceGetByPCIBusId.cc │ ├── hipDeviceGetDefaultMemPool.cc │ ├── hipDeviceGetLimit_old.cc │ ├── hipDeviceGetName.cc │ ├── hipDeviceGetPCIBusId.cc │ ├── hipDeviceGetUuid.cc │ ├── hipDeviceReset.cc │ ├── hipDeviceSetGetCacheConfig.cc │ ├── hipDeviceSetGetLimit.cc │ ├── hipDeviceSetGetMemPool.cc │ ├── hipDeviceSetGetSharedMemConfig.cc │ ├── hipDeviceSetLimit_old.cc │ ├── hipDeviceSynchronize.cc │ ├── hipDeviceTotalMem.cc │ ├── hipDriverGetVersion.cc │ ├── hipExtGetLinkTypeAndHopCount.cc │ ├── hipGetDeviceAttribute.cc │ ├── hipGetDeviceCount.cc │ ├── hipGetDeviceProperties.cc │ ├── hipGetProcAddressDevMgmt.cc │ ├── hipGetProcAddressHelpers.hh │ ├── hipGetProcAddressIpcApis.cc │ ├── hipGetSetDeviceFlags.cc │ ├── hipInit.cc │ ├── hipIpcCloseMemHandle.cc │ ├── hipIpcGetMemHandle.cc │ ├── hipIpcOpenMemHandle.cc │ ├── hipRuntimeGetVersion.cc │ ├── hipSetGetDevice.cc │ ├── multipleUUID_Exe.cc │ ├── passUUIDToGrandChild_Exe.cc │ ├── setEnvInChildProc_Exe.cc │ ├── setuuidGetDevCount_Exe.cc │ └── uuidList.cc │ ├── deviceLib │ ├── AtomicAdd_Coherent_withnoUnsafeflag.cc │ ├── AtomicAdd_Coherent_withoutflag.cc │ ├── AtomicAdd_Coherent_withunsafeflag.cc │ ├── AtomicAdd_NonCoherent_withnoUnsafeflag.cc │ ├── AtomicAdd_NonCoherent_withoutflag.cc │ ├── AtomicAdd_NonCoherent_withunsafeflag.cc │ ├── Atomic_func.cc │ ├── AtomicsWithRandomActiveLanesInWavefront.cc │ ├── BuiltIns_fadd.cc │ ├── BuiltIns_fmax.cc │ ├── BuiltIns_fmin.cc │ ├── CMakeLists.txt │ ├── DoublePrecisionIntrinsics.cc │ ├── DoublePrecisionMathDevice.cc │ ├── DoublePrecisionMathHost.cc │ ├── FloatMathPrecise.cc │ ├── IntegerIntrinsics.cc │ ├── SimpleAtomicsTest.cc │ ├── SinglePrecisionIntrinsics.cc │ ├── SinglePrecisionMathDevice.cc │ ├── SinglePrecisionMathHost.cc │ ├── anyAll.cc │ ├── ballot.cc │ ├── bfloat16.cc │ ├── bitExtract.cc │ ├── bitInsert.cc │ ├── brev.cc │ ├── clz.cc │ ├── defs.h │ ├── deviceAllocCommon.h │ ├── deviceAllocation.cc │ ├── ffs.cc │ ├── floatMath.cc │ ├── floatTM.cc │ ├── fp16_ops.cc │ ├── fp8_fnuz.cc │ ├── fp8_host.cc │ ├── fp8_ocp.cc │ ├── funnelshift.cc │ ├── hadd.cc │ ├── hipBfloat16.cc │ ├── hipComplex.cc │ ├── hipDeviceMemcpy.cc │ ├── hipMathFunctions.cc │ ├── hipStdComplex.cc │ ├── hipTestAtomicAdd.cc │ ├── hipTestClock.cc │ ├── hipTestDevice.cc │ ├── hipTestDeviceDouble.cc │ ├── hipTestDeviceLimit.cc │ ├── hipTestDeviceSymbol.cc │ ├── hipTestDotFunctions.cc │ ├── hipTestFMA.cc │ ├── hipTestHalf.cc │ ├── hipTestHost.cc │ ├── hipTestIncludeMath.cc │ ├── hipTestNativeHalf.cc │ ├── hipTestNew.cc │ ├── hipThreadFence.cc │ ├── hipVectorTypesDevice.cc │ ├── hipVectorTypesHost.cc │ ├── hip_test_make_type.cc │ ├── hip_trig.cc │ ├── hmax_hmin.cc │ ├── kerDevAllocMultCO.cc │ ├── kerDevAllocSingleKer.cc │ ├── kerDevFreeMultCO.cc │ ├── kerDevWriteMultCO.cc │ ├── ldg.cc │ ├── mbcnt.cc │ ├── popc.cc │ ├── syncthreadsand.cc │ ├── syncthreadscount.cc │ ├── syncthreadsor.cc │ ├── threadfence_system.cc │ ├── unsafeAtomicAdd.cc │ ├── unsafeAtomicAdd_Coherent_withnounsafeflag.cc │ ├── unsafeAtomicAdd_Coherent_withoutflag.cc │ ├── unsafeAtomicAdd_Coherent_withunsafeflag.cc │ ├── unsafeAtomicAdd_NonCoherent_withnounsafeflag.cc │ ├── unsafeAtomicAdd_NonCoherent_withoutflag.cc │ ├── unsafeAtomicAdd_NonCoherent_withunsafeflag.cc │ └── unsafeAtomicAdd_RTC.cc │ ├── device_memory │ ├── CMakeLists.txt │ ├── memcpy.cc │ ├── memcpy_negative_kernels.cc │ ├── memcpy_negative_kernels_rtc.hh │ ├── memset.cc │ ├── memset_negative_kernels.cc │ └── memset_negative_kernels_rtc.hh │ ├── dynamicLoading │ ├── CMakeLists.txt │ ├── bit_extract_kernel.cpp │ ├── complex_loading_behavior.cc │ ├── hipApiDynamicLoad.cc │ ├── liblazyLoad.cc │ └── vecadd.cc │ ├── errorHandling │ ├── CMakeLists.txt │ ├── error_handling_common.cc │ ├── error_handling_common.hh │ ├── hipDrvGetErrorName.cc │ ├── hipDrvGetErrorString.cc │ ├── hipExtGetLastError.cc │ ├── hipGetErrorName.cc │ ├── hipGetErrorString.cc │ ├── hipGetLastError.cc │ ├── hipGetLastErrorEnv_Exe.cc │ ├── hipPeekAtLastError.cc │ └── hipPeekAtLastErrorEnv_Exe.cc │ ├── event │ ├── CMakeLists.txt │ ├── Unit_hipEvent.cc │ ├── Unit_hipEventElapsedTime.cc │ ├── Unit_hipEventIpc.cc │ ├── Unit_hipEventMGpuMThreads.cc │ ├── Unit_hipEventQuery.cc │ ├── Unit_hipEventRecord.cc │ ├── Unit_hipEvent_Negative.cc │ ├── hipEventCreate.cc │ ├── hipEventCreateWithFlags.cc │ ├── hipEventDestroy.cc │ └── hipEventSynchronize.cc │ ├── executionControl │ ├── CMakeLists.txt │ ├── execution_control_common.cc │ ├── execution_control_common.hh │ ├── hipExtLaunchKernel.cc │ ├── hipExtLaunchMultiKernelMultiDevice.cc │ ├── hipFuncGetAttributes.cc │ ├── hipFuncSetAttribute.cc │ ├── hipFuncSetCacheConfig.cc │ ├── hipFuncSetSharedMemConfig.cc │ ├── hipGetProcAddressLaunchCbExecCtrlApis.cc │ ├── hipLaunchCooperativeKernel.cc │ ├── hipLaunchCooperativeKernelMultiDevice.cc │ ├── hipLaunchKernel.cc │ └── launch_api.cc │ ├── g++ │ ├── CMakeLists.txt │ ├── hipMalloc.cc │ ├── hipMalloc.cpp │ └── hipMalloc.h │ ├── gcc │ ├── CMakeLists.txt │ ├── LaunchKernel.c │ ├── LaunchKernel.h │ ├── gccTest.cc │ ├── gpu.cpp │ └── hipMalloc.c │ ├── gl_interop │ ├── CMakeLists.txt │ ├── gl_interop_common.hh │ ├── hipGLGetDevices.cc │ ├── hipGraphicsGLRegisterBuffer.cc │ ├── hipGraphicsGLRegisterImage.cc │ ├── hipGraphicsMapResources.cc │ ├── hipGraphicsResourceGetMappedPointer.cc │ ├── hipGraphicsSubResourceGetMappedArray.cc │ ├── hipGraphicsUnmapResources.cc │ └── hipGraphicsUnregisterResource.cc │ ├── graph │ ├── CMakeLists.txt │ ├── add_Kernel.cpp │ ├── graph_dependency_common.hh │ ├── graph_memcpy_to_from_symbol_common.hh │ ├── graph_memset_node_test_common.hh │ ├── graph_tests_common.hh │ ├── hipDeviceGetGraphMemAttribute.cc │ ├── hipDeviceGraphMemTrim.cc │ ├── hipDeviceSetGraphMemAttribute.cc │ ├── hipDrvGraphAddMemFreeNode.cc │ ├── hipDrvGraphAddMemcpyNode.cc │ ├── hipDrvGraphAddMemsetNode.cc │ ├── hipDrvGraphExecMemcpyNodeSetParams.cc │ ├── hipDrvGraphExecMemsetNodeSetParams.cc │ ├── hipDrvGraphMemcpyNodeGetParams.cc │ ├── hipDrvGraphMemcpyNodeSetParams.cc │ ├── hipGetProcAddressGraphApis.cc │ ├── hipGraph.cc │ ├── hipGraphAddBatchMemOpNode.cc │ ├── hipGraphAddChildGraphNode.cc │ ├── hipGraphAddDependencies.cc │ ├── hipGraphAddDependencies_old.cc │ ├── hipGraphAddEmptyNode.cc │ ├── hipGraphAddEventRecordNode.cc │ ├── hipGraphAddEventWaitNode.cc │ ├── hipGraphAddHostNode.cc │ ├── hipGraphAddKernelNode.cc │ ├── hipGraphAddMemAllocNode.cc │ ├── hipGraphAddMemFreeNode.cc │ ├── hipGraphAddMemcpyNode.cc │ ├── hipGraphAddMemcpyNode1D.cc │ ├── hipGraphAddMemcpyNode1D_old.cc │ ├── hipGraphAddMemcpyNodeFromSymbol.cc │ ├── hipGraphAddMemcpyNodeFromSymbol_old.cc │ ├── hipGraphAddMemcpyNodeToSymbol.cc │ ├── hipGraphAddMemcpyNodeToSymbol_old.cc │ ├── hipGraphAddMemcpyNode_old.cc │ ├── hipGraphAddMemsetNode.cc │ ├── hipGraphAddNode.cc │ ├── hipGraphAddNodeBeginCapture.cc │ ├── hipGraphAsyncUserObj.cc │ ├── hipGraphBatchMemOpNodeSetParams.cc │ ├── hipGraphChildGraphNodeGetGraph.cc │ ├── hipGraphClone.cc │ ├── hipGraphCloneComplx.cc │ ├── hipGraphCreate.cc │ ├── hipGraphCycle.cc │ ├── hipGraphDebugDotPrint.cc │ ├── hipGraphDestroy.cc │ ├── hipGraphDestroyNode.cc │ ├── hipGraphEventRecordNodeGetEvent.cc │ ├── hipGraphEventRecordNodeSetEvent.cc │ ├── hipGraphEventWaitNodeGetEvent.cc │ ├── hipGraphEventWaitNodeSetEvent.cc │ ├── hipGraphExecBatchMemOpNodeSetParams.cc │ ├── hipGraphExecChildGraphNodeSetParams.cc │ ├── hipGraphExecDestroy.cc │ ├── hipGraphExecEventRecordNodeSetEvent.cc │ ├── hipGraphExecEventWaitNodeSetEvent.cc │ ├── hipGraphExecGetFlags.cc │ ├── hipGraphExecHostNodeSetParams.cc │ ├── hipGraphExecKernelNodeSetParams.cc │ ├── hipGraphExecMemcpyNodeSetParams.cc │ ├── hipGraphExecMemcpyNodeSetParams1D.cc │ ├── hipGraphExecMemcpyNodeSetParams1D_old.cc │ ├── hipGraphExecMemcpyNodeSetParamsFromSymbol.cc │ ├── hipGraphExecMemcpyNodeSetParamsFromSymbol_old.cc │ ├── hipGraphExecMemcpyNodeSetParamsToSymbol.cc │ ├── hipGraphExecMemcpyNodeSetParamsToSymbol_old.cc │ ├── hipGraphExecMemcpyNodeSetParams_old.cc │ ├── hipGraphExecMemsetNodeSetParams.cc │ ├── hipGraphExecNodeSetParams.cc │ ├── hipGraphExecUpdate.cc │ ├── hipGraphGetEdges.cc │ ├── hipGraphGetEdges_old.cc │ ├── hipGraphGetNodes.cc │ ├── hipGraphGetNodes_old.cc │ ├── hipGraphGetRootNodes.cc │ ├── hipGraphGetRootNodes_old.cc │ ├── hipGraphHostNodeGetParams.cc │ ├── hipGraphHostNodeSetParams.cc │ ├── hipGraphInstantiate.cc │ ├── hipGraphInstantiateWithFlags.cc │ ├── hipGraphInstantiateWithParams.cc │ ├── hipGraphKernelNodeCopyAttributes.cc │ ├── hipGraphKernelNodeGetAttribute.cc │ ├── hipGraphKernelNodeGetParams.cc │ ├── hipGraphKernelNodeSetAttribute.cc │ ├── hipGraphKernelNodeSetAttribute_old.cc │ ├── hipGraphKernelNodeSetParams.cc │ ├── hipGraphLaunch.cc │ ├── hipGraphLaunch_old.cc │ ├── hipGraphMemAllocNodeGetParams.cc │ ├── hipGraphMemFreeNodeGetParams.cc │ ├── hipGraphMemcpyNodeGetParams.cc │ ├── hipGraphMemcpyNodeGetParams_old.cc │ ├── hipGraphMemcpyNodeSetParams.cc │ ├── hipGraphMemcpyNodeSetParams1D.cc │ ├── hipGraphMemcpyNodeSetParams1D_old.cc │ ├── hipGraphMemcpyNodeSetParamsFromSymbol.cc │ ├── hipGraphMemcpyNodeSetParamsFromSymbol_old.cc │ ├── hipGraphMemcpyNodeSetParamsToSymbol.cc │ ├── hipGraphMemcpyNodeSetParamsToSymbol_old.cc │ ├── hipGraphMemcpyNodeSetParams_old.cc │ ├── hipGraphMemsetNodeGetParams.cc │ ├── hipGraphMemsetNodeSetParams.cc │ ├── hipGraphNodeFindInClone.cc │ ├── hipGraphNodeGetDependencies.cc │ ├── hipGraphNodeGetDependencies_old.cc │ ├── hipGraphNodeGetDependentNodes.cc │ ├── hipGraphNodeGetDependentNodes_old.cc │ ├── hipGraphNodeGetEnabled.cc │ ├── hipGraphNodeGetType.cc │ ├── hipGraphNodeSetEnabled.cc │ ├── hipGraphNodeSetParams.cc │ ├── hipGraphPerf.cc │ ├── hipGraphReleaseUserObject.cc │ ├── hipGraphRemoveDependencies.cc │ ├── hipGraphRemoveDependencies_old.cc │ ├── hipGraphRetainUserObject.cc │ ├── hipGraphUpload.cc │ ├── hipLaunchHostFunc.cc │ ├── hipMatMul.cc │ ├── hipSimpleGraphWithKernel.cc │ ├── hipStreamBeginCapture.cc │ ├── hipStreamBeginCaptureToGraph.cc │ ├── hipStreamBeginCapture_old.cc │ ├── hipStreamCaptureExtModuleLaunchKernel.cc │ ├── hipStreamEndCapture.cc │ ├── hipStreamEndCapture_old.cc │ ├── hipStreamGetCaptureInfo.cc │ ├── hipStreamGetCaptureInfo_old.cc │ ├── hipStreamGetCaptureInfo_v2.cc │ ├── hipStreamGetCaptureInfo_v2_old.cc │ ├── hipStreamIsCapturing.cc │ ├── hipStreamIsCapturing_old.cc │ ├── hipStreamUpdateCaptureDependencies.cc │ ├── hipThreadExchangeStreamCaptureMode.cc │ ├── hipUserObjectCreate.cc │ ├── hipUserObjectRelease.cc │ ├── hipUserObjectRetain.cc │ ├── stream_capture_common.hh │ └── user_object_common.hh │ ├── hip_specific │ ├── CMakeLists.txt │ ├── hip_hc_8pk.cc │ ├── hip_hc_8pk_negative_kernels.cc │ └── hip_hc_8pk_negative_kernels_rtc.hh │ ├── kernel │ ├── CMakeLists.txt │ ├── hipAutoThreadIdx.cc │ ├── hipConfigureCall.cc │ ├── hipDynamicShared.cc │ ├── hipDynamicShared2.cc │ ├── hipEmptyKernel.cc │ ├── hipExtLaunchKernelGGL.cc │ ├── hipGridLaunch.cc │ ├── hipLanguageExtensions.cc │ ├── hipLaunchBounds.cc │ ├── hipLaunchKernelEx.cc │ ├── hipLaunchParm.cc │ ├── hipLaunchParmFunctor.cc │ ├── hipMemFaultStackAllocation.cc │ ├── hipPrintfKernel.cc │ ├── hipSetupArgument.cc │ ├── hipTestConstant.cc │ ├── hipTestGlobalVariable.cc │ ├── hipTestMemKernel.cc │ ├── launch_bounds.cc │ └── printf_common.h │ ├── launchBounds │ ├── CMakeLists.txt │ ├── launch_bounds.cc │ ├── launch_bounds_compiler_error_kernels.cc │ ├── launch_bounds_negative_kernels_rtc.hh │ └── launch_bounds_parse_error_kernels.cc │ ├── math │ ├── CMakeLists.txt │ ├── Float16.hh │ ├── binary_common.hh │ ├── casting_common.hh │ ├── casting_double_funcs.cc │ ├── casting_double_negative_kernels.cc │ ├── casting_double_negative_kernels_rtc.hh │ ├── casting_float_funcs.cc │ ├── casting_float_negative_kernels.cc │ ├── casting_float_negative_kernels_rtc.hh │ ├── casting_half2_common.hh │ ├── casting_half2_funcs.cc │ ├── casting_half2_negative_kernels.cc │ ├── casting_half2int_funcs.cc │ ├── casting_half2int_negative_kernels.cc │ ├── casting_half_float_funcs.cc │ ├── casting_half_float_negative_kernels.cc │ ├── casting_int2half_funcs.cc │ ├── casting_int2half_negative_kernels.cc │ ├── casting_int_funcs.cc │ ├── casting_int_negative_kernels.cc │ ├── casting_int_negative_kernels_rtc.hh │ ├── double_precision_intrinsics.cc │ ├── double_precision_intrinsics_negative_kernels.cc │ ├── half_precision_arithmetic.cc │ ├── half_precision_arithmetic_negative_kernels.cc │ ├── half_precision_common.hh │ ├── half_precision_comparison.cc │ ├── half_precision_comparison_negative_kernels.cc │ ├── half_precision_math.cc │ ├── half_precision_math_negative_kernels.cc │ ├── integer_intrinsics.cc │ ├── integer_intrinsics_negative_kernels.cc │ ├── log_funcs.cc │ ├── math_common.hh │ ├── math_log_negative_kernels.cc │ ├── math_log_negative_kernels_rtc.hh │ ├── math_pow_negative_kernels.cc │ ├── math_pow_negative_kernels_rtc.hh │ ├── math_remainder_negative_kernels.cc │ ├── math_remainder_rounding_negative_kernels_rtc.hh │ ├── math_root_negative_kernels_1Dand2D.cc │ ├── math_root_negative_kernels_3Dand4D.cc │ ├── math_root_negative_kernels_rtc.hh │ ├── math_rounding_negative_kernels.cc │ ├── math_special_func_kernels.cc │ ├── math_special_func_kernels_rtc.hh │ ├── math_special_values.hh │ ├── misc_funcs.cc │ ├── misc_negative_kernels.cc │ ├── misc_negative_kernels_rtc.hh │ ├── pow_common.hh │ ├── pow_funcs.cc │ ├── quaternary_common.hh │ ├── remainder_and_rounding_funcs.cc │ ├── root_funcs.cc │ ├── single_precision_intrinsics.cc │ ├── single_precision_intrinsics_negative_kernels.cc │ ├── special_common.hh │ ├── special_funcs.cc │ ├── ternary_common.hh │ ├── thread_pool.hh │ ├── trig_double_precision_negative_kernels.cc │ ├── trig_funcs.cc │ ├── trig_negative_kernels_rtc.hh │ ├── trig_single_precision_negative_kernels.cc │ ├── unary_common.hh │ └── validators.hh │ ├── memory │ ├── CMakeLists.txt │ ├── DriverContext.cc │ ├── DriverContext.hh │ ├── MemUtils.hh │ ├── array_memcpy_tests_common.hh │ ├── hipArray.cc │ ├── hipArray3DCreate.cc │ ├── hipArray3DGetDescriptor.cc │ ├── hipArrayCommon.hh │ ├── hipArrayCreate.cc │ ├── hipArrayGetDescriptor.cc │ ├── hipArrayGetInfo.cc │ ├── hipDeviceGetMemPool.cc │ ├── hipDeviceSetMemPool.cc │ ├── hipDrvMemcpy2DUnaligned.cc │ ├── hipDrvMemcpy3D.cc │ ├── hipDrvMemcpy3DAsync.cc │ ├── hipDrvMemcpy3DAsync_old.cc │ ├── hipDrvMemcpy3D_old.cc │ ├── hipDrvPtrGetAttributes.cc │ ├── hipExtMallocWithFlags.cc │ ├── hipFree.cc │ ├── hipFreeArray.cc │ ├── hipFreeAsync.cc │ ├── hipFreeHost.cc │ ├── hipFreeMipmappedArray.cc │ ├── hipGetProcAddressMemoryApis.cc │ ├── hipGetSymbolSizeAddress.cc │ ├── hipHostAlloc.cc │ ├── hipHostFree.cc │ ├── hipHostGetDevicePointer.cc │ ├── hipHostGetFlags.cc │ ├── hipHostMalloc.cc │ ├── hipHostMallocTests.cc │ ├── hipHostRegister.cc │ ├── hipHostRegister_exe.cc │ ├── hipHostUnregister.cc │ ├── hipMalloc.cc │ ├── hipMalloc3D.cc │ ├── hipMalloc3DArray.cc │ ├── hipMallocArray.cc │ ├── hipMallocAsync.cc │ ├── hipMallocConcurrency.cc │ ├── hipMallocFromPoolAsync.cc │ ├── hipMallocHost.cc │ ├── hipMallocManaged.cc │ ├── hipMallocManagedFlagsTst.cc │ ├── hipMallocManaged_MultiScenario.cc │ ├── hipMallocMipmappedArray.cc │ ├── hipMallocMngdMultiThread.cc │ ├── hipMallocPitch.cc │ ├── hipMemAdvise.cc │ ├── hipMemAdviseMmap.cc │ ├── hipMemAdvise_AlignedAllocMem_Exe.cc │ ├── hipMemAdvise_old.cc │ ├── hipMemAllocHost.cc │ ├── hipMemCoherencyTst.cc │ ├── hipMemGetAddressRange.cc │ ├── hipMemGetInfo.cc │ ├── hipMemPoolApi.cc │ ├── hipMemPoolCreate.cc │ ├── hipMemPoolDestroy.cc │ ├── hipMemPoolExportPointer.cc │ ├── hipMemPoolExportToShareableHandle.cc │ ├── hipMemPoolImportFromShareableHandle.cc │ ├── hipMemPoolImportPointer.cc │ ├── hipMemPoolMaxAlloc.cc │ ├── hipMemPoolSetGetAccess.cc │ ├── hipMemPoolSetGetAttribute.cc │ ├── hipMemPoolTrimTo.cc │ ├── hipMemPrefetchAsync.cc │ ├── hipMemPrefetchAsyncExtTsts.cc │ ├── hipMemPtrGetInfo.cc │ ├── hipMemRangeGetAttribute.cc │ ├── hipMemRangeGetAttribute_old.cc │ ├── hipMemRangeGetAttributes.cc │ ├── hipMemRangeGetAttributes_old.cc │ ├── hipMemVmm.cc │ ├── hipMemcpy2D.cc │ ├── hipMemcpy2DArrayToArray.cc │ ├── hipMemcpy2DAsync.cc │ ├── hipMemcpy2DAsync_old.cc │ ├── hipMemcpy2DFromArray.cc │ ├── hipMemcpy2DFromArrayAsync.cc │ ├── hipMemcpy2DFromArrayAsync_old.cc │ ├── hipMemcpy2DFromArray_old.cc │ ├── hipMemcpy2DToArray.cc │ ├── hipMemcpy2DToArrayAsync.cc │ ├── hipMemcpy2DToArrayAsync_old.cc │ ├── hipMemcpy2DToArray_old.cc │ ├── hipMemcpy2D_old.cc │ ├── hipMemcpy3D.cc │ ├── hipMemcpy3DAsync.cc │ ├── hipMemcpy3DAsync_old.cc │ ├── hipMemcpy3D_old.cc │ ├── hipMemcpyAllApiNegative.cc │ ├── hipMemcpyAsync.cc │ ├── hipMemcpyAsync_derivatives.cc │ ├── hipMemcpyAsync_old.cc │ ├── hipMemcpyAtoA.cc │ ├── hipMemcpyAtoD.cc │ ├── hipMemcpyAtoH.cc │ ├── hipMemcpyAtoHAsync.cc │ ├── hipMemcpyAtoH_old.cc │ ├── hipMemcpyDeviceToDeviceNoCU.cc │ ├── hipMemcpyDtoA.cc │ ├── hipMemcpyDtoD.cc │ ├── hipMemcpyDtoDAsync.cc │ ├── hipMemcpyFromSymbol.cc │ ├── hipMemcpyHtoA.cc │ ├── hipMemcpyHtoAAsync.cc │ ├── hipMemcpyHtoA_old.cc │ ├── hipMemcpyParam2D.cc │ ├── hipMemcpyParam2DAsync.cc │ ├── hipMemcpyParam2DAsync_old.cc │ ├── hipMemcpyParam2D_old.cc │ ├── hipMemcpyPeer.cc │ ├── hipMemcpyPeerAsync.cc │ ├── hipMemcpyPeerAsync_old.cc │ ├── hipMemcpyPeer_old.cc │ ├── hipMemcpySync.cc │ ├── hipMemcpyWithStream.cc │ ├── hipMemcpyWithStreamMultiThread.cc │ ├── hipMemcpyWithStream_old.cc │ ├── hipMemcpy_EdgeCases.cc │ ├── hipMemcpy_MultiThread.cc │ ├── hipMemcpy_derivatives.cc │ ├── hipMemoryAllocateCoherent.cc │ ├── hipMemset.cc │ ├── hipMemset2D.cc │ ├── hipMemset2DAsyncMultiThreadAndKernel.cc │ ├── hipMemset3D.cc │ ├── hipMemset3DFunctional.cc │ ├── hipMemset3DRegressMultiThread.cc │ ├── hipMemsetAsync.cc │ ├── hipMemsetAsyncAndKernel.cc │ ├── hipMemsetD16.cc │ ├── hipMemsetD16Async.cc │ ├── hipMemsetD32.cc │ ├── hipMemsetD32Async.cc │ ├── hipMemsetD8Async.cc │ ├── hipMemsetFunctional.cc │ ├── hipMemsetNegative.cc │ ├── hipMemsetSync.cc │ ├── hipPointerGetAttribute.cc │ ├── hipPointerGetAttributes.cc │ ├── hipPointerSetAttribute.cc │ ├── hipPtrGetAttribute.cc │ ├── hipSVMCommon.h │ ├── hipSVMTestByteGranularity.cpp │ ├── hipSVMTestFineGrainMemoryConsistency.cpp │ ├── hipSVMTestFineGrainSyncBuffers.cpp │ ├── hipSVMTestSharedAddressSpaceFineGrain.cpp │ ├── hipStreamAttachMemAsync.cc │ ├── inlineVar.cc │ ├── malloc.cc │ ├── memcpy2d_tests_common.hh │ ├── memoryCommon.cc │ ├── memoryCommon.hh │ ├── memoryGlobal.hh │ ├── mempool_common.hh │ └── memset.cc │ ├── module │ ├── CMakeLists.txt │ ├── addKernel.cc │ ├── coopKernel.cpp │ ├── copiousArgKernel.cc │ ├── copyKernel.cc │ ├── empty_module.cc │ ├── get_function_module.cc │ ├── get_global_test_module.cc │ ├── get_tex_ref_module.cc │ ├── hipDrvLaunchKernelEx.cc │ ├── hipExtLaunchKernelGGL.cc │ ├── hipExtLaunchMultiKernelMultiDevice.cc │ ├── hipExtModuleLaunchKernel.cc │ ├── hipFuncGetAttribute.cc │ ├── hipFuncGetAttributes.cc │ ├── hipFuncSetAttribute.cc │ ├── hipFuncSetSharedMemConfig.cc │ ├── hipGetFuncBySymbol.cc │ ├── hipGetFuncBySymbol_exe.cc │ ├── hipGetProcAddressModuleApis.cc │ ├── hipHccModuleLaunchKernel.cc │ ├── hipKerArgOptimization.cc │ ├── hipManagedKeyword.cc │ ├── hipModule.cc │ ├── hipModuleGetFunction.cc │ ├── hipModuleGetGlobal.cc │ ├── hipModuleGetGlobal.hh │ ├── hipModuleGetTexRef.cc │ ├── hipModuleLaunchCooperativeKernel.cc │ ├── hipModuleLaunchCooperativeKernelMultiDevice.cc │ ├── hipModuleLaunchKernel.cc │ ├── hipModuleLoad.cc │ ├── hipModuleLoadData.cc │ ├── hipModuleLoadDataEx.cc │ ├── hipModuleLoadMultProcessOnMultGPU.cc │ ├── hipModuleUnload.cc │ ├── hip_module_common.cc │ ├── hip_module_common.hh │ ├── hip_module_launch_kernel_common.hh │ ├── kernel_composite_test.cpp │ ├── launch_kernel_module.cc │ ├── log │ ├── managed_kernel.cpp │ ├── matmul.cpp │ ├── not_a_module.txt │ ├── testhipModuleLoadUnloadFunc_exe.cc │ └── vcpy_kernel.cpp │ ├── multiThread │ ├── CMakeLists.txt │ ├── hipMemsetAsyncMultiThread.cc │ ├── hipMultiThreadDevice.cc │ ├── hipMultiThreadStreams1.cc │ └── hipMultiThreadStreams2.cc │ ├── occupancy │ ├── CMakeLists.txt │ ├── hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc │ ├── hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc │ ├── hipModuleOccupancyMaxPotentialBlockSize.cc │ ├── hipModuleOccupancyMaxPotentialBlockSizeWithFlags.cc │ ├── hipOccupancyMaxActiveBlocksPerMultiprocessor.cc │ ├── hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc │ ├── hipOccupancyMaxActiveBlocksPerMultiprocessor_old.cc │ ├── hipOccupancyMaxPotentialBlockSize.cc │ ├── hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags.cc │ ├── hipOccupancyMaxPotentialBlockSize_old.cc │ ├── occupancy_common.hh │ └── simple_kernel.cc │ ├── p2p │ ├── CMakeLists.txt │ ├── hipDeviceGetP2PAttribute.cc │ ├── hipDeviceGetP2PAttribute_exe.cc │ ├── hipP2pLinkTypeAndHopFunc.cc │ └── hipP2pLinkTypeAndHopFunc.h │ ├── printf │ ├── CMakeLists.txt │ ├── hipPrintfAltForms.cc │ ├── hipPrintfBasic.cc │ ├── hipPrintfManyDevices.cc │ ├── hipPrintfManyWaves.cc │ ├── hipPrintfStar.cc │ ├── hipPrintfWidthPrecision.cc │ ├── printfFlags.cc │ ├── printfFlagsNonHost.cc │ ├── printfFlagsNonHost_exe.cc │ ├── printfFlags_exe.cc │ ├── printfHost.cc │ ├── printfLength.cc │ ├── printfLength_exe.cc │ ├── printfNonHost.cc │ ├── printfSpecifiers.cc │ ├── printfSpecifiersNonHost.cc │ ├── printfSpecifiersNonHost_exe.cc │ ├── printfSpecifiers_exe.cc │ ├── printf_common.h │ ├── printf_negative_kernels.cc │ └── printf_negative_kernels_rtc.hh │ ├── rtc │ ├── CMakeLists.txt │ ├── ChkPtrdiff_t_Exe.cc │ ├── RtcConfig.json │ ├── RtcFunctions.cpp │ ├── RtcUtility.cpp │ ├── customOptions.cc │ ├── headers │ │ ├── RtcFact.h │ │ ├── RtcFunctions.h │ │ ├── RtcKernels.h │ │ ├── RtcUtility.h │ │ ├── printf_common.h │ │ ├── test_header1.h │ │ └── test_header2.h │ ├── hipRTCDeviceMalloc.cc │ ├── hipRtcBfloat16.cc │ ├── hipRtcComplexHeader.cc │ ├── hipRtcFunctional.cc │ ├── hipRtcPtrdiff_t.cc │ ├── hipStreamCaptureRtc.cc │ ├── hiprtcComplrOptnTesting.cc │ ├── hiprtcGetLoweredName.cc │ ├── hiprtc_Bitcode_UndefinedFn.cc │ ├── hiprtc_MathConstants_HeaderTst.cc │ ├── hiprtc_MathFunctions_HeaderTst.cc │ ├── hiprtc_TextureTypes_HeaderTst.cc │ ├── hiprtc_VectorTypes_HeaderTst.cc │ ├── hiprtc_bfloat16_HeaderTst.cc │ ├── hiprtc_fp16_HeaderTst.cc │ ├── includepath.cc │ ├── linker.cc │ ├── rtc_reduce.cc │ ├── saxpy.cc │ ├── saxpy.h │ ├── shfl.cc │ ├── shfl.hh │ ├── shfl_sync.cc │ ├── stdheaders.cc │ └── warpsize.cc │ ├── stream │ ├── CMakeLists.txt │ ├── hipAPIStreamDisable.cc │ ├── hipDeviceGetStreamPriorityRange.cc │ ├── hipLaunchHostFunc.cc │ ├── hipMultiStream.cc │ ├── hipStreamACb_MultiThread.cc │ ├── hipStreamACb_StrmSyncTiming.cc │ ├── hipStreamAddCallback.cc │ ├── hipStreamAttachMemAsync.cc │ ├── hipStreamAttachMemAsync_old.cc │ ├── hipStreamBatchMemOp.cc │ ├── hipStreamCreate.cc │ ├── hipStreamCreateWithFlags.cc │ ├── hipStreamCreateWithPriority.cc │ ├── hipStreamDestroy.cc │ ├── hipStreamGetCUMask.cc │ ├── hipStreamGetDevice.cc │ ├── hipStreamGetFlags.cc │ ├── hipStreamGetFlags_spt.cc │ ├── hipStreamGetPriority.cc │ ├── hipStreamGetPriority_spt.cc │ ├── hipStreamLegacy.cc │ ├── hipStreamLegacy_Ext.cc │ ├── hipStreamLegacy_compiler_options.cc │ ├── hipStreamLegacy_exe.cc │ ├── hipStreamQuery.cc │ ├── hipStreamQuery_spt.cc │ ├── hipStreamSynchronize.cc │ ├── hipStreamSynchronize_spt.cc │ ├── hipStreamValue.cc │ ├── hipStreamWaitEvent.cc │ ├── hipStreamWithCUMask.cc │ ├── streamCommon.cc │ └── streamCommon.hh │ ├── streamperthread │ ├── CMakeLists.txt │ ├── hipGetProcAddressSptApis.cc │ ├── hipStreamPerThrdCompilerOptn.cc │ ├── hipStreamPerThrdTsts.cc │ ├── hipStreamPerThread_Basic.cc │ ├── hipStreamPerThread_DeviceReset.cc │ ├── hipStreamPerThread_Event.cc │ └── hipStreamPerThread_MultiThread.cc │ ├── surface │ ├── CMakeLists.txt │ ├── hipCreateSurfaceObject.cc │ ├── hipDestroySurfaceObject.cc │ ├── surf1D.cc │ ├── surf1DLayered.cc │ ├── surf2D.cc │ ├── surf2DLayered.cc │ ├── surf3D.cc │ ├── surfCubemap.cc │ └── surfCubemapLayered.cc │ ├── synchronization │ ├── CMakeLists.txt │ ├── cache_coherency_cpu_gpu.cc │ ├── cache_coherency_gpu_gpu.cc │ ├── copy_coherency.cc │ └── memcpyIntDevice.cpp │ ├── syncthreads │ ├── CMakeLists.txt │ ├── __syncthreads.cc │ ├── __syncthreads_and.cc │ ├── __syncthreads_and_negative_kernels.cc │ ├── __syncthreads_and_negative_kernels_rtc.hh │ ├── __syncthreads_count.cc │ ├── __syncthreads_count_negative_kernels.cc │ ├── __syncthreads_count_negative_kernels_rtc.hh │ ├── __syncthreads_or.cc │ ├── __syncthreads_or_negative_kernels.cc │ ├── __syncthreads_or_negative_kernels_rtc.hh │ └── syncthreads_common.hh │ ├── texture │ ├── CMakeLists.txt │ ├── fixed_point.hh │ ├── hipBindTexture.cc │ ├── hipBindTexture2D.cc │ ├── hipBindTextureToArray.cc │ ├── hipBindTextureToMipmappedArray.cc │ ├── hipCreateTextureObject_ArgValidation.cc │ ├── hipCreateTextureObject_Array.cc │ ├── hipCreateTextureObject_Linear.cc │ ├── hipCreateTextureObject_Pitch2D.cc │ ├── hipFreeMipmappedArray.cc │ ├── hipGetChanDesc.cc │ ├── hipGetMipmappedArrayLevel.cc │ ├── hipGetTextureAlignmentOffset.cc │ ├── hipGetTextureReference.cc │ ├── hipMallocMipmappedArray.cc │ ├── hipMipmappedArrayCreate.cc │ ├── hipMipmappedArrayDestroy.cc │ ├── hipMipmappedArrayGetLevel.cc │ ├── hipNormalizedFloatValueTex.cc │ ├── hipSimpleTexture1DLayered.cc │ ├── hipSimpleTexture2DLayered.cc │ ├── hipSimpleTexture3D.cc │ ├── hipTex1DFetchCheckModes.cc │ ├── hipTexObjPitch.cc │ ├── hipTexObjectCreate.cc │ ├── hipTexObjectTests.cc │ ├── hipTexRefGetAddress.cc │ ├── hipTexRefGetAddressMode.cc │ ├── hipTexRefGetArray.cc │ ├── hipTexRefGetBorderColor.cc │ ├── hipTexRefGetFlags.cc │ ├── hipTexRefGetFormat.cc │ ├── hipTexRefGetMaxAnisotropy.cc │ ├── hipTexRefSetAddress.cc │ ├── hipTexRefSetAddress2D.cc │ ├── hipTexRefSetAddressMode.cc │ ├── hipTexRefSetArray.cc │ ├── hipTexRefSetBorderColor.cc │ ├── hipTexRefSetFlags.cc │ ├── hipTexRefSetFormat.cc │ ├── hipTexRefSetMaxAnisotropy.cc │ ├── hipTextureMipmapObj1D.cc │ ├── hipTextureMipmapObj2D.cc │ ├── hipTextureMipmapObj3D.cc │ ├── hipTextureObj1DCheckModes.cc │ ├── hipTextureObj1DCheckSRGBModes.cc │ ├── hipTextureObj1DFetch.cc │ ├── hipTextureObj2D.cc │ ├── hipTextureObj2DCheckModes.cc │ ├── hipTextureObj2DCheckSRGBModes.cc │ ├── hipTextureObj3DCheckModes.cc │ ├── hipTextureObjFetchVector.cc │ ├── hipTextureObjectTests.cc │ ├── hipTextureRef2D.cc │ ├── hipUnbindTexture.cc │ ├── kernels.hh │ ├── test_fixture.hh │ ├── tex1D.cc │ ├── tex1DGrad.cc │ ├── tex1DLayered.cc │ ├── tex1DLayeredGrad.cc │ ├── tex1DLayeredLod.cc │ ├── tex1DLod.cc │ ├── tex1Dfetch.cc │ ├── tex2D.cc │ ├── tex2DGrad.cc │ ├── tex2DLayered.cc │ ├── tex2DLayeredGrad.cc │ ├── tex2DLayeredLod.cc │ ├── tex2DLod.cc │ ├── tex2Dgather.cc │ ├── tex3D.cc │ ├── tex3DGrad.cc │ ├── tex3DLod.cc │ ├── texCubemap.cc │ ├── texCubemapGrad.cc │ ├── texCubemapLayered.cc │ ├── texCubemapLayeredGrad.cc │ ├── texCubemapLayeredLod.cc │ ├── texCubemapLod.cc │ ├── tex_ref_get_module.cc │ ├── texture_reference.hh │ ├── utils.hh │ └── vec4.hh │ ├── threadfence │ ├── CMakeLists.txt │ ├── __threadfence.cc │ ├── __threadfence_block.cc │ ├── __threadfence_system.cc │ └── threadfence_common.hh │ ├── vector_types │ ├── CMakeLists.txt │ ├── dim3.cc │ ├── negative_bitwise_double.cc │ ├── negative_bitwise_float.cc │ ├── negative_bitwise_float_double_rtc.hh │ ├── negative_calculate_assign_with_unsigned_value_1D.cc │ ├── negative_calculate_assign_with_unsigned_value_2D.cc │ ├── negative_calculate_assign_with_unsigned_value_3D.cc │ ├── negative_calculate_assign_with_unsigned_value_4D.cc │ ├── negative_calculate_assign_with_value_1D.cc │ ├── negative_calculate_assign_with_value_2D.cc │ ├── negative_calculate_assign_with_value_3D.cc │ ├── negative_calculate_assign_with_value_4D.cc │ ├── negative_calculate_assign_with_value_rtc.hh │ ├── negative_macros_common.hh │ ├── negative_negate_unsigned.cc │ ├── negative_negate_unsigned_rtc.hh │ ├── vector_operations_common.hh │ ├── vector_types.cc │ └── vector_types_common.hh │ ├── virtualMemoryManagement │ ├── CMakeLists.txt │ ├── hipGetProcAddressVmmApis.cc │ ├── hipMemAddressFree.cc │ ├── hipMemAddressReserve.cc │ ├── hipMemCreate.cc │ ├── hipMemExportToShareableHandle.cc │ ├── hipMemGetAllocationGranularity.cc │ ├── hipMemGetAllocationPropertiesFromHandle.cc │ ├── hipMemImportFromShareableHandle.cc │ ├── hipMemMap.cc │ ├── hipMemMapArrayAsync.cc │ ├── hipMemRelease.cc │ ├── hipMemRetainAllocationHandle.cc │ ├── hipMemSetGetAccess.cc │ ├── hipMemUnmap.cc │ ├── hipMemVmm_old.cc │ └── hip_vmm_common.hh │ ├── vulkan_interop │ ├── CMakeLists.txt │ ├── graph_tests_common.hh │ ├── hipDestroyExternalMemory.cc │ ├── hipDestroyExternalSemaphore.cc │ ├── hipExternalMemoryGetMappedBuffer.cc │ ├── hipExternalMemoryGetMappedMipmappedArray.cc │ ├── hipGraphAddExternalSemaphoresSignalNode.cc │ ├── hipGraphAddExternalSemaphoresWaitNode.cc │ ├── hipGraphExecExternalSemaphoresSignalNodeSetParams.cc │ ├── hipGraphExecExternalSemaphoresWaitNodeSetParams.cc │ ├── hipGraphExternalSemaphoresSignalNodeGetParams.cc │ ├── hipGraphExternalSemaphoresSignalNodeSetParams.cc │ ├── hipGraphExternalSemaphoresWaitNodeGetParams.cc │ ├── hipGraphExternalSemaphoresWaitNodeSetParams.cc │ ├── hipImportExternalMemory.cc │ ├── hipImportExternalSemaphore.cc │ ├── hipSignalExternalSemaphoresAsync.cc │ ├── hipWaitExternalSemaphoresAsync.cc │ ├── signal_semaphore_common.hh │ ├── vulkan_test.cc │ ├── vulkan_test.hh │ └── wait_semaphore_common.hh │ └── warp │ ├── CMakeLists.txt │ ├── hipMatchSyncAllTests.cc │ ├── hipMatchSyncAnyTests.cc │ ├── hipShflSyncDownTests.cc │ ├── hipShflSyncTests.cc │ ├── hipShflSyncUpTests.cc │ ├── hipShflSyncXorTests.cc │ ├── hipShflTests.cc │ ├── hipShflUpDownTest.cc │ ├── hipVoteSyncTests.cc │ ├── warp_all.cc │ ├── warp_any.cc │ ├── warp_ballot.cc │ ├── warp_reduce.cc │ ├── warp_shfl.cc │ ├── warp_shfl_common.hh │ ├── warp_shfl_down.cc │ ├── warp_shfl_up.cc │ ├── warp_shfl_xor.cc │ └── warp_vote_common.hh ├── perftests ├── README.md ├── compute │ ├── hipPerfDotProduct.cpp │ └── hipPerfMandelbrot.cpp ├── dispatch │ └── hipPerfDispatchSpeed.cpp ├── memory │ ├── hipPerfBufferCopyRectSpeed.cpp │ ├── hipPerfBufferCopySpeed.cpp │ ├── hipPerfDevMemReadSpeed.cpp │ ├── hipPerfDevMemWriteSpeed.cpp │ ├── hipPerfHostNumaAlloc.cpp │ ├── hipPerfMemFill.cpp │ ├── hipPerfMemMallocCpyFree.cpp │ ├── hipPerfMemcpy.cpp │ ├── hipPerfMemset.cpp │ ├── hipPerfSampleRate.cpp │ └── hipPerfSharedMemReadSpeed.cpp ├── module │ └── hipPerfModuleLoad.cpp ├── stream │ ├── hipPerfDeviceConcurrency.cpp │ ├── hipPerfStreamConcurrency.cpp │ └── hipPerfStreamCreateCopyDestroy.cpp ├── test_common.cpp ├── test_common.h ├── timer.cpp └── timer.h ├── samples ├── 0_Intro │ ├── CMakeLists.txt │ ├── bit_extract │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── bit_extract.cpp │ ├── generic_target │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── saxpy.cpp │ │ └── square.cpp │ ├── module_api │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── defaultDriver.cpp │ │ ├── launchKernelHcc.cpp │ │ ├── runKernel.cpp │ │ └── vcpy_kernel.cpp │ ├── module_api_global │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── runKernel.cpp │ │ └── vcpy_kernel.cpp │ └── square │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── square.cu │ │ └── square.hipref.cpp ├── 1_Utils │ ├── CMakeLists.txt │ ├── hipDispatchLatency │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── hipDispatchEnqueueRateMT.cpp │ │ ├── hipDispatchLatency.cpp │ │ └── test_kernel.cpp │ └── hipInfo │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── hipInfo.cpp ├── 2_Cookbook │ ├── 0_MatrixTranspose │ │ ├── CMakeLists.txt │ │ ├── MatrixTranspose.cpp │ │ └── Readme.md │ ├── 10_inline_asm │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── inline_asm.cpp │ ├── 11_texture_driver │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ ├── tex2dKernel.cpp │ │ └── texture2dDrv.cpp │ ├── 12_cmake_hip_add_executable │ │ ├── CMakeLists.txt │ │ ├── MatrixTranspose.cpp │ │ └── Readme.md │ ├── 13_occupancy │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── occupancy.cpp │ ├── 14_gpu_arch │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── gpuarch.cpp │ ├── 15_static_library │ │ ├── README.md │ │ ├── device_functions │ │ │ ├── CMakeLists.txt │ │ │ ├── hipDevice.cpp │ │ │ └── hipMain2.cpp │ │ └── host_functions │ │ │ ├── CMakeLists.txt │ │ │ ├── hipMain1.cpp │ │ │ └── hipOptLibrary.cpp │ ├── 16_assembly_to_executable │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── hip_obj_gen.mcin │ │ └── square.cpp │ ├── 17_llvm_ir_to_executable │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── hip_obj_gen.mcin │ │ └── square.cpp │ ├── 18_cmake_hip_device │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── square.cpp │ ├── 19_cmake_lang │ │ ├── CMakeLists.txt │ │ ├── MatrixTranspose.cpp │ │ ├── README.md │ │ └── TestFortran.F90 │ ├── 1_hipEvent │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── hipEvent.cpp │ ├── 21_cmake_hip_cxx_clang │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── square.cpp │ ├── 22_cmake_hip_lang │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── square.hip │ ├── 23_cmake_hiprtc │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── saxpy.cpp │ ├── 3_shared_memory │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── sharedMemory.cpp │ ├── 4_shfl │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── shfl.cpp │ ├── 5_2dshfl │ │ ├── 2dshfl.cpp │ │ ├── CMakeLists.txt │ │ └── Readme.md │ ├── 6_dynamic_shared │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── dynamic_shared.cpp │ ├── 7_streams │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── stream.cpp │ ├── 8_peer2peer │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── peer2peer.cpp │ ├── 9_unroll │ │ ├── CMakeLists.txt │ │ ├── Readme.md │ │ └── unroll.cpp │ └── CMakeLists.txt ├── CMakeLists.txt ├── README.md ├── common │ └── hip_helper.h └── packaging │ └── CMakeLists.txt └── utils └── coverage ├── CMakeLists.txt ├── coverageReportHTML └── resources │ ├── amber.png │ ├── coverage.css │ ├── emerald.png │ ├── glass.png │ ├── ruby.png │ ├── snow.png │ └── updown.png ├── device_api_list.txt ├── hipAPI.cpp ├── hipAPI.h ├── hipAPICoverageUtils.cpp ├── hipAPICoverageUtils.h ├── hipAPIGroup.cpp ├── hipAPIGroup.h ├── mainCoverage.cpp ├── reportGenerators.cpp └── reportGenerators.h /.azuredevops/rocm-ci.yml: -------------------------------------------------------------------------------- 1 | resources: 2 | repositories: 3 | - repository: pipelines_repo 4 | type: github 5 | endpoint: ROCm 6 | name: ROCm/ROCm 7 | pipelines: 8 | - pipeline: hip_pipeline 9 | source: \HIP 10 | trigger: 11 | branches: 12 | include: 13 | - amd-staging 14 | - amd-mainline 15 | 16 | variables: 17 | - group: common 18 | - template: /.azuredevops/variables-global.yml@pipelines_repo 19 | 20 | trigger: 21 | batch: true 22 | branches: 23 | include: 24 | - amd-staging 25 | - amd-mainline 26 | paths: 27 | exclude: 28 | - '.jenkins' 29 | - CODEOWNERS 30 | - LICENSE.txt 31 | - '**/.md' 32 | 33 | pr: 34 | autoCancel: true 35 | branches: 36 | include: 37 | - amd-staging 38 | - amd-mainline 39 | paths: 40 | exclude: 41 | - '.jenkins' 42 | - CODEOWNERS 43 | - LICENSE.txt 44 | - '**/.md' 45 | drafts: false 46 | 47 | jobs: 48 | - template: ${{ variables.CI_COMPONENT_PATH }}/hip-tests.yml@pipelines_repo 49 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | Language: Cpp 2 | BasedOnStyle: Google 3 | AlignEscapedNewlinesLeft: false 4 | AlignOperands: false 5 | ColumnLimit: 100 6 | AlwaysBreakTemplateDeclarations: false 7 | DerivePointerAlignment: false 8 | IndentFunctionDeclarationAfterType: false 9 | MaxEmptyLinesToKeep: 2 10 | SortIncludes: false 11 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autolf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to have LF line endings on checkout. 6 | *.c text eol=lf 7 | *.cpp text eol=lf 8 | *.cc text eol=lf 9 | *.h text eol=lf 10 | *.hpp text eol=lf 11 | *.txt text eol=lf 12 | 13 | # Define files to support auto-remove trailing white space 14 | # Need to run the command below, before add modified file(s) to the staging area 15 | # git config filter.trimspace.clean 'sed -e "s/[[:space:]]*$//g"' 16 | *.cpp filter=trimspace 17 | *.c filter=trimspace 18 | *.h filter=trimspacecpp 19 | *.hpp filter=trimspace 20 | *.md filter=trimspace -------------------------------------------------------------------------------- /.github/palamida.yml: -------------------------------------------------------------------------------- 1 | disabled: false 2 | scmId: gh-emu-rocm 3 | branchesToScan: 4 | - amd-staging 5 | - amd-mainline 6 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Associated JIRA ticket number/Github issue number 2 | 3 | 4 | ## What type of PR is this? (check all applicable) 5 | 6 | - [ ] Refactor 7 | - [ ] Feature 8 | - [ ] Bug Fix 9 | - [ ] Optimization 10 | - [ ] Documentation Update 11 | - [ ] Continuous Integration 12 | 13 | ## What were the changes? 14 | 15 | 16 | 17 | ## Why are these changes needed? 18 | 19 | 20 | 21 | ## Updated CHANGELOG? 22 | 23 | 24 | 25 | - [ ] Yes 26 | - [ ] No, Does not apply to this PR. 27 | 28 | ## Added/Updated documentation? 29 | 30 | - [ ] Yes 31 | - [ ] No, Does not apply to this PR. 32 | 33 | ## Additional Checks 34 | 35 | - [ ] I have added tests relevant to the introduced functionality, and the unit tests are passing locally. 36 | - [ ] Any dependent changes have been merged. 37 | -------------------------------------------------------------------------------- /.github/workflows/kws-caller.yml: -------------------------------------------------------------------------------- 1 | name: Rocm Validation Suite KWS 2 | on: 3 | push: 4 | branches: [amd-staging, amd-mainline] 5 | pull_request: 6 | types: [opened, synchronize, reopened] 7 | workflow_dispatch: 8 | jobs: 9 | kws: 10 | if: ${{ github.event_name == 'pull_request' }} 11 | uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/kws.yml@mainline 12 | secrets: inherit 13 | with: 14 | pr_number: ${{github.event.pull_request.number}} 15 | base_branch: ${{github.base_ref}} 16 | -------------------------------------------------------------------------------- /.github/workflows/pr-title-validate.yml: -------------------------------------------------------------------------------- 1 | name: Validate PR Title 2 | 3 | on: 4 | pull_request: 5 | types: [opened, edited, synchronize, reopened] 6 | 7 | jobs: 8 | validate-pr-title: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Check PR Title 12 | id: check-pr-title 13 | run: | 14 | PR_TITLE="${{ github.event.pull_request.title }}" 15 | 16 | if [[ ! "$PR_TITLE" =~ ^SWDEV-[0-9]+ ]]; then 17 | echo "::error::PR title must start with a Jira ticket ID, SWDEV-" 18 | exit 1 19 | else 20 | echo "PR title is valid" 21 | fi 22 | 23 | validate-commit-messages: 24 | runs-on: ubuntu-latest 25 | steps: 26 | - name: Checkout code 27 | uses: actions/checkout@v3 28 | with: 29 | fetch-depth: 0 30 | 31 | - name: Check all commit messages 32 | id: validate-commit-messags 33 | run: | 34 | COMMITS=$(git log --format="%H %s" origin/${{ github.event.pull_request.base.ref }}..origin/${{ github.event.pull_request.head.ref }}) 35 | echo "$COMMITS" 36 | echo "$COMMITS" | while read -r hash message; do 37 | echo -e "$hash $message\n " 38 | if [[ ! "$message" =~ ^SWDEV-[0-9]+ ]]; then 39 | echo "::error:: $hash commit should start with Jira ticket ID, SWDEV-" 40 | exit 1 41 | fi 42 | done 43 | -------------------------------------------------------------------------------- /.github/workflows/validate-pr-description.yml: -------------------------------------------------------------------------------- 1 | name: Validate PR desription 2 | 3 | on: 4 | pull_request: 5 | types: [opened, edited, synchronize] 6 | 7 | jobs: 8 | validate-pr-description: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout repository 12 | uses: actions/checkout@v4 13 | 14 | - name: Set up Python 15 | uses: actions/setup-python@v5 16 | with: 17 | python-version: "3.13" 18 | 19 | - name: Validate PR description 20 | env: 21 | PR_DESCRIPTION: ${{ github.event.pull_request.body }} 22 | run: python .github/scripts/validate_pr_description.py 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .* 2 | !.gitignore 3 | *.o 4 | *.exe 5 | *.swp 6 | lib 7 | packages 8 | build 9 | tags 10 | samples/0_Intro/module_api/runKernel.hip.out 11 | samples/0_Intro/module_api/vcpy_isa.code 12 | samples/0_Intro/module_api/vcpy_isa.hsaco 13 | samples/0_Intro/module_api/vcpy_kernel.co 14 | samples/0_Intro/module_api/vcpy_kernel.code 15 | samples/1_Utils/hipInfo/hipInfo 16 | samples/1_Utils/hipDispatchLatency/hipDispatchLatency 17 | 18 | utils/coverage/generateHipAPICoverage 19 | utils/coverage/CoverageReport.xml 20 | utils/coverage/coverageReportHTML/CoverageReport.html 21 | utils/coverage/coverageReportHTML/testAPIs 22 | utils/coverage/coverageReportHTML/testModules 23 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @cpaquot_amdeng @gandryey_amdeng @skudchad_amdeng @lmoriche_amdeng 2 | 3 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008 - 2024 Advanced Micro Devices, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /catch/ABM/AddKernels/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | add.cc 4 | ) 5 | 6 | hip_add_exe_to_target(NAME ABMAddKernels 7 | TEST_SRC ${TEST_SRC} 8 | TEST_TARGET_NAME build_tests) 9 | -------------------------------------------------------------------------------- /catch/ABM/AddKernels/add.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | template __global__ void add(T* a, T* b, T* c, size_t size) { 5 | size_t i = threadIdx.x; 6 | if (i < size) c[i] = a[i] + b[i]; 7 | } 8 | 9 | TEMPLATE_TEST_CASE("ABM_AddKernel_MultiTypeMultiSize", "", int, long, float, long long, double) { 10 | auto size = GENERATE(as{}, 100, 500, 1000); 11 | TestType *d_a, *d_b, *d_c; 12 | auto res = hipMalloc(&d_a, sizeof(TestType) * size); 13 | REQUIRE(res == hipSuccess); 14 | res = hipMalloc(&d_b, sizeof(TestType) * size); 15 | REQUIRE(res == hipSuccess); 16 | res = hipMalloc(&d_c, sizeof(TestType) * size); 17 | REQUIRE(res == hipSuccess); 18 | 19 | std::vector a, b, c; 20 | for (size_t i = 0; i < size; i++) { 21 | a.push_back(i + 1); 22 | b.push_back(i + 1); 23 | c.push_back(2 * (i + 1)); 24 | } 25 | 26 | res = hipMemcpy(d_a, a.data(), sizeof(TestType) * size, hipMemcpyHostToDevice); 27 | REQUIRE(res == hipSuccess); 28 | res = hipMemcpy(d_b, b.data(), sizeof(TestType) * size, hipMemcpyHostToDevice); 29 | REQUIRE(res == hipSuccess); 30 | 31 | hipLaunchKernelGGL(add, 1, size, 0, 0, d_a, d_b, d_c, size); 32 | HIP_CHECK(hipGetLastError()); 33 | 34 | res = hipMemcpy(a.data(), d_c, sizeof(TestType) * size, hipMemcpyDeviceToHost); 35 | REQUIRE(res == hipSuccess); 36 | 37 | HIP_CHECK(hipFree(d_a)); 38 | HIP_CHECK(hipFree(d_b)); 39 | HIP_CHECK(hipFree(d_c)); 40 | REQUIRE(a == c); 41 | } 42 | -------------------------------------------------------------------------------- /catch/ABM/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(AddKernels) 2 | -------------------------------------------------------------------------------- /catch/TypeQualifiers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests 2 | set(TEST_SRC 3 | hipManagedKeyword.cc 4 | ) 5 | 6 | hip_add_exe_to_target(NAME TypeQualifiers 7 | TEST_SRC ${TEST_SRC} 8 | TEST_TARGET_NAME build_tests) 9 | -------------------------------------------------------------------------------- /catch/catchProp_in_rc.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define HIP_VERSION "@HIP_VERSION@" 4 | #define HIP_VERSION_MAJOR @HIP_VERSION_MAJOR@ 5 | #define HIP_VERSION_MINOR @HIP_VERSION_MINOR@ 6 | #define HIP_VERSION_PATCH @HIP_VERSION_PATCH@ 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION HIP_VERSION_MAJOR, HIP_VERSION_MINOR , HIP_VERSION_PATCH 10 | PRODUCTVERSION 10,1 11 | FILEFLAGSMASK 0x3fL 12 | #ifdef _DEBUG 13 | FILEFLAGS VS_FF_DEBUG 14 | #else 15 | FILEFLAGS 0x0L 16 | #endif 17 | FILEOS VOS_NT_WINDOWS32 18 | FILETYPE VFT_APP 19 | FILESUBTYPE VFT2_UNKNOWN 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904b0" 24 | BEGIN 25 | VALUE "CompanyName", "Advanced Micro Devices Inc.\0" 26 | VALUE "FileDescription", "HIP unit tests" 27 | VALUE "FileVersion", "amdhip64.dll" HIP_VERSION 28 | VALUE "LegalCopyright", "Copyright (C) 2022 Advanced Micro Devices Inc.\0" 29 | VALUE "ProductName", "HIP unit tests" 30 | VALUE "ProductVersion", HIP_VERSION 31 | VALUE "Comments", "\0" 32 | VALUE "InternalName", "HIP unit tests" 33 | END 34 | END 35 | BLOCK "VarFileInfo" 36 | BEGIN 37 | VALUE "Translation", 0x0409, 1200 38 | END 39 | END 40 | /* End of Version info */ 41 | -------------------------------------------------------------------------------- /catch/external/Catch2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /catch/external/Catch2/cmake/Catch2/Catch2Config.cmake: -------------------------------------------------------------------------------- 1 | 2 | ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### 3 | ####### Any changes to this file will be overwritten by the next CMake run #### 4 | ####### The input file was Catch2Config.cmake.in ######## 5 | 6 | get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) 7 | 8 | macro(set_and_check _var _file) 9 | set(${_var} "${_file}") 10 | if(NOT EXISTS "${_file}") 11 | message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") 12 | endif() 13 | endmacro() 14 | 15 | macro(check_required_components _NAME) 16 | foreach(comp ${${_NAME}_FIND_COMPONENTS}) 17 | if(NOT ${_NAME}_${comp}_FOUND) 18 | if(${_NAME}_FIND_REQUIRED_${comp}) 19 | set(${_NAME}_FOUND FALSE) 20 | endif() 21 | endif() 22 | endforeach() 23 | endmacro() 24 | 25 | #################################################################################### 26 | 27 | 28 | # Avoid repeatedly including the targets 29 | if(NOT TARGET Catch2::Catch2) 30 | # Provide path for scripts 31 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") 32 | 33 | include(${CMAKE_CURRENT_LIST_DIR}/Catch2Targets.cmake) 34 | endif() 35 | -------------------------------------------------------------------------------- /catch/external/Catch2/cmake/Catch2/catch_include.cmake: -------------------------------------------------------------------------------- 1 | # when ctest is ran, each submodule includes this file to generate the _tests.cmake file. 2 | # _tests.cmake contains the add_test macro which runs the individual test. 3 | 4 | get_filename_component(_cmake_path cmake ABSOLUTE) 5 | execute_process( 6 | COMMAND "${_cmake_path}" 7 | -D "TEST_TARGET=${TARGET}" 8 | -D "TEST_EXECUTABLE=${_TARGET_EXECUTABLE}" 9 | -D "TEST_EXECUTOR=${crosscompiling_emulator}" 10 | -D "TEST_WORKING_DIR=${_WORKING_DIRECTORY}" 11 | -D "TEST_SPEC=${_TEST_SPEC}" 12 | -D "TEST_EXTRA_ARGS=${_EXTRA_ARGS}" 13 | -D "TEST_PROPERTIES=${_PROPERTIES}" 14 | -D "TEST_PREFIX=${_TEST_PREFIX}" 15 | -D "TEST_SUFFIX=${_TEST_SUFFIX}" 16 | -D "TEST_LIST=${_TEST_LIST}" 17 | -D "TEST_REPORTER=${_REPORTER}" 18 | -D "TEST_OUTPUT_DIR=${_OUTPUT_DIR}" 19 | -D "TEST_OUTPUT_PREFIX=${_OUTPUT_PREFIX}" 20 | -D "TEST_OUTPUT_SUFFIX=${_OUTPUT_SUFFIX}" 21 | -D "CTEST_FILE=${ctestfilepath}" 22 | -P "${_CATCH_ADD_TEST_SCRIPT}" 23 | OUTPUT_VARIABLE output 24 | RESULT_VARIABLE result 25 | WORKING_DIRECTORY "${TEST_WORKING_DIR}" 26 | ) 27 | 28 | 29 | if(EXISTS "${ctestfilepath}") 30 | # include the generated ctest file for execution 31 | include(${ctestfilepath}) 32 | endif() 33 | -------------------------------------------------------------------------------- /catch/external/picojson/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009-2010 Cybozu Labs, Inc. 2 | Copyright 2011-2014 Kazuho Oku 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /catch/hipTestMain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | if(CMAKE_BUILD_TYPE MATCHES "^Debug$") 22 | add_definitions(-DHT_LOG_ENABLE) 23 | endif() 24 | 25 | add_library(Main_Object EXCLUDE_FROM_ALL OBJECT main.cc hip_test_context.cc hip_test_features.cc) 26 | if(HIP_PLATFORM MATCHES "amd") 27 | set_property(TARGET Main_Object PROPERTY CXX_STANDARD 17) 28 | else() 29 | target_compile_options(Main_Object PUBLIC -std=c++17) 30 | endif() 31 | -------------------------------------------------------------------------------- /catch/hipTestMain/standalone_main.cc: -------------------------------------------------------------------------------- 1 | #define CATCH_CONFIG_MAIN 2 | #include 3 | #include 4 | 5 | CmdOptions cmd_options; -------------------------------------------------------------------------------- /catch/include/cmd_options.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | #include 27 | 28 | struct CmdOptions { 29 | int iterations = 10; 30 | int warmups = 100; 31 | int cg_iterations = 5; 32 | bool no_display = false; 33 | bool progress = false; 34 | uint64_t accuracy_iterations = std::numeric_limits::max() + 1ull; 35 | uint64_t reduce_iterations = 1; 36 | uint64_t reduce_input_size = 50; 37 | int accuracy_max_memory = 80; 38 | }; 39 | 40 | extern CmdOptions cmd_options; 41 | -------------------------------------------------------------------------------- /catch/include/hipMallocManagedCommon.hh: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static int HmmAttrPrint() { 4 | int managed = 0; 5 | INFO( 6 | "The following are the attribute values related to HMM for" 7 | " device 0:\n"); 8 | HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeDirectManagedMemAccessFromHost, 0)); 9 | INFO("hipDeviceAttributeDirectManagedMemAccessFromHost: " << managed); 10 | HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeConcurrentManagedAccess, 0)); 11 | INFO("hipDeviceAttributeConcurrentManagedAccess: " << managed); 12 | HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributePageableMemoryAccess, 0)); 13 | INFO("hipDeviceAttributePageableMemoryAccess: " << managed); 14 | HIP_CHECK( 15 | hipDeviceGetAttribute(&managed, hipDeviceAttributePageableMemoryAccessUsesHostPageTables, 0)); 16 | INFO("hipDeviceAttributePageableMemoryAccessUsesHostPageTables:" << managed); 17 | 18 | HIP_CHECK(hipDeviceGetAttribute(&managed, hipDeviceAttributeManagedMemory, 0)); 19 | INFO("hipDeviceAttributeManagedMemory: " << managed); 20 | if (managed != 1) { 21 | WARN( 22 | "GPU 0 doesn't support hipDeviceAttributeManagedMemory attribute so defaulting to system " 23 | "memory."); 24 | } 25 | return managed; 26 | } -------------------------------------------------------------------------------- /catch/include/kernel_mapping.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #pragma once 21 | 22 | #include 23 | 24 | const std::map mapKernelToFileName{ 25 | {"Set", "Set.cpp"}, 26 | {"HipTest::vectorADD", "vectorADD.inl"}, 27 | }; -------------------------------------------------------------------------------- /catch/kernels/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(NOT RTC_TESTING) 2 | set(TEST_SRC 3 | Set.cpp 4 | ) 5 | 6 | add_library(KERNELS EXCLUDE_FROM_ALL OBJECT ${TEST_SRC}) 7 | target_compile_options(KERNELS PUBLIC -std=c++17) 8 | endif() 9 | -------------------------------------------------------------------------------- /catch/kernels/Set.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | __global__ void Set(int* Ad, int val) { 4 | int tx = threadIdx.x + blockIdx.x * blockDim.x; 5 | Ad[tx] = val; 6 | } -------------------------------------------------------------------------------- /catch/kernels/vectorADD.inl: -------------------------------------------------------------------------------- 1 | namespace HipTest { 2 | template __global__ void vectorADD(const T* A_d, const T* B_d, T* C_d, size_t NELEM) { 3 | size_t offset = (blockIdx.x * blockDim.x + threadIdx.x); 4 | size_t stride = blockDim.x * gridDim.x; 5 | 6 | for (size_t i = offset; i < NELEM; i += stride) { 7 | C_d[i] = A_d[i] + B_d[i]; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /catch/multiproc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests 2 | set(TEST_SRC 3 | childMalloc.cc 4 | hipDeviceComputeCapabilityMproc.cc 5 | hipDeviceGetPCIBusIdMproc.cc 6 | hipDeviceTotalMemMproc.cc 7 | hipGetDeviceAttributeMproc.cc 8 | hipGetDeviceCountMproc.cc 9 | hipGetDevicePropertiesMproc.cc 10 | hipSetGetDeviceMproc.cc 11 | hipIpcMemAccessTest.cc 12 | hipMallocConcurrencyMproc.cc 13 | hipMemCoherencyTstMProc.cc 14 | hipIpcEventHandle.cc 15 | deviceAllocationMproc.cc 16 | hipNoGpuTsts.cc 17 | hipMemGetInfoMProc.cc 18 | ) 19 | 20 | if(UNIX) 21 | add_custom_target(dummy_kernel.code 22 | COMMAND ${CMAKE_CXX_COMPILER} 23 | --genco ${CMAKE_CURRENT_SOURCE_DIR}/dummy_kernel.cpp 24 | -o ${CMAKE_CURRENT_BINARY_DIR}/../multiproc/dummy_kernel.code 25 | -I${HIP_PATH}/include/ -I${CMAKE_CURRENT_SOURCE_DIR}/../../include 26 | --rocm-path=${ROCM_PATH}) 27 | set_property(GLOBAL APPEND PROPERTY 28 | G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/dummy_kernel.code) 29 | endif() 30 | 31 | # the last argument linker libraries is required for this test but optional to the function 32 | if(HIP_PLATFORM MATCHES "nvidia") 33 | hip_add_exe_to_target(NAME MultiProc 34 | TEST_SRC ${TEST_SRC} 35 | TEST_TARGET_NAME build_tests 36 | LINKER_LIBS nvrtc) 37 | elseif(HIP_PLATFORM MATCHES "amd") 38 | hip_add_exe_to_target(NAME MultiProc 39 | TEST_SRC ${TEST_SRC} 40 | TEST_TARGET_NAME build_tests 41 | LINKER_LIBS hiprtc) 42 | endif() 43 | 44 | if(UNIX) 45 | add_dependencies(build_tests dummy_kernel.code) 46 | endif() 47 | 48 | -------------------------------------------------------------------------------- /catch/multiproc/childMalloc.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifdef __linux__ 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | bool testMallocFromChild() { 12 | int fd[2]; 13 | pid_t childpid; 14 | bool testResult = false; 15 | 16 | // create pipe descriptors 17 | pipe(fd); 18 | 19 | childpid = fork(); 20 | if (childpid > 0) { // Parent 21 | close(fd[1]); 22 | // parent will wait to read the device cnt 23 | read(fd[0], &testResult, sizeof(testResult)); 24 | 25 | // close the read-descriptor 26 | close(fd[0]); 27 | 28 | // wait for child exit 29 | wait(NULL); 30 | 31 | return testResult; 32 | 33 | } else if (!childpid) { // Child 34 | // writing only, no need for read-descriptor 35 | close(fd[0]); 36 | 37 | char* A_d = nullptr; 38 | hipError_t ret = hipMalloc(&A_d, 1024); 39 | 40 | printf("hipMalloc returned : %s\n", hipGetErrorString(ret)); 41 | if (ret == hipSuccess) 42 | testResult = true; 43 | else 44 | testResult = false; 45 | 46 | // send the value on the write-descriptor: 47 | write(fd[1], &testResult, sizeof(testResult)); 48 | 49 | // close the write descriptor: 50 | close(fd[1]); 51 | exit(0); 52 | } 53 | return false; 54 | } 55 | 56 | 57 | TEST_CASE("ChildMalloc") { 58 | auto res = testMallocFromChild(); 59 | REQUIRE(res == true); 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /catch/multiproc/dummy_kernel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include "hip/hip_runtime.h" 24 | 25 | extern "C" __global__ void dummy_ker() { 26 | } 27 | -------------------------------------------------------------------------------- /catch/performance/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | add_subdirectory(memset) 22 | add_subdirectory(memcpy) 23 | add_subdirectory(kernelLaunch) 24 | add_subdirectory(stream) 25 | add_subdirectory(event) 26 | add_subdirectory(warpSync) 27 | add_subdirectory(example) 28 | -------------------------------------------------------------------------------- /catch/performance/event/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | set(TEST_SRC 22 | hipEventCreate.cc 23 | hipEventCreateWithFlags.cc 24 | hipEventRecord.cc 25 | hipEventDestroy.cc 26 | hipEventSynchronize.cc 27 | hipEventElapsedTime.cc 28 | hipEventQuery.cc 29 | ) 30 | 31 | hip_add_exe_to_target(NAME EventPerformance 32 | TEST_SRC ${TEST_SRC} 33 | TEST_TARGET_NAME build_tests 34 | COMPILE_OPTIONS -std=c++17) -------------------------------------------------------------------------------- /catch/performance/example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | set(TEST_SRC 22 | example.cc 23 | ) 24 | 25 | hip_add_exe_to_target(NAME ExamplePerformance 26 | TEST_SRC ${TEST_SRC} 27 | TEST_TARGET_NAME build_tests 28 | COMPILE_OPTIONS -std=c++17) 29 | -------------------------------------------------------------------------------- /catch/performance/kernelLaunch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | set(TEST_SRC 22 | kernel_launch_common.cc 23 | triple_chevron.cc 24 | hipLaunchKernel.cc 25 | hipLaunchCooperativeKernel.cc 26 | ) 27 | 28 | if(HIP_PLATFORM MATCHES "amd") 29 | set(TEST_SRC ${TEST_SRC} 30 | hipExtLaunchKernel.cc 31 | hipExtLaunchKernelGGL.cc 32 | ) 33 | endif() 34 | 35 | hip_add_exe_to_target(NAME KernelLaunchPerformance 36 | TEST_SRC ${TEST_SRC} 37 | TEST_TARGET_NAME build_tests 38 | COMPILE_OPTIONS -std=c++17) 39 | -------------------------------------------------------------------------------- /catch/performance/memset/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | set(TEST_SRC 22 | hipMemset.cc 23 | hipMemsetAsync.cc 24 | hipMemsetD8.cc 25 | hipMemsetD8Async.cc 26 | hipMemsetD16.cc 27 | hipMemsetD16Async.cc 28 | hipMemsetD32.cc 29 | hipMemsetD32Async.cc 30 | hipMemset2D.cc 31 | hipMemset2DAsync.cc 32 | hipMemset3D.cc 33 | hipMemset3DAsync.cc 34 | ) 35 | 36 | hip_add_exe_to_target(NAME MemsetPerformance 37 | TEST_SRC ${TEST_SRC} 38 | TEST_TARGET_NAME build_tests 39 | COMPILE_OPTIONS -std=c++17) -------------------------------------------------------------------------------- /catch/performance/warpSync/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | # As CUDA use 32-bit sync masks and not 64-bit this has been disabled on Nvidia 22 | if(HIP_PLATFORM MATCHES "amd") 23 | set(TEST_SRC 24 | warpSync.cc 25 | ) 26 | endif() 27 | 28 | hip_add_exe_to_target(NAME WarpSyncPerformance 29 | TEST_SRC ${TEST_SRC} 30 | TEST_TARGET_NAME build_tests 31 | COMPILE_OPTIONS -std=c++17) 32 | -------------------------------------------------------------------------------- /catch/perftests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | add_custom_target(perf_test COMMAND "${CMAKE_CTEST_COMMAND}" -R "Perf_" 22 | COMMENT "Build complete, now executing the performnce test ...") 23 | 24 | add_subdirectory(memory) 25 | add_subdirectory(stream) 26 | add_subdirectory(dispatch) 27 | add_subdirectory(compute) 28 | add_subdirectory(graph) 29 | add_subdirectory(event) 30 | -------------------------------------------------------------------------------- /catch/perftests/compute/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | # Common Tests - Test independent of all platforms 22 | set(TEST_SRC 23 | hipPerfDotProduct.cc 24 | hipPerfMandelbrot.cc 25 | ) 26 | 27 | hip_add_exe_to_target(NAME perfComputeTest 28 | TEST_SRC ${TEST_SRC} 29 | TEST_TARGET_NAME perf_test) 30 | -------------------------------------------------------------------------------- /catch/perftests/dispatch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | # Common Tests - Test independent of all platforms 22 | set(TEST_SRC 23 | hipPerfDispatchSpeed.cc 24 | ) 25 | 26 | hip_add_exe_to_target(NAME perfDispatchTest 27 | TEST_SRC ${TEST_SRC} 28 | TEST_TARGET_NAME perf_test) 29 | -------------------------------------------------------------------------------- /catch/perftests/event/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # Permission is hereby granted, free of charge, to any person obtaining a copy 3 | # of this software and associated documentation files (the "Software"), to deal 4 | # in the Software without restriction, including without limitation the rights 5 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | # copies of the Software, and to permit persons to whom the Software is 7 | # furnished to do so, subject to the following conditions: 8 | # The above copyright notice and this permission notice shall be included in 9 | # all copies or substantial portions of the Software. 10 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 11 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 13 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 14 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 15 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 16 | # THE SOFTWARE. 17 | # Common Tests - Test independent of all platforms 18 | set(TEST_SRC 19 | hipKernelLookUpPerf.cc 20 | hipEventOverFlowPerf.cc 21 | ) 22 | hip_add_exe_to_target(NAME perfEventTest 23 | TEST_SRC ${TEST_SRC} 24 | TEST_TARGET_NAME perf_test) 25 | -------------------------------------------------------------------------------- /catch/perftests/graph/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # Permission is hereby granted, free of charge, to any person obtaining a copy 3 | # of this software and associated documentation files (the "Software"), to deal 4 | # in the Software without restriction, including without limitation the rights 5 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | # copies of the Software, and to permit persons to whom the Software is 7 | # furnished to do so, subject to the following conditions: 8 | # The above copyright notice and this permission notice shall be included in 9 | # all copies or substantial portions of the Software. 10 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 11 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 13 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 14 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 15 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 16 | # THE SOFTWARE. 17 | 18 | # Common Tests - Test independent of all platforms 19 | set(TEST_SRC 20 | hipPerfGraphLaunch.cc 21 | parallelGraph.cc 22 | ) 23 | 24 | hip_add_exe_to_target(NAME perfGraphTest 25 | TEST_SRC ${TEST_SRC} 26 | TEST_TARGET_NAME perf_test) 27 | -------------------------------------------------------------------------------- /catch/perftests/memory/hipPerfBufferCopySpeedP2P.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/catch/perftests/memory/hipPerfBufferCopySpeedP2P.cc -------------------------------------------------------------------------------- /catch/perftests/stream/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | # Common Tests - Test independent of all platforms 22 | set(TEST_SRC 23 | hipPerfDeviceConcurrency.cc 24 | hipPerfStreamConcurrency.cc 25 | hipPerfStreamCreateCopyDestroy.cc 26 | hipPerfIncreasingNumberOfStreams.cc 27 | ) 28 | 29 | hip_add_exe_to_target(NAME perfStreamTest 30 | TEST_SRC ${TEST_SRC} 31 | TEST_TARGET_NAME perf_test) 32 | -------------------------------------------------------------------------------- /catch/stress/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_custom_target(stress_test COMMAND "${CMAKE_CTEST_COMMAND}" -R "Stress_" 2 | COMMENT "Build complete, now executing the stress test ...") 3 | 4 | add_subdirectory(memory) 5 | add_subdirectory(module) 6 | if(HIP_PLATFORM MATCHES "amd") 7 | add_subdirectory(printf) 8 | add_subdirectory(stream) 9 | endif() 10 | add_subdirectory(deviceallocation) 11 | -------------------------------------------------------------------------------- /catch/stress/deviceallocation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | Stress_deviceAllocationStress.cc 4 | ) 5 | 6 | hip_add_exe_to_target(NAME devalloc_stress 7 | TEST_SRC ${TEST_SRC} 8 | TEST_TARGET_NAME stress_test) 9 | -------------------------------------------------------------------------------- /catch/stress/memory/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | memcpy.cc 4 | hipMemcpyMThreadMSize.cc 5 | hipMallocManagedStress.cc 6 | hipMemPrftchAsyncStressTst.cc 7 | hipHostMallocStress.cc 8 | hipHostRegisterStress.cc 9 | ) 10 | 11 | if(UNIX) 12 | set(TEST_SRC ${TEST_SRC} 13 | hipHmmOvrSubscriptionTst.cc) 14 | add_executable(hold_memory EXCLUDE_FROM_ALL hold_memory.cc) 15 | add_dependencies(stress_test hold_memory) 16 | endif() 17 | 18 | hip_add_exe_to_target(NAME memory_stress 19 | TEST_SRC ${TEST_SRC} 20 | TEST_TARGET_NAME stress_test) 21 | -------------------------------------------------------------------------------- /catch/stress/memory/memcpy.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | TEST_CASE("Stress_hipMalloc", "DifferentSizes") { 4 | int* d_a = nullptr; 5 | SECTION("Size 10") { 6 | auto res = hipMalloc(&d_a, sizeof(10)); 7 | REQUIRE(res == hipSuccess); 8 | HIP_CHECK(hipFree(d_a)); 9 | d_a = nullptr; 10 | } 11 | SECTION("Size 100") { 12 | auto res = hipMalloc(&d_a, sizeof(100)); 13 | REQUIRE(res == hipSuccess); 14 | HIP_CHECK(hipFree(d_a)); 15 | d_a = nullptr; 16 | } 17 | SECTION("Size 1000") { 18 | auto res = hipMalloc(&d_a, sizeof(1000)); 19 | REQUIRE(res == hipSuccess); 20 | HIP_CHECK(hipFree(d_a)); 21 | d_a = nullptr; 22 | } 23 | SECTION("Size 10000") { 24 | auto res = hipMalloc(&d_a, sizeof(10000)); 25 | REQUIRE(res == hipSuccess); 26 | HIP_CHECK(hipFree(d_a)); 27 | d_a = nullptr; 28 | } 29 | SECTION("Size MAX") { 30 | auto res = hipMalloc(&d_a, ~(size_t)0); 31 | REQUIRE(res == hipErrorOutOfMemory); 32 | d_a = nullptr; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /catch/stress/module/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | hipModuleLoadUnload.cc 4 | ) 5 | 6 | hip_add_exe_to_target(NAME module_stress 7 | TEST_SRC ${TEST_SRC} 8 | TEST_TARGET_NAME stress_test 9 | LINKER_LIBS hiprtc) 10 | -------------------------------------------------------------------------------- /catch/stress/printf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | Stress_printf_ComplexKernels.cc 4 | Stress_printf_SimpleKernels.cc 5 | ) 6 | 7 | hip_add_exe_to_target(NAME printf_stress 8 | TEST_SRC ${TEST_SRC} 9 | TEST_TARGET_NAME stress_test) 10 | -------------------------------------------------------------------------------- /catch/stress/stream/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | Stress_hipStreamCreate.cc 4 | streamEnqueue.cc 5 | ) 6 | 7 | hip_add_exe_to_target(NAME stream_stress 8 | TEST_SRC ${TEST_SRC} 9 | TEST_TARGET_NAME stress_test 10 | COMPILE_OPTIONS -std=c++17) 11 | -------------------------------------------------------------------------------- /catch/unit/assertion/static_assert_kernels_negative.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include 21 | 22 | __global__ void StaticAssertErrorKernel1() { 23 | const int tid = threadIdx.x + blockIdx.x * blockDim.x; 24 | static_assert(tid % 2 == 1, "[StaticAssertErrorKernel1]"); 25 | } 26 | 27 | __global__ void StaticAssertErrorKernel2() { 28 | int tid = threadIdx.x + blockIdx.x * blockDim.x; 29 | static_assert(++tid > 2, "[StaticAssertErrorKernel2]"); 30 | } 31 | -------------------------------------------------------------------------------- /catch/unit/assertion/static_assert_kernels_positive.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include 21 | 22 | __global__ void StaticAssertPassKernel1() { 23 | static_assert(sizeof(int) < sizeof(long), "[StaticAssertPassKernel1]"); 24 | } 25 | 26 | __global__ void StaticAssertPassKernel2() { static_assert(10 > 5, "[StaticAssertPassKernel2]"); } 27 | 28 | __global__ void StaticAssertFailKernel1() { 29 | static_assert(sizeof(int) > sizeof(long), "[StaticAssertFailKernel1]"); 30 | } 31 | 32 | __global__ void StaticAssertFailKernel2() { static_assert(10 < 5, "[StaticAssertFailKernel2]"); } 33 | -------------------------------------------------------------------------------- /catch/unit/c_compilation/hipGetDeviceProp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER 15 | * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | * THE SOFTWARE. 18 | * */ 19 | 20 | #include 21 | #include 22 | 23 | int hipGetDeviceProp() { 24 | 25 | hipDeviceProp_t prop; 26 | hipError_t err = hipGetDeviceProperties(&prop, 0); 27 | 28 | if (err == hipSuccess) { 29 | printf("PASSED!\n"); 30 | return 1; 31 | } else { 32 | printf("FAILED!\n"); 33 | return 0; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /catch/unit/c_compilation/hipGetDeviceProp.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER 15 | * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | * THE SOFTWARE. 18 | * */ 19 | 20 | #include 21 | /** 22 | * Test Description 23 | * ------------------------ 24 | * - Call a hip function (hipGetDeviceProperties) from a c compilation unit 25 | 26 | * Test source 27 | * ------------------------ 28 | * - catch/unit/c_compilation/hipGetDeviceProp.cc 29 | * Test requirements 30 | * ------------------------ 31 | * - HIP_VERSION >= 5.6 32 | */ 33 | 34 | extern "C" int hipGetDeviceProp(); 35 | 36 | TEST_CASE("Unit_hipGetDeviceProp_ctest") { 37 | int result = hipGetDeviceProp(); 38 | REQUIRE(result == 1); 39 | } 40 | -------------------------------------------------------------------------------- /catch/unit/callback/SimpleKernel.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include "hip/hip_runtime.h" 24 | 25 | extern "C" __global__ void simple_kernel() { 26 | printf("Hello World!"); 27 | } 28 | -------------------------------------------------------------------------------- /catch/unit/channelDescriptor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | set(TEST_SRC 22 | channel_descriptor.cc 23 | ) 24 | 25 | hip_add_exe_to_target(NAME ChannelDescriptorTest 26 | TEST_SRC ${TEST_SRC} 27 | TEST_TARGET_NAME build_tests) 28 | -------------------------------------------------------------------------------- /catch/unit/clock/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | # Common Tests - Test independent of all platforms 22 | 23 | set(TEST_SRC 24 | hipClockCheck.cc 25 | ) 26 | 27 | hip_add_exe_to_target(NAME ClockCheckTest 28 | TEST_SRC ${TEST_SRC} 29 | TEST_TARGET_NAME build_tests) 30 | -------------------------------------------------------------------------------- /catch/unit/context/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | # Common Tests - Test independent of all platforms 21 | set(TEST_SRC 22 | hipDrvGetPCIBusId.cc 23 | hipDrvMemcpy.cc 24 | hipMemsetD8.cc 25 | ) 26 | hip_add_exe_to_target(NAME Context 27 | TEST_SRC ${TEST_SRC} 28 | TEST_TARGET_NAME build_tests) 29 | -------------------------------------------------------------------------------- /catch/unit/context/hipDrvGetPCIBusId.cc: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 11 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 13 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 14 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 15 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 16 | THE SOFTWARE. 17 | */ 18 | #include 19 | 20 | TEST_CASE("Unit_hipDeviceGetPCIBusId_Functional") { 21 | HIP_CHECK(hipInit(0)); 22 | hipDevice_t device; 23 | HIP_CHECK(hipDeviceGet(&device, 0)); 24 | char pciBusId[13]; 25 | memset(pciBusId, 0, 13); 26 | HIP_CHECK(hipDeviceGetPCIBusId(pciBusId, 13, device)); 27 | REQUIRE(pciBusId[0] != '\0'); 28 | } 29 | 30 | -------------------------------------------------------------------------------- /catch/unit/context/hipMemsetD8.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include 20 | #define N 1024 21 | constexpr char memsetval = 'b'; 22 | 23 | TEST_CASE("Unit_hipMemsetD8_Functional") { 24 | size_t Nbytes = N * sizeof(char); 25 | char* A_h = new char[Nbytes];; 26 | 27 | hipDeviceptr_t A_d; 28 | HIP_CHECK(hipMalloc(reinterpret_cast(&A_d), Nbytes)); 29 | 30 | HIP_CHECK(hipMemsetD8(A_d, memsetval, Nbytes)); 31 | 32 | HIP_CHECK(hipMemcpy(A_h, reinterpret_cast(A_d), Nbytes, 33 | hipMemcpyDeviceToHost)); 34 | 35 | for (int i = 0; i < N; i++) { 36 | REQUIRE(A_h[i] == memsetval); 37 | } 38 | 39 | HIP_CHECK(hipFree(reinterpret_cast(A_d))); 40 | delete[] A_h; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /catch/unit/cooperativeGrps/cg_common_kernels.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #pragma once 21 | 22 | #include 23 | #include 24 | 25 | static __device__ void busy_wait(unsigned long long wait_period) { 26 | unsigned long long time_diff = 0; 27 | #if HT_AMD 28 | unsigned long long last_clock = wall_clock64(); 29 | #else 30 | unsigned long long last_clock = clock64(); 31 | #endif 32 | while (time_diff < wait_period) { 33 | #if HT_AMD 34 | unsigned long long cur_clock = wall_clock64(); 35 | #else 36 | unsigned long long cur_clock = clock64(); 37 | #endif 38 | if (cur_clock > last_clock) { 39 | time_diff += (cur_clock - last_clock); 40 | } 41 | last_clock = cur_clock; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /catch/unit/device/ResetUUIDInChild_Exe.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include 20 | 21 | #ifdef _WIN64 22 | #define setenv(x, y, z) _putenv_s(x, y) 23 | #endif 24 | 25 | int main() { 26 | int testPassed = 0; 27 | setenv("HIP_VISIBLE_DEVICES", "", 1); 28 | hip::SpawnProc proc("setuuidGetDevCount", true); 29 | if (proc.run() == 0) { 30 | testPassed = 1; 31 | } else { 32 | testPassed = 0; 33 | } 34 | unsetenv("HIP_VISIBLE_DEVICES"); 35 | return testPassed; 36 | } 37 | -------------------------------------------------------------------------------- /catch/unit/device/passUUIDToGrandChild_Exe.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include 20 | #include 21 | int main(int argc, char** argv) { 22 | if (argc < 0) { 23 | return -1; 24 | } 25 | int testPassed = 0; 26 | std::string uuid = argv[1]; 27 | hip::SpawnProc proc("chkUUIDInGrandChild_Exe", true); 28 | std::string t_uuid = uuid.substr(4, 19); 29 | if (proc.run(t_uuid) == 1) { 30 | testPassed = 1; 31 | } else { 32 | testPassed = 0; 33 | } 34 | return testPassed; 35 | } 36 | -------------------------------------------------------------------------------- /catch/unit/device/setEnvInChildProc_Exe.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include 20 | #include 21 | #ifdef _WIN64 22 | #define setenv(x, y, z) _putenv_s(x, y) 23 | #define unsetenv(x) _putenv(x) 24 | #endif 25 | 26 | int main(int argc, char** argv) { 27 | if (argc < 0) { 28 | return -1; 29 | } 30 | std::string uuid = argv[1]; 31 | unsetenv("HIP_VISIBLE_DEVICES"); 32 | setenv("HIP_VISIBLE_DEVICES", uuid.c_str(), 1); 33 | int devCount = 0; 34 | hipError_t localError; 35 | localError = hipGetDeviceCount(&devCount); 36 | if (localError == hipSuccess) { 37 | printf("HIP Api returned hipSuccess"); 38 | } 39 | return devCount; 40 | } 41 | -------------------------------------------------------------------------------- /catch/unit/device/setuuidGetDevCount_Exe.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include 20 | int main() { 21 | int devCount = 0; 22 | hipError_t localError; 23 | localError = hipGetDeviceCount(&devCount); 24 | if (localError == hipSuccess) { 25 | printf("HIP Api returned hipSuccess"); 26 | } 27 | return devCount; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /catch/unit/deviceLib/hipTestDeviceLimit.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include 20 | TEST_CASE("Unit_hipTestDeviceLimit_Basic") { 21 | size_t heap; 22 | HIP_CHECK(hipDeviceGetLimit(&heap, hipLimitMallocHeapSize)); 23 | REQUIRE(heap != 0); 24 | } 25 | -------------------------------------------------------------------------------- /catch/unit/deviceLib/kerDevAllocMultCO.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "hip/hip_runtime.h" 21 | #include "./defs.h" 22 | 23 | /** 24 | * This kernel allocates memory in thread 0. 25 | */ 26 | extern "C" __global__ void ker_Alloc_MultCodeObj(int **dev_mem, 27 | int test_type) { 28 | int myId = threadIdx.x + blockDim.x * blockIdx.x; 29 | // Allocate memory in thread 0 of block 0 30 | if (0 == myId) { 31 | if (test_type == TEST_MALLOC_FREE) { 32 | *dev_mem = 33 | reinterpret_cast (malloc(blockDim.x*gridDim.x*sizeof(int))); 34 | } else { 35 | *dev_mem = 36 | reinterpret_cast (new int[blockDim.x*gridDim.x]); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /catch/unit/deviceLib/kerDevWriteMultCO.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "hip/hip_runtime.h" 21 | #include "./defs.h" 22 | 23 | /** 24 | * This kernel writes to memory allocated in ker_Alloc_MultCodeObj<<<>>>. 25 | */ 26 | extern "C" __global__ void ker_Write_MultCodeObj(int **dev_mem, 27 | int value) { 28 | int myId = threadIdx.x + blockDim.x * blockIdx.x; 29 | // Check allocated memory in all threads in block before access 30 | if (*dev_mem == nullptr) { 31 | printf("Device Allocation Failed in thread = %d \n", myId); 32 | return; 33 | } 34 | // Copy to buffer 35 | (*dev_mem)[myId] = value; 36 | } 37 | -------------------------------------------------------------------------------- /catch/unit/device_memory/memcpy_negative_kernels.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include 21 | 22 | struct Dummy { 23 | __device__ Dummy() {} 24 | __device__ ~Dummy() {} 25 | }; 26 | 27 | /*void* memcpy(void* dst, const void* src, size_t size)*/ 28 | __global__ void memcpy_n1(int* dst, const int src, size_t size) { memcpy(dst, src, size); } 29 | __global__ void memcpy_n2(int dst, const int* src, size_t size) { memcpy(dst, src, size); } 30 | __global__ void memcpy_n3(int* dst, const int* src, size_t* size) { memcpy(dst, src, size); } 31 | __global__ void memcpy_n4(int* dst, const int* src, Dummy size) { memcpy(dst, src, size); } -------------------------------------------------------------------------------- /catch/unit/device_memory/memcpy_negative_kernels_rtc.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #pragma once 21 | 22 | static constexpr auto kMemcpyParam{ 23 | R"( 24 | struct Dummy { 25 | __device__ Dummy() {} 26 | __device__ ~Dummy() {} 27 | }; 28 | __global__ void memcpy_n1(int* dst, const int src, size_t size) { memcpy(dst, src, size); } 29 | __global__ void memcpy_n2(int dst, const int* src, size_t size) { memcpy(dst, src, size); } 30 | __global__ void memcpy_n3(int* dst, const int* src, size_t* size) { memcpy(dst, src, size); } 31 | __global__ void memcpy_n8(int* dst, const int* src, Dummy size) { memcpy(dst, src, size); } 32 | )"}; -------------------------------------------------------------------------------- /catch/unit/device_memory/memset_negative_kernels.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include 21 | 22 | struct Dummy { 23 | __device__ Dummy() {} 24 | __device__ ~Dummy() {} 25 | }; 26 | 27 | /*void* memset(void* ptr, int val, size_t size)*/ 28 | __global__ void memset_n1(int* ptr, int* val, size_t size) { memset(ptr, val, size); } 29 | __global__ void memset_n2(int ptr, int val, size_t size) { memset(ptr, val, size); } 30 | __global__ void memset_n3(int* ptr, int val, size_t* size) { memset(ptr, val, size); } 31 | __global__ void memset_n4(int* ptr, int val, Dummy size) { memset(ptr, val, size); } -------------------------------------------------------------------------------- /catch/unit/device_memory/memset_negative_kernels_rtc.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #pragma once 21 | 22 | static constexpr auto kMemsetParam{ 23 | R"( 24 | struct Dummy { 25 | __device__ Dummy() {} 26 | __device__ ~Dummy() {} 27 | }; 28 | __global__ void memset_n1(int* ptr, int* val, size_t size) { memset(ptr, val, size); } 29 | __global__ void memset_n2(int ptr, int val, size_t size) { memset(ptr, val, size); } 30 | __global__ void memset_n3(int* ptr, int val, size_t* size) { memset(ptr, val, size); } 31 | __global__ void memset_n4(int* ptr, int val, Dummy size) { memset(ptr, val, size); } 32 | )"}; -------------------------------------------------------------------------------- /catch/unit/dynamicLoading/bit_extract_kernel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include 20 | extern "C" __global__ void bit_extract_kernel(uint32_t* C_d, const uint32_t* 21 | A_d, size_t N) { 22 | size_t offset = (blockIdx.x * blockDim.x + threadIdx.x); 23 | size_t stride = blockDim.x * gridDim.x; 24 | for (size_t i = offset; i < N; i += stride) { 25 | #if HT_AMD 26 | C_d[i] = __bitextract_u32(A_d[i], 8, 4); 27 | #else /* defined __HIP_PLATFORM_NVIDIA__ or other path */ 28 | C_d[i] = ((A_d[i] & 0xf00) >> 8); 29 | #endif 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /catch/unit/dynamicLoading/vecadd.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include 20 | 21 | __global__ void kerAdd(int *in_a, int *in_b, int *out_c, int nelem) { 22 | int id = blockIdx.x * blockDim.x + threadIdx.x; 23 | if (id >= nelem) { 24 | return; 25 | } 26 | out_c[id] = in_a[id] + in_b[id]; 27 | } 28 | -------------------------------------------------------------------------------- /catch/unit/errorHandling/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | error_handling_common.cc 4 | hipGetErrorName.cc 5 | hipGetErrorString.cc 6 | hipDrvGetErrorName.cc 7 | hipDrvGetErrorString.cc 8 | hipGetLastError.cc 9 | hipPeekAtLastError.cc 10 | ) 11 | add_executable(hipGetLastErrorEnv_Exe EXCLUDE_FROM_ALL hipGetLastErrorEnv_Exe.cc) 12 | add_executable(hipPeekAtLastErrorEnv_Exe EXCLUDE_FROM_ALL hipPeekAtLastErrorEnv_Exe.cc) 13 | if(HIP_PLATFORM MATCHES "amd") 14 | set(AMD_SRC 15 | hipExtGetLastError.cc 16 | ) 17 | set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) 18 | endif() 19 | hip_add_exe_to_target(NAME ErrorHandlingTest 20 | TEST_SRC ${TEST_SRC} 21 | TEST_TARGET_NAME build_tests 22 | COMPILE_OPTIONS -std=c++17) 23 | 24 | add_dependencies(build_tests hipGetLastErrorEnv_Exe hipPeekAtLastErrorEnv_Exe) 25 | -------------------------------------------------------------------------------- /catch/unit/errorHandling/hipGetLastErrorEnv_Exe.cc: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 11 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 13 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 14 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 15 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 16 | THE SOFTWARE. 17 | */ 18 | #include "hip/hip_runtime_api.h" 19 | #include 20 | int main() { 21 | hipError_t err; 22 | err = hipGetLastError(); 23 | if (err == hipSuccess) 24 | return 1; 25 | else 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /catch/unit/errorHandling/hipPeekAtLastErrorEnv_Exe.cc: -------------------------------------------------------------------------------- 1 | /*Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 11 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 13 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 14 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 15 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 16 | THE SOFTWARE. 17 | */ 18 | #include "hip/hip_runtime_api.h" 19 | #include 20 | int main() { 21 | hipError_t err; 22 | err = hipPeekAtLastError(); 23 | if (err == hipSuccess) 24 | return 1; 25 | else 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /catch/unit/event/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | Unit_hipEvent_Negative.cc 4 | Unit_hipEvent.cc 5 | Unit_hipEventElapsedTime.cc 6 | Unit_hipEventRecord.cc 7 | Unit_hipEventIpc.cc 8 | hipEventDestroy.cc 9 | hipEventCreate.cc 10 | hipEventCreateWithFlags.cc 11 | hipEventSynchronize.cc 12 | Unit_hipEventMGpuMThreads.cc 13 | ) 14 | 15 | # The test used wait mechanism and doesnt play well with all arch of nvidia 16 | if(HIP_PLATFORM MATCHES "amd") 17 | set(AMD_SRC 18 | Unit_hipEventQuery.cc 19 | ) 20 | set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) 21 | endif() 22 | 23 | hip_add_exe_to_target(NAME EventTest 24 | TEST_SRC ${TEST_SRC} 25 | TEST_TARGET_NAME build_tests) 26 | -------------------------------------------------------------------------------- /catch/unit/executionControl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TEST_SRC 2 | execution_control_common.cc 3 | hipFuncGetAttributes.cc 4 | hipLaunchKernel.cc 5 | hipLaunchCooperativeKernel.cc 6 | hipLaunchCooperativeKernelMultiDevice.cc 7 | ) 8 | 9 | if(HIP_PLATFORM MATCHES "amd") 10 | set(TEST_SRC ${TEST_SRC} 11 | hipExtLaunchKernel.cc 12 | hipExtLaunchMultiKernelMultiDevice.cc 13 | launch_api.cc 14 | hipGetProcAddressLaunchCbExecCtrlApis.cc 15 | ) 16 | else() 17 | # These functions are currently unimplemented on AMD 18 | set(TEST_SRC ${TEST_SRC} 19 | hipFuncSetCacheConfig.cc 20 | hipFuncSetSharedMemConfig.cc 21 | hipFuncSetAttribute.cc 22 | ) 23 | endif() 24 | 25 | hip_add_exe_to_target(NAME ExecutionControlTest 26 | TEST_SRC ${TEST_SRC} 27 | TEST_TARGET_NAME build_tests 28 | COMPILE_OPTIONS -std=c++17) 29 | -------------------------------------------------------------------------------- /catch/unit/executionControl/execution_control_common.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include "execution_control_common.hh" 24 | 25 | #include 26 | #include 27 | 28 | __global__ void kernel() {} 29 | 30 | __global__ void kernel2() {} 31 | 32 | __global__ void kernel_42(int* val) { *val = 42; } 33 | 34 | __global__ void coop_kernel() { 35 | cooperative_groups::grid_group grid = cooperative_groups::this_grid(); 36 | grid.sync(); 37 | } -------------------------------------------------------------------------------- /catch/unit/executionControl/execution_control_common.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | __global__ void kernel(); 26 | 27 | __global__ void kernel2(); 28 | 29 | __global__ void kernel_42(int* val); 30 | 31 | __global__ void coop_kernel(); -------------------------------------------------------------------------------- /catch/unit/g++/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # AMD specific test 2 | if(HIP_PLATFORM MATCHES "amd") 3 | if(UNIX) 4 | set(TEST_SRC 5 | hipMalloc.cc 6 | ) 7 | # Creating Custom object file 8 | add_custom_target(malloc_custom COMMAND g++ -c ${CMAKE_CURRENT_SOURCE_DIR}/hipMalloc.cpp -I${HIP_PATH}/include -D__HIP_PLATFORM_AMD__ -o malloc.o BYPRODUCTS malloc.o) 9 | add_library(malloc_gpp OBJECT IMPORTED) 10 | set_property(TARGET malloc_gpp PROPERTY IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/malloc.o") 11 | 12 | hip_add_exe_to_target(NAME gppTests 13 | TEST_SRC ${TEST_SRC} 14 | TEST_TARGET_NAME build_tests 15 | LINKER_LIBS malloc_gpp) 16 | 17 | add_dependencies(gppTests malloc_custom) 18 | endif() 19 | endif() 20 | -------------------------------------------------------------------------------- /catch/unit/g++/hipMalloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER 15 | * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | * THE SOFTWARE. 18 | * */ 19 | 20 | #include 21 | 22 | extern int MallocFunc(); -------------------------------------------------------------------------------- /catch/unit/gcc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | if(HIP_PLATFORM MATCHES "amd") 3 | if(UNIX) 4 | set(TEST_SRC 5 | gccTest.cc 6 | gpu.cpp 7 | ) 8 | # Creating Custom object file 9 | add_custom_command(OUTPUT LaunchKernel.o COMMAND gcc -c ${CMAKE_CURRENT_SOURCE_DIR}/LaunchKernel.c -I${HIP_PATH}/include -D__HIP_PLATFORM_AMD__ -o LaunchKernel.o) 10 | add_custom_target(LaunchKernel_custom DEPENDS LaunchKernel.o) 11 | add_custom_command(OUTPUT hipMalloc.o COMMAND gcc -c ${CMAKE_CURRENT_SOURCE_DIR}/hipMalloc.c -I${HIP_PATH}/include -D__HIP_PLATFORM_AMD__ -o hipMalloc.o) 12 | add_custom_target(hipMalloc_custom DEPENDS hipMalloc.o) 13 | 14 | add_library(LaunchKernel_lib OBJECT IMPORTED) 15 | add_library(hipMalloc_lib OBJECT IMPORTED) 16 | 17 | set_property(TARGET LaunchKernel_lib PROPERTY IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/LaunchKernel.o") 18 | set_property(TARGET hipMalloc_lib PROPERTY IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/hipMalloc.o") 19 | 20 | 21 | hip_add_exe_to_target(NAME gccTests 22 | TEST_SRC ${TEST_SRC} 23 | TEST_TARGET_NAME build_tests 24 | LINKER_LIBS LaunchKernel_lib hipMalloc_lib) 25 | 26 | add_dependencies(gccTests LaunchKernel_custom hipMalloc_custom) 27 | endif() 28 | endif() 29 | -------------------------------------------------------------------------------- /catch/unit/gcc/LaunchKernel.h: -------------------------------------------------------------------------------- 1 | 2 | /* Copyright (c) 2019 - 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER 15 | * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | * THE SOFTWARE. 18 | */ 19 | 20 | #ifdef __cplusplus 21 | extern "C" 22 | { 23 | #endif 24 | 25 | struct things { 26 | char c; 27 | short s; 28 | int i; 29 | }; 30 | 31 | typedef enum func{ 32 | mykernel, 33 | mykernel1, 34 | mykernel2, 35 | mykernel3, 36 | mykernel4 37 | }func; 38 | 39 | extern const void* getKernelFunc(enum func f); 40 | 41 | int launchKernel(); 42 | int hipMallocfunc(); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | -------------------------------------------------------------------------------- /catch/unit/gcc/hipMalloc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy 4 | * of this software and associated documentation files (the "Software"), to deal 5 | * in the Software without restriction, including without limitation the rights 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | * copies of the Software, and to permit persons to whom the Software is 8 | * furnished to do so, subject to the following conditions: 9 | * The above copyright notice and this permission notice shall be included in 10 | * all copies or substantial portions of the Software. 11 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | * IMPLIED, INNCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | * FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANNY CLAIM, DAMAGES OR OTHER 15 | * LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | * OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | * THE SOFTWARE. 18 | * */ 19 | 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" 25 | { 26 | #endif 27 | int hipMallocfunc() { 28 | int *Ad; 29 | hipMalloc((void**)&Ad, 1024); 30 | printf("hipMalloc PASSED!\n"); 31 | hipFree(Ad); 32 | return 1; 33 | } 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /catch/unit/gl_interop/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(TEST_SRC 2 | hipGLGetDevices.cc 3 | hipGraphicsGLRegisterBuffer.cc 4 | hipGraphicsGLRegisterImage.cc 5 | hipGraphicsMapResources.cc 6 | hipGraphicsSubResourceGetMappedArray.cc 7 | hipGraphicsResourceGetMappedPointer.cc 8 | hipGraphicsUnmapResources.cc 9 | hipGraphicsUnregisterResource.cc 10 | ) 11 | 12 | find_package(OpenGL COMPONENTS OpenGL EGL) 13 | message(STATUS "OpenGL_FOUND: ${OpenGL_FOUND}") 14 | if(NOT OpenGL_FOUND) 15 | message(STATUS "OpenGL not found, OpenGL interop tests not enabled.") 16 | return() 17 | endif() 18 | 19 | find_package(GLUT) 20 | message(STATUS "GLUT_FOUND: ${GLUT_FOUND}") 21 | if(NOT GLUT_FOUND) 22 | message(STATUS "GLUT not found, OpenGL interop tests not enabled.") 23 | return() 24 | endif() 25 | 26 | hip_add_exe_to_target(NAME GLInteropTest 27 | TEST_SRC ${TEST_SRC} 28 | TEST_TARGET_NAME build_tests 29 | COMPILE_OPTIONS -std=c++17) 30 | target_link_libraries(GLInteropTest OpenGL::GL OpenGL::EGL GLUT::GLUT) -------------------------------------------------------------------------------- /catch/unit/graph/add_Kernel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include "hip/hip_runtime.h" 20 | extern "C" __global__ void Add(int* a, int* b, int* c) { 21 | size_t tx = (blockIdx.x * blockDim.x + threadIdx.x); 22 | c[tx] = a[tx] + b[tx]; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /catch/unit/launchBounds/launch_bounds_compiler_error_kernels.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include 21 | 22 | __launch_bounds__(0) __global__ void MaxThreadsZero(int* sum) { 23 | const int tid = threadIdx.x + blockIdx.x * blockDim.x; 24 | atomicAdd(sum, tid); 25 | } 26 | 27 | __launch_bounds__(1.5) __global__ void MaxThreadsNotInt(int* sum) { 28 | const int tid = threadIdx.x + blockIdx.x * blockDim.x; 29 | atomicAdd(sum, tid); 30 | } 31 | 32 | __launch_bounds__(128, 1.5) __global__ void MinWarpsNotInt(int* sum) { 33 | const int tid = threadIdx.x + blockIdx.x * blockDim.x; 34 | atomicAdd(sum, tid); 35 | } 36 | -------------------------------------------------------------------------------- /catch/unit/launchBounds/launch_bounds_parse_error_kernels.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include 21 | 22 | __launch_bounds__(-1) __global__ void MaxThreadsNegative(int* sum) { 23 | const int tid = threadIdx.x + blockIdx.x * blockDim.x; 24 | atomicAdd(sum, tid); 25 | } 26 | 27 | __launch_bounds__(128, -1) __global__ void MinWarpsNegative(int* sum) { 28 | const int tid = threadIdx.x + blockIdx.x * blockDim.x; 29 | atomicAdd(sum, tid); 30 | } 31 | -------------------------------------------------------------------------------- /catch/unit/memory/DriverContext.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include "DriverContext.hh" 24 | #include 25 | 26 | DriverContext::DriverContext() { 27 | HIP_CHECK(hipInit(0)); 28 | HIP_CHECK(hipDeviceGet(&device, 0)); 29 | HIP_CHECK(hipDevicePrimaryCtxRetain(&ctx, device)); 30 | HIP_CHECK(hipCtxPushCurrent(ctx)); 31 | } 32 | 33 | DriverContext::~DriverContext() { 34 | HIP_CHECK(hipCtxPopCurrent(&ctx)); 35 | HIP_CHECK(hipDevicePrimaryCtxRelease(device)); 36 | } 37 | -------------------------------------------------------------------------------- /catch/unit/memory/DriverContext.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | class DriverContext { 30 | private: 31 | hipCtx_t ctx; 32 | hipDevice_t device; 33 | 34 | public: 35 | DriverContext(); 36 | ~DriverContext(); 37 | 38 | // Rule of three 39 | DriverContext(const DriverContext& other) = delete; 40 | DriverContext(DriverContext&& other) noexcept = delete; 41 | }; 42 | -------------------------------------------------------------------------------- /catch/unit/memory/hipMemGetInfo.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include 21 | 22 | TEST_CASE("Unit_hipMemGetInfo_FreeLessThanTotal") { 23 | unsigned int *A_mem{nullptr}; 24 | size_t freeMemInit, totalMemInit; 25 | size_t freeMem, totalMem; 26 | 27 | HIP_CHECK(hipMemGetInfo(&freeMemInit, &totalMemInit)); 28 | REQUIRE(freeMemInit <= totalMemInit); 29 | HIP_CHECK(hipMalloc(&A_mem, 1024)); 30 | HIP_CHECK(hipMemGetInfo(&freeMem, &totalMem)); 31 | REQUIRE(freeMem < totalMem); 32 | REQUIRE(totalMem == totalMemInit); 33 | 34 | HIP_CHECK(hipFree(A_mem)); 35 | } 36 | -------------------------------------------------------------------------------- /catch/unit/memory/inlineVar.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | // This test verifies the usage of inline constant variable in different translation units 21 | // The inline variable is declared in MemUtils.hh, it is used in memoryCommon.cc where 22 | // set_value and get_value are defined. 23 | 24 | #include "MemUtils.hh" 25 | #include "memoryCommon.hh" 26 | using namespace mem_utils; 27 | 28 | TEST_CASE("Unit_hipMemcpyToFromSymbol_GlobalConstVar") { 29 | int const initialValue = 10; 30 | set_value(initialValue); 31 | int const finalValue = get_value(); 32 | REQUIRE(finalValue == initialValue); 33 | } 34 | -------------------------------------------------------------------------------- /catch/unit/memory/malloc.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | TEST_CASE("Unit_hipHostMalloc_4bytes") { 4 | int* d_a; 5 | auto res = hipHostMalloc(&d_a, sizeof(int), 0); 6 | REQUIRE(res == hipSuccess); 7 | res = hipHostFree(d_a); 8 | REQUIRE(res == hipSuccess); 9 | } 10 | 11 | TEST_CASE("Unit_hipMalloc_4bytes") { 12 | int* d_a; 13 | auto res = hipMalloc(&d_a, sizeof(int)); 14 | REQUIRE(res == hipSuccess); 15 | res = hipFree(d_a); 16 | REQUIRE(res == hipSuccess); 17 | } 18 | -------------------------------------------------------------------------------- /catch/unit/memory/memoryCommon.cc: -------------------------------------------------------------------------------- 1 | #include "memoryCommon.hh" 2 | #include "memoryGlobal.hh" 3 | 4 | void set_value(int const value) { 5 | HIP_CHECK(hipMemcpyToSymbol(HIP_SYMBOL(globalVar), &value, sizeof(value))); 6 | } 7 | 8 | int get_value() { 9 | int value; 10 | HIP_CHECK(hipMemcpyFromSymbol(&value, HIP_SYMBOL(globalVar), sizeof(value))); 11 | return value; 12 | } 13 | -------------------------------------------------------------------------------- /catch/unit/memory/memoryCommon.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #pragma once 21 | 22 | void set_value(int const value); 23 | 24 | int get_value(); 25 | -------------------------------------------------------------------------------- /catch/unit/memory/memoryGlobal.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | inline __constant__ int globalVar; 6 | -------------------------------------------------------------------------------- /catch/unit/memory/memset.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | TEST_CASE("Unit_hipMemset_4bytes") { 4 | int* d_a; 5 | auto res = hipMalloc(&d_a, sizeof(int)); 6 | REQUIRE(res == hipSuccess); 7 | res = hipMemset(d_a, 0, sizeof(int)); 8 | REQUIRE(res == hipSuccess); 9 | res = hipFree(d_a); 10 | REQUIRE(res == hipSuccess); 11 | } 12 | 13 | TEST_CASE("Unit_hipMemset_4bytes_hostMem") { 14 | int* d_a; 15 | auto res = hipHostMalloc(&d_a, sizeof(int), 0); 16 | REQUIRE(res == hipSuccess); 17 | res = hipMemset(d_a, 0, sizeof(int)); 18 | REQUIRE(res == hipSuccess); 19 | res = hipHostFree(d_a); 20 | REQUIRE(res == hipSuccess); 21 | } 22 | -------------------------------------------------------------------------------- /catch/unit/module/addKernel.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include 21 | 22 | __device__ int globalDevData = 10; 23 | 24 | extern "C" __global__ void addKernel(int *a, int size) { 25 | int offset = blockDim.x * blockIdx.x + threadIdx.x; 26 | int stride = blockDim.x * gridDim.x; 27 | for (int i = offset; i < size; i+= stride) { 28 | a[i] += 2; 29 | } 30 | } 31 | 32 | texture tex; 33 | 34 | extern "C" __global__ void sampleModuleKernel() { 35 | } 36 | -------------------------------------------------------------------------------- /catch/unit/module/copiousArgKernel.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "hip/hip_runtime.h" 21 | 22 | extern "C" __global__ void 23 | kernelMultipleArgsSaxpy(int a1, int a2, int *x1, int b1, int b2, int *x2, 24 | int c1, int c2, int *x3, int d1, int d2, int *x4, int e1, int e2, int *x5, 25 | int f1, int f2, int *x6) { 26 | int id = threadIdx.x + blockIdx.x * blockDim.x; 27 | x1[id] = a1*x1[id] + a2; 28 | x2[id] = b1*x2[id] + b2; 29 | x3[id] = c1*x3[id] + c2; 30 | x4[id] = d1*x4[id] + d2; 31 | x5[id] = e1*x5[id] + e2; 32 | x6[id] = f1*x6[id] + f2; 33 | } 34 | -------------------------------------------------------------------------------- /catch/unit/module/copyKernel.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | #include "hip/hip_runtime.h" 23 | 24 | extern "C" __global__ void copy_ker(int* Ad, int *Bd, size_t size) { 25 | int myId = threadIdx.x + blockDim.x * blockIdx.x; 26 | if (myId < size) { 27 | Bd[myId] = Ad[myId]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /catch/unit/module/empty_module.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | */ -------------------------------------------------------------------------------- /catch/unit/module/get_function_module.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | */ 21 | 22 | #include 23 | 24 | extern "C" { 25 | __global__ void GlobalKernel() {} 26 | 27 | __device__ void DeviceKernel() {} 28 | } -------------------------------------------------------------------------------- /catch/unit/module/get_tex_ref_module.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | */ 21 | 22 | #include 23 | 24 | #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 25 | 26 | texture tex; 27 | 28 | #endif // CUDA_VERSION < CUDA_12000 29 | -------------------------------------------------------------------------------- /catch/unit/module/hipModuleGetGlobal.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace { 27 | constexpr size_t kArraySize = 5; 28 | } // anonymous namespace -------------------------------------------------------------------------------- /catch/unit/module/launch_kernel_module.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | */ 21 | 22 | #include 23 | #include 24 | 25 | extern "C" { 26 | __global__ void NOPKernel() {} 27 | 28 | __global__ void Kernel42(int* out) { *out = 42; } 29 | 30 | // Interval is in millisecond 31 | __global__ void Delay(uint32_t interval, const uint32_t ticks_per_ms) { 32 | while (interval--) { 33 | uint64_t start = clock(); 34 | while (clock() - start < ticks_per_ms) { 35 | } 36 | } 37 | } 38 | 39 | __global__ void CoopKernel() { 40 | cooperative_groups::grid_group grid = cooperative_groups::this_grid(); 41 | grid.sync(); 42 | } 43 | } -------------------------------------------------------------------------------- /catch/unit/module/log: -------------------------------------------------------------------------------- 1 | bash: ./ModuleTest: No such file or directory 2 | -------------------------------------------------------------------------------- /catch/unit/module/managed_kernel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include "hip/hip_runtime.h" 20 | __managed__ int x = 10; 21 | 22 | extern "C" __global__ void GPU_func() { 23 | x++; 24 | } 25 | -------------------------------------------------------------------------------- /catch/unit/module/not_a_module.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/catch/unit/module/not_a_module.txt -------------------------------------------------------------------------------- /catch/unit/module/vcpy_kernel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANNTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER INN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | #include "hip/hip_runtime.h" 20 | 21 | extern "C" __global__ void hello_world(float* a, float* b) { 22 | int tx = threadIdx.x; 23 | b[tx] = a[tx]; 24 | } 25 | -------------------------------------------------------------------------------- /catch/unit/multiThread/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | hipMemsetAsyncMultiThread.cc 4 | hipMultiThreadDevice.cc 5 | hipMultiThreadStreams1.cc 6 | hipMultiThreadStreams2.cc 7 | ) 8 | 9 | hip_add_exe_to_target(NAME MultiThreadTest 10 | TEST_SRC ${TEST_SRC} 11 | TEST_TARGET_NAME build_tests) 12 | -------------------------------------------------------------------------------- /catch/unit/occupancy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | hipOccupancyMaxActiveBlocksPerMultiprocessor.cc 4 | hipOccupancyMaxActiveBlocksPerMultiprocessor_old.cc 5 | hipOccupancyMaxPotentialBlockSize.cc 6 | hipOccupancyMaxPotentialBlockSize_old.cc 7 | hipModuleOccupancyMaxPotentialBlockSize.cc 8 | hipModuleOccupancyMaxPotentialBlockSizeWithFlags.cc 9 | hipModuleOccupancyMaxActiveBlocksPerMultiprocessor.cc 10 | hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc 11 | hipOccupancyMaxPotentialBlockSizeVariableSMemWithFlags.cc 12 | hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags.cc 13 | ) 14 | 15 | add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code 16 | COMMAND ${CMAKE_CXX_COMPILER} --genco --std=c++17 17 | ${CMAKE_CURRENT_SOURCE_DIR}/simple_kernel.cc 18 | -I${HIP_PATH}/include/ 19 | -o simple_kernel.code --rocm-path=${ROCM_PATH} 20 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/simple_kernel.cc) 21 | 22 | add_custom_target(simple_kernel ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code) 23 | set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/simple_kernel.code) 24 | hip_add_exe_to_target(NAME OccupancyTest 25 | TEST_SRC ${TEST_SRC} 26 | TEST_TARGET_NAME build_tests) 27 | 28 | add_dependencies(OccupancyTest simple_kernel) 29 | -------------------------------------------------------------------------------- /catch/unit/occupancy/simple_kernel.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "hip/hip_runtime.h" 21 | 22 | extern "C" __global__ void SimpleKernel(int* a, int* b) { 23 | int tx = threadIdx.x; 24 | b[tx] = a[tx]; 25 | } 26 | -------------------------------------------------------------------------------- /catch/unit/p2p/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | # moved hipDeviceGetP2PAttribute.cc from /catch/unit/device to 3 | # /catch/unit/p2p folder and its dependent files. 4 | set(TEST_SRC 5 | hipDeviceGetP2PAttribute.cc 6 | ) 7 | 8 | # only for AMD 9 | if(HIP_PLATFORM MATCHES "amd") 10 | set(AMD_SRC 11 | hipP2pLinkTypeAndHopFunc.cc 12 | ) 13 | set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) 14 | endif() 15 | 16 | set_source_files_properties(hipDeviceGetP2PAttribute.cc PROPERTIES COMPILE_FLAGS -std=c++17) 17 | 18 | add_executable(hipDeviceGetP2PAttribute_exe EXCLUDE_FROM_ALL hipDeviceGetP2PAttribute_exe.cc) 19 | set_property(GLOBAL APPEND PROPERTY G_INSTALL_EXE_TARGETS hipDeviceGetP2PAttribute_exe) 20 | 21 | hip_add_exe_to_target(NAME p2pTests 22 | TEST_SRC ${TEST_SRC} 23 | TEST_TARGET_NAME build_tests) 24 | 25 | add_dependencies(build_tests hipDeviceGetP2PAttribute_exe) 26 | -------------------------------------------------------------------------------- /catch/unit/printf/printfFlagsNonHost_exe.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include 21 | 22 | __global__ void test_kernel() { 23 | printf("%08d\n", 42); 24 | printf("%08i\n", -42); 25 | printf("%08u\n", 42); 26 | printf("%08g\n", 123.456); 27 | printf("%0+8d\n", 42); 28 | printf("%+d\n", -42); 29 | printf("%+08d\n", 42); 30 | printf("%-8s\n", "xyzzy"); 31 | printf("% i\n", -42); 32 | printf("%-16.8d\n", 42); 33 | printf("%16.8d\n", 42); 34 | } 35 | 36 | int main() { 37 | test_kernel<<<1, 1>>>(); 38 | static_cast(hipDeviceSynchronize()); 39 | } 40 | -------------------------------------------------------------------------------- /catch/unit/rtc/headers/RtcFact.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/catch/unit/rtc/headers/RtcFact.h -------------------------------------------------------------------------------- /catch/unit/rtc/headers/RtcFunctions.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/catch/unit/rtc/headers/RtcFunctions.h -------------------------------------------------------------------------------- /catch/unit/rtc/headers/RtcKernels.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/catch/unit/rtc/headers/RtcKernels.h -------------------------------------------------------------------------------- /catch/unit/rtc/headers/RtcUtility.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/catch/unit/rtc/headers/RtcUtility.h -------------------------------------------------------------------------------- /catch/unit/rtc/headers/printf_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/catch/unit/rtc/headers/printf_common.h -------------------------------------------------------------------------------- /catch/unit/rtc/headers/test_header1.h: -------------------------------------------------------------------------------- 1 | #ifndef HIPRTC_TEST_HEADER1_H 2 | #define HIPRTC_TEST_HEADER1_H 3 | typedef float real; 4 | #endif //HIPRTC_TEST_HEADER1_H 5 | -------------------------------------------------------------------------------- /catch/unit/rtc/headers/test_header2.h: -------------------------------------------------------------------------------- 1 | #ifndef HIPRTC_TEST_HEADER2_H 2 | #define HIPRTC_TEST_HEADER2_H 3 | typedef float* realptr; 4 | #endif //HIPRTC_TEST_HEADER2_H 5 | -------------------------------------------------------------------------------- /catch/unit/rtc/saxpy.h: -------------------------------------------------------------------------------- 1 | #include "test_header1.h" 2 | #include "test_header2.h" 3 | 4 | extern "C" 5 | __global__ 6 | void saxpy(real a, realptr x, realptr y, realptr out, size_t n) { 7 | size_t tid = blockIdx.x * blockDim.x + threadIdx.x; 8 | if (tid < n) { 9 | out[tid] = a * x[tid] + y[tid]; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /catch/unit/stream/hipDeviceGetStreamPriorityRange.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | /* 23 | Testcase Scenarios : 24 | Unit_hipDeviceGetStreamPriorityRange_Default - Check if device stream piority range is valid 25 | */ 26 | 27 | #include 28 | 29 | TEST_CASE("Unit_hipDeviceGetStreamPriorityRange_Default") { 30 | int priority_low = 0; 31 | int priority_high = 0; 32 | int devID = GENERATE(range(0, HipTest::getDeviceCount())); 33 | HIP_CHECK(hipSetDevice(devID)); 34 | HIP_CHECK(hipDeviceGetStreamPriorityRange(&priority_low, &priority_high)); 35 | 36 | REQUIRE(priority_low >= priority_high); 37 | } 38 | -------------------------------------------------------------------------------- /catch/unit/stream/hipStreamCreate.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "streamCommon.hh" 21 | 22 | TEST_CASE("Unit_hipStreamCreate_default") { 23 | int id = GENERATE(range(0, HipTest::getDeviceCount())); 24 | HIP_CHECK(hipSetDevice(id)); 25 | 26 | hipStream_t stream{nullptr}; 27 | HIP_CHECK(hipStreamCreate(&stream)); 28 | REQUIRE(stream != nullptr); // Check if stream has a valid ptr 29 | REQUIRE(hip::checkStream(stream)); // check its flags and priority 30 | HIP_CHECK(hipStreamDestroy(stream)); 31 | } 32 | 33 | TEST_CASE("Unit_hipStreamCreate_Negative") { 34 | REQUIRE(hipErrorInvalidValue == hipStreamCreate(nullptr)); 35 | } 36 | -------------------------------------------------------------------------------- /catch/unit/streamperthread/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | hipStreamPerThread_Basic.cc 4 | hipStreamPerThread_Event.cc 5 | hipStreamPerThread_MultiThread.cc 6 | hipStreamPerThread_DeviceReset.cc 7 | hipStreamPerThrdTsts.cc 8 | hipStreamPerThrdCompilerOptn.cc 9 | ) 10 | 11 | if(HIP_PLATFORM MATCHES "amd") 12 | set(TEST_SRC ${TEST_SRC} 13 | hipGetProcAddressSptApis.cc) 14 | endif() 15 | 16 | if(HIP_PLATFORM MATCHES "amd") 17 | set_source_files_properties(hipStreamPerThrdCompilerOptn.cc PROPERTIES COMPILE_OPTIONS "-fgpu-default-stream=per-thread") 18 | endif() 19 | 20 | if(HIP_PLATFORM MATCHES "nvidia") 21 | set_source_files_properties(hipStreamPerThrdCompilerOptn.cc PROPERTIES COMPILE_OPTIONS "--default-stream=per-thread") 22 | endif() 23 | 24 | hip_add_exe_to_target(NAME StreamPerThreadTest 25 | TEST_SRC ${TEST_SRC} 26 | TEST_TARGET_NAME build_tests) 27 | -------------------------------------------------------------------------------- /catch/unit/surface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | # Common Tests - Test independent of all platforms 22 | set(TEST_SRC 23 | hipCreateSurfaceObject.cc 24 | hipDestroySurfaceObject.cc 25 | surf1D.cc 26 | surf1DLayered.cc 27 | surf2D.cc 28 | surf2DLayered.cc 29 | surf3D.cc 30 | surfCubemap.cc 31 | ) 32 | 33 | if(HIP_PLATFORM MATCHES "nvidia") # Disabled on AMD due to defect EXSWHTEC-377 34 | set(TEST_SRC 35 | ${TEST_SRC} 36 | surfCubemapLayered.cc) 37 | endif() 38 | 39 | hip_add_exe_to_target(NAME SurfaceTest 40 | TEST_SRC ${TEST_SRC} 41 | TEST_TARGET_NAME build_tests) -------------------------------------------------------------------------------- /catch/unit/synchronization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | copy_coherency.cc 4 | ) 5 | add_custom_target(memcpyInt.hsaco COMMAND ${CMAKE_CXX_COMPILER} --genco ${OFFLOAD_ARCH_STR} 6 | ${CMAKE_CURRENT_SOURCE_DIR}/memcpyIntDevice.cpp -o 7 | ${CMAKE_CURRENT_BINARY_DIR}/../synchronization/memcpyInt.hsaco -I 8 | ${HIP_PATH}/include -I 9 | ${CMAKE_CURRENT_SOURCE_DIR}/../../include -L 10 | ${HIP_PATH}/${CMAKE_INSTALL_LIBDIR}/../../include --rocm-path=${ROCM_PATH}) 11 | set_property(GLOBAL APPEND PROPERTY G_INSTALL_CUSTOM_TARGETS ${CMAKE_CURRENT_BINARY_DIR}/memcpyInt.hsaco) 12 | # only for AMD 13 | if(HIP_PLATFORM MATCHES "amd") 14 | # There are problems in Windows: __hip_atomicsXXX() won't work as expected 15 | if(NOT WIN32) 16 | set(AMD_SRC 17 | cache_coherency_cpu_gpu.cc 18 | cache_coherency_gpu_gpu.cc 19 | ) 20 | set(TEST_SRC ${TEST_SRC} ${AMD_SRC}) 21 | endif() 22 | endif() 23 | 24 | hip_add_exe_to_target(NAME synchronizationTests 25 | TEST_SRC ${TEST_SRC} 26 | TEST_TARGET_NAME build_tests 27 | COMPILE_OPTIONS -std=c++14) 28 | add_dependencies(synchronizationTests memcpyInt.hsaco) 29 | 30 | -------------------------------------------------------------------------------- /catch/unit/synchronization/memcpyIntDevice.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | extern "C" __global__ void memcpyIntKernel(int* dst, const int* src, 3 | size_t numElements) { 4 | int gid = (blockIdx.x * blockDim.x + threadIdx.x); 5 | int stride = blockDim.x * gridDim.x; 6 | for (size_t i = gid; i < numElements; i += stride) { 7 | dst[i] = src[i]; 8 | } 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /catch/unit/syncthreads/__syncthreads_and_negative_kernels.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | struct Dummy { 26 | __device__ Dummy() {} 27 | __device__ ~Dummy() {} 28 | }; 29 | 30 | __global__ void __syncthreads_and_v1(int* predicate) { int result = __syncthreads_and(predicate); } 31 | 32 | __global__ void __syncthreads_and_v2(Dummy predicate) { int result = __syncthreads_and(predicate); } -------------------------------------------------------------------------------- /catch/unit/syncthreads/__syncthreads_and_negative_kernels_rtc.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | static constexpr auto kSyncthreadsAndSource{ 26 | R"( 27 | struct Dummy { 28 | __device__ Dummy() {} 29 | __device__ ~Dummy() {} 30 | }; 31 | 32 | __global__ void __syncthreads_and_v1(int* predicate) { 33 | int result = __syncthreads_and(predicate); 34 | } 35 | 36 | __global__ void __syncthreads_and_v2(Dummy predicate) { 37 | int result = __syncthreads_and(predicate); 38 | } 39 | )"}; -------------------------------------------------------------------------------- /catch/unit/syncthreads/__syncthreads_count_negative_kernels.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | struct Dummy { 26 | __device__ Dummy() {} 27 | __device__ ~Dummy() {} 28 | }; 29 | 30 | __global__ void __syncthreads_count_v1(int* predicate) { 31 | int result = __syncthreads_count(predicate); 32 | } 33 | 34 | __global__ void __syncthreads_count_v2(Dummy predicate) { 35 | int result = __syncthreads_count(predicate); 36 | } -------------------------------------------------------------------------------- /catch/unit/syncthreads/__syncthreads_count_negative_kernels_rtc.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | static constexpr auto kSyncthreadsCountSource{ 26 | R"( 27 | struct Dummy { 28 | __device__ Dummy() {} 29 | __device__ ~Dummy() {} 30 | }; 31 | 32 | __global__ void __syncthreads_count_v1(int* predicate) { 33 | int result = __syncthreads_count(predicate); 34 | } 35 | 36 | __global__ void __syncthreads_count_v2(Dummy predicate) { 37 | int result = __syncthreads_count(predicate); 38 | } 39 | )"}; -------------------------------------------------------------------------------- /catch/unit/syncthreads/__syncthreads_or_negative_kernels.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | struct Dummy { 26 | __device__ Dummy() {} 27 | __device__ ~Dummy() {} 28 | }; 29 | 30 | __global__ void __syncthreads_or_v1(int* predicate) { int result = __syncthreads_or(predicate); } 31 | 32 | __global__ void __syncthreads_or_v2(Dummy predicate) { int result = __syncthreads_or(predicate); } -------------------------------------------------------------------------------- /catch/unit/syncthreads/__syncthreads_or_negative_kernels_rtc.hh: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | static constexpr auto kSyncthreadsOrSource{ 26 | R"( 27 | struct Dummy { 28 | __device__ Dummy() {} 29 | __device__ ~Dummy() {} 30 | }; 31 | 32 | __global__ void __syncthreads_or_v1(int* predicate) { 33 | int result = __syncthreads_or(predicate); 34 | } 35 | 36 | __global__ void __syncthreads_or_v2(Dummy predicate) { 37 | int result = __syncthreads_or(predicate); 38 | } 39 | )"}; -------------------------------------------------------------------------------- /catch/unit/texture/tex_ref_get_module.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | */ 21 | 22 | #include 23 | 24 | #if defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 25 | 26 | texture tex; 27 | 28 | #endif // defined(__HIP_PLATFORM_AMD__) || CUDA_VERSION < CUDA_12000 29 | -------------------------------------------------------------------------------- /catch/unit/threadfence/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | 21 | set(TEST_SRC 22 | __threadfence_block.cc 23 | __threadfence.cc 24 | __threadfence_system.cc 25 | ) 26 | 27 | hip_add_exe_to_target(NAME ThreadfenceTest 28 | TEST_SRC ${TEST_SRC} 29 | TEST_TARGET_NAME build_tests) -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_bitwise_double.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | BITWISE_FLOATING_POINT_VECTOR_FUNCTIONS(double1) 23 | BITWISE_FLOATING_POINT_VECTOR_FUNCTIONS(double2) 24 | BITWISE_FLOATING_POINT_VECTOR_FUNCTIONS(double3) 25 | BITWISE_FLOATING_POINT_VECTOR_FUNCTIONS(double4) 26 | -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_bitwise_float.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | BITWISE_FLOATING_POINT_VECTOR_FUNCTIONS(float1) 23 | BITWISE_FLOATING_POINT_VECTOR_FUNCTIONS(float2) 24 | BITWISE_FLOATING_POINT_VECTOR_FUNCTIONS(float3) 25 | BITWISE_FLOATING_POINT_VECTOR_FUNCTIONS(float4) 26 | -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_1D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(uchar1) 23 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ushort1) 24 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(uint1) 25 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ulong1) 26 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ulonglong1) 27 | -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_2D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(uchar2) 23 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ushort2) 24 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(uint2) 25 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ulong2) 26 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ulonglong2) 27 | -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_3D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(uchar3) 23 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ushort3) 24 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(uint3) 25 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ulong3) 26 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ulonglong3) 27 | -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_calculate_assign_with_unsigned_value_4D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(uchar4) 23 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ushort4) 24 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(uint4) 25 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ulong4) 26 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(ulonglong4) 27 | -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_calculate_assign_with_value_1D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(char1) 23 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(short1) 24 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(int1) 25 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(long1) 26 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(longlong1) 27 | -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_calculate_assign_with_value_2D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(char2) 23 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(short2) 24 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(int2) 25 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(long2) 26 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(longlong2) 27 | -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_calculate_assign_with_value_3D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(char3) 23 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(short3) 24 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(int3) 25 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(long3) 26 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(longlong3) 27 | -------------------------------------------------------------------------------- /catch/unit/vector_types/negative_calculate_assign_with_value_4D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "negative_macros_common.hh" 21 | 22 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(char4) 23 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(short4) 24 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(int4) 25 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(long4) 26 | CALCULATE_ASSIGN_VECTOR_FUNCTIONS(longlong4) 27 | -------------------------------------------------------------------------------- /catch/unit/vulkan_interop/hipDestroyExternalSemaphore.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | */ 21 | 22 | #include "vulkan_test.hh" 23 | 24 | TEST_CASE("Unit_hipDestroyExternalSemaphore_Vulkan_Negative_Parameters") { 25 | SECTION("extSem == nullptr") { 26 | HIP_CHECK_ERROR(hipDestroyExternalSemaphore(nullptr), hipErrorInvalidValue); 27 | } 28 | 29 | // Segfaults in Nvidia and Amd 30 | #if 0 31 | constexpr bool enable_validation = false; 32 | SECTION("Double free") { 33 | VulkanTest vkt(enable_validation); 34 | const auto ext_semaphore = ImportBinarySemaphore(vkt); 35 | HIP_CHECK(hipDestroyExternalSemaphore(ext_semaphore)); 36 | HIP_CHECK_ERROR(hipDestroyExternalSemaphore(ext_semaphore), hipErrorInvalidValue); 37 | } 38 | #endif 39 | } 40 | -------------------------------------------------------------------------------- /catch/unit/warp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Common Tests - Test independent of all platforms 2 | set(TEST_SRC 3 | warp_ballot.cc 4 | warp_any.cc 5 | warp_all.cc 6 | hipMatchSyncAllTests.cc 7 | hipMatchSyncAnyTests.cc 8 | hipShflSyncDownTests.cc 9 | hipShflSyncUpTests.cc 10 | hipShflSyncXorTests.cc 11 | hipShflSyncTests.cc 12 | hipVoteSyncTests.cc 13 | ) 14 | 15 | if(HIP_PLATFORM MATCHES "amd") 16 | set(TEST_SRC ${TEST_SRC} 17 | warp_shfl.cc 18 | warp_shfl_xor.cc 19 | warp_shfl_up.cc 20 | warp_shfl_down.cc 21 | warp_reduce.cc 22 | hipShflUpDownTest.cc 23 | hipShflTests.cc 24 | ) 25 | endif() 26 | 27 | if(HIP_PLATFORM MATCHES "nvidia") 28 | set_source_files_properties(hipMatchSyncAllTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") 29 | set_source_files_properties(hipMatchSyncAnyTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") 30 | set_source_files_properties(hipShflSyncDownTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") 31 | set_source_files_properties(hipShflSyncUpTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") 32 | set_source_files_properties(hipShflSyncXorTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") 33 | set_source_files_properties(hipShflSyncTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") 34 | set_source_files_properties(hipVoteSyncTests.cc PROPERTIES COMPILE_FLAGS "-arch=sm_70") 35 | endif() 36 | 37 | hip_add_exe_to_target(NAME WarpTest 38 | TEST_SRC ${TEST_SRC} 39 | TEST_TARGET_NAME build_tests) 40 | -------------------------------------------------------------------------------- /perftests/README.md: -------------------------------------------------------------------------------- 1 | # Performance tests 2 | 3 | These tests are in process of being ported to Catch framework [here](../catch/perftests/). 4 | 5 | Do not try to compile these as these might fail due to absence of some critical components. If you are interested in performance tests you can try to compile the one's in catch/perftests. 6 | -------------------------------------------------------------------------------- /perftests/timer.h: -------------------------------------------------------------------------------- 1 | #ifndef _TIMER_H_ 2 | #define _TIMER_H_ 3 | 4 | #ifdef _WIN32 5 | typedef __int64 i64 ; 6 | #endif 7 | #ifdef __linux__ 8 | typedef long long i64; 9 | #endif 10 | 11 | class CPerfCounter { 12 | 13 | public: 14 | CPerfCounter(); 15 | ~CPerfCounter(); 16 | void Start(void); 17 | void Stop(void); 18 | void Reset(void); 19 | double GetElapsedTime(void); 20 | 21 | private: 22 | 23 | i64 _freq; 24 | i64 _clocks; 25 | i64 _start; 26 | }; 27 | 28 | #endif // _TIMER_H_ 29 | -------------------------------------------------------------------------------- /samples/0_Intro/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | # 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy 5 | # of this software and associated documentation files (the "Software"), to deal 6 | # in the Software without restriction, including without limitation the rights 7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | # copies of the Software, and to permit persons to whom the Software is 9 | # furnished to do so, subject to the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be included in 12 | # all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | # THE SOFTWARE. 21 | 22 | add_custom_target(build_intro) 23 | add_subdirectory(bit_extract) 24 | add_subdirectory(module_api) 25 | add_subdirectory(module_api_global) 26 | add_subdirectory(square) 27 | add_subdirectory(generic_target) -------------------------------------------------------------------------------- /samples/0_Intro/bit_extract/README.md: -------------------------------------------------------------------------------- 1 | # bit_extract 2 | 3 | Show an application written directly in HIP which uses platform-specific check on __HIP_PLATFORM_AMD__ to enable use of 4 | an instruction that only exists on the AMD platform. 5 | 6 | See related [blog](http://gpuopen.com/platform-aware-coding-inside-hip/) demonstrating platform specialization. 7 | 8 | - Steps to build this sample: 9 | ``` 10 | $ mkdir build; cd build 11 | $ cmake .. -DCMAKE_PREFIX_PATH=/opt/rocm 12 | $ make 13 | ``` 14 | 15 | - Execute File 16 | ``` 17 | $ ./bit_extract 18 | 19 | pch size: 11743288 20 | __hipGetPCH succeeded! 21 | info: running on device #0 22 | info: allocate host mem ( 7.63 MB) 23 | info: allocate device mem ( 7.63 MB) 24 | info: copy Host2Device 25 | info: launch 'bit_extract_kernel' 26 | info: copy Device2Host 27 | info: check result 28 | PASSED! 29 | ``` 30 | -------------------------------------------------------------------------------- /samples/0_Intro/module_api/README.md: -------------------------------------------------------------------------------- 1 | # module_api 2 | 3 | - Steps to build this sample 4 | 5 | ``` 6 | $ mkdir build; cd build 7 | $ cmake .. -DCMAKE_PREFIX_PATH=/opt/rocm 8 | $ make 9 | ``` 10 | 11 | - Execute Code 12 | ``` 13 | $ ./launchKernelHcc.hip.out 14 | PASSED! 15 | $ ./runKernel.hip.out 16 | PASSED! 17 | $ ./defaultDriver.hip.out 18 | PASSED! 19 | ``` -------------------------------------------------------------------------------- /samples/0_Intro/module_api/vcpy_kernel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include "hip/hip_runtime.h" 24 | 25 | extern "C" __global__ void hello_world(float* a, float* b) { 26 | int tx = threadIdx.x; 27 | b[tx] = a[tx]; 28 | } 29 | -------------------------------------------------------------------------------- /samples/0_Intro/module_api_global/README.md: -------------------------------------------------------------------------------- 1 | # module_api_global 2 | 3 | - Steps to build this sample 4 | ``` 5 | $ mkdir build; cd build 6 | $ cmake .. -DCMAKE_PREFIX_PATH=/opt/rocm 7 | $ make 8 | ``` 9 | 10 | - Execute Code 11 | ``` 12 | $ ./runKernel1.hip.out 13 | PASSED! 14 | Shared Size Bytes = 0 15 | Num Regs = 3 16 | PASSED! 17 | ``` -------------------------------------------------------------------------------- /samples/0_Intro/module_api_global/vcpy_kernel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017 - 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include "hip/hip_runtime.h" 24 | 25 | #define ARRAY_SIZE (16) 26 | 27 | __device__ float myDeviceGlobal; 28 | __device__ float myDeviceGlobalArray[16]; 29 | 30 | extern "C" __global__ void hello_world(const float* a, float* b) { 31 | int tx = threadIdx.x; 32 | b[tx] = a[tx]; 33 | } 34 | 35 | extern "C" __global__ void test_globals(const float* a, float* b) { 36 | int tx = threadIdx.x; 37 | b[tx] = a[tx] + myDeviceGlobal + myDeviceGlobalArray[tx % ARRAY_SIZE]; 38 | } 39 | -------------------------------------------------------------------------------- /samples/0_Intro/square/README.md: -------------------------------------------------------------------------------- 1 | # Square.md 2 | 3 | Simple test below is an example, shows how to use hipify-perl to port CUDA code to HIP: 4 | 5 | - Add hip/bin path to the PATH 6 | ``` 7 | $ export PATH=$PATH:[MYHIP]/bin 8 | ``` 9 | 10 | - Define environment variable 11 | ``` 12 | $ export HIP_PATH=[MYHIP] 13 | ``` 14 | 15 | - Build executable file 16 | ``` 17 | $ cd ~/hip/samples/0_Intro/square 18 | mkdir -p build && cd build 19 | 20 | cmake .. 21 | make 22 | 23 | $ Building without cmake 24 | /opt/rocm/hip/bin/hipify-perl square.cu > square.cpp 25 | /opt/rocm/hip/bin/hipcc square.cpp -o square.out 26 | /opt/rocm/hip/bin/hipcc -use-staticlib square.cpp -o square.out.static 27 | ``` 28 | - Execute file 29 | ``` 30 | $ ./square.out 31 | info: running on device AMD Radeon RX 6900 XT 32 | info: allocate host mem ( 7.63 MB) 33 | info: allocate device mem ( 7.63 MB) 34 | info: copy Host2Device 35 | info: launch 'vector_square' kernel 36 | info: copy Device2Host 37 | info: check result 38 | PASSED! 39 | ``` 40 | -------------------------------------------------------------------------------- /samples/1_Utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2016 - 2023 Advanced Micro Devices, Inc. All rights reserved. 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining a copy 4 | # of this software and associated documentation files (the "Software"), to deal 5 | # in the Software without restriction, including without limitation the rights 6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | # copies of the Software, and to permit persons to whom the Software is 8 | # furnished to do so, subject to the following conditions: 9 | # 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # 13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | # THE SOFTWARE. 20 | add_custom_target(build_utils) 21 | add_subdirectory(hipDispatchLatency) 22 | add_subdirectory(hipInfo) -------------------------------------------------------------------------------- /samples/1_Utils/hipDispatchLatency/README.md: -------------------------------------------------------------------------------- 1 | # hipDispatchLatency.cpp 2 | 3 | - Steps to build this sample 4 | ``` 5 | $ mkdir build; cd build 6 | $ cmake .. -DCMAKE_PREFIX_PATH=/opt/rocm 7 | $ make 8 | ``` 9 | 10 | - Execute Code 11 | ``` 12 | $ ./hipDispatchEnqueueRateMT 1 0 13 | Thread ID : 0 , hipModuleLaunchKernel enqueue rate: 0.8 us, std: 0.1 us 14 | 15 | $ ./hipDispatchEnqueueRateMT 1 1 16 | Thread ID : 0 , hipLaunchKernelGGL enqueue rate: 1.0 us, std: 0.1 us 17 | 18 | $ ./hipDispatchLatency 19 | hipModuleLaunchKernel enqueue rate: 0.8 us, std: 0.1 us 20 | 21 | hipLaunchKernelGGL enqueue rate: 1.0 us, std: 0.1 us 22 | 23 | Timing around single dispatch latency: 8.1 us, std: 4.7 us 24 | 25 | Batch dispatch latency: 1.4 us, std: 0.0 us 26 | ``` -------------------------------------------------------------------------------- /samples/1_Utils/hipDispatchLatency/test_kernel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | */ 19 | 20 | #include "hip/hip_runtime.h" 21 | 22 | extern "C" __global__ void test() { 23 | } 24 | 25 | -------------------------------------------------------------------------------- /samples/2_Cookbook/11_texture_driver/Readme.md: -------------------------------------------------------------------------------- 1 | # texture_driver 2 | 3 | - Build the sample using cmake 4 | ``` 5 | $ mkdir build; cd build 6 | $ cmake .. -DCMAKE_PREFIX_PATH=/opt/rocm 7 | $ make 8 | ``` 9 | - Execute the sample 10 | ``` 11 | $ ./texture2dDrv 12 | tex2dKernelChar test PASSED ... 13 | tex2dKernelShort test PASSED ... 14 | tex2dKernelInt test PASSED ... 15 | tex2dKernelFloat test PASSED ... 16 | tex2dKernelChar4 test PASSED ... 17 | tex2dKernelShort4 test PASSED ... 18 | tex2dKernelInt4 test PASSED ... 19 | tex2dKernelFloat4 test PASSED ... 20 | texture2dDrv PASSED ... 21 | ``` -------------------------------------------------------------------------------- /samples/2_Cookbook/13_occupancy/Readme.md: -------------------------------------------------------------------------------- 1 | # occupancy 2 | 3 | - Build the sample using cmake 4 | ``` 5 | $ mkdir build; cd build 6 | $ cmake .. -DCMAKE_PREFIX_PATH=/opt/rocm 7 | $ make 8 | ``` 9 | - Execute the sample 10 | ``` 11 | $ ./occupancy 12 | Manual Configuration with block size 32 13 | kernel Execution time = 0.433ms 14 | Theoretical Occupancy is 40% 15 | 16 | Automatic Configuation based on hipOccupancyMaxPotentialBlockSize 17 | Suggested blocksize is 1024, Minimum gridsize is 128 18 | kernel Execution time = 0.037ms 19 | Theoretical Occupancy is 80% 20 | 21 | Manual Test PASSED! 22 | 23 | Automatic Test PASSED! 24 | ``` -------------------------------------------------------------------------------- /samples/2_Cookbook/14_gpu_arch/Readme.md: -------------------------------------------------------------------------------- 1 | # gpu_arch 2 | 3 | - Build the sample using cmake 4 | ``` 5 | $ mkdir build; cd build 6 | $ cmake .. -DCMAKE_PREFIX_PATH=/opt/rocm 7 | $ make 8 | ``` 9 | - Execute the sample 10 | ``` 11 | $ ./gpuarch 12 | success 13 | ``` 14 | 15 | ## Note : This sample works on architectures gfx908 and above -------------------------------------------------------------------------------- /samples/2_Cookbook/15_static_library/device_functions/hipDevice.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 - 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * */ 22 | 23 | #include 24 | 25 | __device__ int square_me(int A) { 26 | return A*A; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /samples/2_Cookbook/15_static_library/host_functions/hipMain1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 - 2021 Advanced Micro Devices, Inc. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | * */ 22 | 23 | extern void run_test1(); 24 | 25 | int main(){ 26 | // Run test that generates static lib with -emit-static-lib 27 | run_test1(); 28 | } 29 | -------------------------------------------------------------------------------- /samples/2_Cookbook/16_assembly_to_executable/hip_obj_gen.mcin: -------------------------------------------------------------------------------- 1 | # HIP Object Generator 2 | # Use this generator to create a host bundled object file 3 | # with the input of an offload bundled fat binary. 4 | # 5 | # Input: Bundled Object file .hipfb file 6 | # Output: Host Bundled Object File .o 7 | # 8 | # Add MC directives to embed target binaries. We ensure that each 9 | # section and image is 4096-byte aligned. This facilitates faster 10 | # loading of device binaries. It has been verified this align does 11 | # not cause significant overall file size increase. 12 | # 13 | # Note: log 2 of 4096 is 12. 14 | # 15 | .type __hip_fatbin,@object 16 | .section .hip_fatbin,"a",@progbits 17 | .globl __hip_fatbin 18 | .p2align 12 19 | __hip_fatbin: 20 | .incbin "offload_bundle.hipfb" 21 | -------------------------------------------------------------------------------- /samples/2_Cookbook/17_llvm_ir_to_executable/hip_obj_gen.mcin: -------------------------------------------------------------------------------- 1 | # HIP Object Generator 2 | # Use this generator to create a host bundled object file 3 | # with the input of an offload bundled fat binary. 4 | # 5 | # Input: Bundled Object file .hipfb file 6 | # Output: Host Bundled Object File .o 7 | # 8 | # Add MC directives to embed target binaries. We ensure that each 9 | # section and image is 4096-byte aligned. This facilitates faster 10 | # loading of device binaries. It has been verified this align does 11 | # not cause significant overall file size increase. 12 | # 13 | # Note: log 2 of 4096 is 12. 14 | # 15 | .type __hip_fatbin,@object 16 | .section .hip_fatbin,"a",@progbits 17 | .globl __hip_fatbin 18 | .p2align 12 19 | __hip_fatbin: 20 | .incbin "offload_bundle.hipfb" 21 | -------------------------------------------------------------------------------- /samples/2_Cookbook/18_cmake_hip_device/README.md: -------------------------------------------------------------------------------- 1 | ### This will test linking hip::device interface in cmake 2 | I. Build 3 | 4 | ``` 5 | $ mkdir build; cd build 6 | $ CXX="$(hipconfig -l)"/clang++ cmake -DCMAKE_PREFIX_PATH=/opt/rocm .. 7 | $ make 8 | ``` 9 | 10 | Note, users may need to add ADMGPU support as command line option, if test failed to run, for example, 11 | ``` 12 | $ CXX="$(hipconfig -l)"/clang++ cmake -DCMAKE_PREFIX_PATH=/opt/rocm -DAMDGPU_TARGETS="gfx1102" .. 13 | ``` 14 | 15 | II. Test 16 | 17 | ``` 18 | $ ../test_cpp 19 | info: running on device AMD Radeon Graphics 20 | info: allocate host mem ( 7.63 MB) 21 | info: allocate device mem ( 7.63 MB) 22 | info: copy Host2Device 23 | info: launch 'vector_square' kernel 24 | info: copy Device2Host 25 | info: check result 26 | PASSED! 27 | ``` 28 | -------------------------------------------------------------------------------- /samples/2_Cookbook/19_cmake_lang/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The test must be with CMake 3.18 or above which supports LINK_LANGUAGE that is necessary for 2 | # Fortran build. 3 | cmake_minimum_required(VERSION 3.18.0) 4 | if(ENABLE_ADDRESS_SANITIZER) 5 | message(STATUS "This fortran sample is temporarily disabled due to SWDEV-462616.") 6 | return() 7 | endif() 8 | project(cmake_lang_test CXX Fortran) 9 | 10 | if(UNIX) 11 | if(NOT DEFINED ROCM_PATH) 12 | set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.") 13 | endif() 14 | # Search for rocm in common locations 15 | list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) 16 | endif() 17 | 18 | set(CMAKE_CXX_COMPILER "${ROCM_PATH}/llvm/bin/clang++") 19 | 20 | find_package(hip REQUIRED) 21 | 22 | if(TARGET build_cookbook) 23 | set(EXCLUDE_OPTION EXCLUDE_FROM_ALL) 24 | else() 25 | set(EXCLUDE_OPTION ) 26 | endif() 27 | add_executable(test_fortran ${EXCLUDE_OPTION} TestFortran.F90) 28 | add_executable(test_cpp1 ${EXCLUDE_OPTION} MatrixTranspose.cpp) 29 | 30 | target_link_libraries(test_cpp1 PUBLIC hip::device) 31 | 32 | target_include_directories(test_cpp1 PRIVATE ../../common) 33 | 34 | # Assuming to build a C/C++-to-Fortran library binding. 35 | target_link_libraries(test_fortran PUBLIC hip::device) 36 | 37 | if(TARGET build_cookbook) 38 | add_dependencies(build_cookbook test_cpp1 test_fortran) 39 | endif() 40 | -------------------------------------------------------------------------------- /samples/2_Cookbook/19_cmake_lang/README.md: -------------------------------------------------------------------------------- 1 | ### This will test cmake lang support: CXX and Fortran 2 | I. Prepare 3 | 1) You must install cmake version 3.18 or above to support LINK_LANGUAGE. 4 | Otherwise, Fortran build will fail. 5 | To download the latest cmake, see https://cmake.org/download/. 6 | 2) If there is no Fortran on your system, you must install it via, 7 | sudo apt install gfortran 8 | 9 | II. Build 10 | ``` 11 | $ mkdir -p build; cd build 12 | $ rm -rf *; 13 | $ CXX="$(hipconfig -l)"/clang++ FC=$(which gfortran) cmake -DCMAKE_PREFIX_PATH=/opt/rocm .. 14 | $ cmake .. 15 | $ make 16 | ``` 17 | 18 | Note, users may need to add AMD GPU support, if test failed, for example, 19 | ``` 20 | $ CXX="$(hipconfig -l)"/clang++ FC=$(which gfortran) cmake -DCMAKE_PREFIX_PATH=/opt/rocm -DAMDGPU_TARGETS="gfx1102" .. 21 | ``` 22 | To enable compiler auto detection of gpu users may need to add ADMGPU support as command line option, 23 | if test failed to run, for example, 24 | ``` 25 | $ CXX="$(hipconfig -l)"/clang++ FC=$(which gfortran) cmake -DCMAKE_PREFIX_PATH=/opt/rocm -DAMDGPU_TARGETS=native .. 26 | ``` 27 | III. Test 28 | ``` 29 | $ ./test_fortran 30 | Succeeded testing Fortran! 31 | 32 | $ ./test_cpp 33 | Device name AMD Radeon Graphics 34 | PASSED! 35 | ``` 36 | -------------------------------------------------------------------------------- /samples/2_Cookbook/19_cmake_lang/TestFortran.F90: -------------------------------------------------------------------------------- 1 | program fortran_test_program 2 | print *, "Succeeded testing Fortran!" 3 | end program -------------------------------------------------------------------------------- /samples/2_Cookbook/21_cmake_hip_cxx_clang/README.md: -------------------------------------------------------------------------------- 1 | ### This sample tests CXX Language support with amdclang++ 2 | I. Build 3 | 4 | ``` 5 | $ mkdir -p build; cd build 6 | $ rm -rf *; 7 | $ CXX="$(hipconfig -l)"/amdclang++ cmake -DCMAKE_PREFIX_PATH=/opt/rocm .. 8 | $ make 9 | ``` 10 | To enable compiler auto detection of gpu users may need to add ADMGPU support as command line option, if test failed to run, for example, 11 | ``` 12 | $ CXX="$(hipconfig -l)"/amdclang++ cmake -DCMAKE_PREFIX_PATH=/opt/rocm -DAMDGPU_TARGETS="gfx1102" .. 13 | ``` 14 | II. Test 15 | 16 | ``` 17 | $ ./square 18 | info: running on device AMD Radeon Graphics 19 | info: allocate host mem ( 7.63 MB) 20 | info: allocate device mem ( 7.63 MB) 21 | info: copy Host2Device 22 | info: launch 'vector_square' kernel 23 | info: copy Device2Host 24 | info: check result 25 | PASSED! 26 | ``` 27 | -------------------------------------------------------------------------------- /samples/2_Cookbook/22_cmake_hip_lang/README.md: -------------------------------------------------------------------------------- 1 | ### This will test HIP language support in upstream CMake 2 | I. Build 3 | 4 | ``` 5 | $ mkdir -p build; cd build 6 | $ rm -rf *; 7 | $ cmake -DCMAKE_PREFIX_PATH=/opt/rocm .. 8 | $ make 9 | ``` 10 | 11 | II. Test 12 | 13 | ``` 14 | $ ./square 15 | info: running on device 16 | info: allocate host mem ( 7.63 MB) 17 | info: allocate device mem ( 7.63 MB) 18 | info: copy Host2Device 19 | info: launch 'vector_square' kernel 20 | info: copy Device2Host 21 | info: check result 22 | PASSED! 23 | ``` 24 | -------------------------------------------------------------------------------- /samples/2_Cookbook/23_cmake_hiprtc/README.md: -------------------------------------------------------------------------------- 1 | ### This will test linking hiprtc::hiprtc interface in cmake 2 | I. Build 3 | 4 | ``` 5 | $ mkdir -p build; cd build 6 | $ rm -rf *; 7 | $ CXX="$(hipconfig -l)"/amdclang++ cmake -DCMAKE_PREFIX_PATH=/opt/rocm .. 8 | $ make 9 | ``` 10 | 11 | II. Test 12 | 13 | ``` 14 | $ ./test 15 | SAXPY test completed 16 | ``` 17 | -------------------------------------------------------------------------------- /samples/2_Cookbook/8_peer2peer/Readme.md: -------------------------------------------------------------------------------- 1 | # peer2peer 2 | - Build the sample using cmake 3 | ``` 4 | $ mkdir build; cd build 5 | $ cmake .. -DCMAKE_PREFIX_PATH=/opt/rocm 6 | $ make 7 | ``` 8 | - Execute the sample 9 | ``` 10 | $ ./peer2peer 11 | Peer2Peer application requires atleast 2 gpu devices 12 | ``` -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | Building 2 | --- 3 | 4 | The CMakeLists.txt at hip-tests/samples folder can be used for building and packaging samples. 5 | 6 | CMakeLists.txt can support shared and static libs of hip-rocclr runtime. The same steps can be followed for both. 7 | 8 | To build a specific sample (e.g. `0_Intro/bit_extract`) run: 9 | ```bash 10 | $ cd samples/0_Intro/bit_extract 11 | $ mkdir -p build && cd build 12 | $ cmake .. 13 | $ make all 14 | ``` 15 | 16 | To build all samples together run: 17 | ```bash 18 | $ cd hip-tests 19 | $ mkdir -p build && cd build 20 | $ rm -rf * # (to clear up) 21 | $ cmake ../samples 22 | $ make build_samples 23 | ``` 24 | 25 | In order to build specific samples (Intro, Utils or Cookbook) run: 26 | ```bash 27 | $ make build_intro 28 | $ make build_utils 29 | $ make build_cookbook 30 | ``` 31 | 32 | Note that if you want debug version, add `-DCMAKE_BUILD_TYPE=Debug` in cmake cmd. 33 | 34 | 3. To package samples and generate packages. From hip-tests/build: 35 | ```bash 36 | $ cmake ../samples 37 | $ make package_samples 38 | ``` 39 | 40 | Note 41 | --- 42 | 43 | Sample `2_Cookbook/22_cmake_hip_lang` is current not included in toplevel cmake. To build this sample from toplevel cmake, uncomment Line 43 inside `samples/2_Cookbook/CMakeLists.txt`. 44 | -------------------------------------------------------------------------------- /samples/common/hip_helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | #include "hip/hip_runtime.h" 24 | 25 | #ifndef checkHipErrors 26 | #define checkHipErrors(err) __checkHipErrors(err, __FILE__, __LINE__) 27 | 28 | inline void __checkHipErrors(hipError_t err, const char *file, const int line) { 29 | if (HIP_SUCCESS != err) { 30 | const char *errorStr = hipGetErrorString(err); 31 | fprintf(stderr, 32 | "checkHipErrors() HIP API error = %04d \"%s\" from file <%s>, " 33 | "line %i.\n", 34 | err, errorStr, file, line); 35 | exit(EXIT_FAILURE); 36 | } 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /utils/coverage/coverageReportHTML/resources/amber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/utils/coverage/coverageReportHTML/resources/amber.png -------------------------------------------------------------------------------- /utils/coverage/coverageReportHTML/resources/emerald.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/utils/coverage/coverageReportHTML/resources/emerald.png -------------------------------------------------------------------------------- /utils/coverage/coverageReportHTML/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/utils/coverage/coverageReportHTML/resources/glass.png -------------------------------------------------------------------------------- /utils/coverage/coverageReportHTML/resources/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/utils/coverage/coverageReportHTML/resources/ruby.png -------------------------------------------------------------------------------- /utils/coverage/coverageReportHTML/resources/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/utils/coverage/coverageReportHTML/resources/snow.png -------------------------------------------------------------------------------- /utils/coverage/coverageReportHTML/resources/updown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ROCm/hip-tests/60b3aae3c0a69b2f6d79fb95b150279090cce7ec/utils/coverage/coverageReportHTML/resources/updown.png --------------------------------------------------------------------------------