Files
TheRock/compiler/hipify/tests/unit_tests/synthetic/runtime_structs.cu
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

271 lines
8.3 KiB
Plaintext

// RUN: %run_test hipify "%s" "%t" %hipify_args 3 --amap --skip-excluded-preprocessor-conditional-blocks --experimental %clang_args -D__CUDA_API_VERSION_INTERNAL
// CHECK: #include <hip/hip_runtime.h>
#include <cuda_runtime_api.h>
#include <stdio.h>
int main() {
printf("05. CUDA Runtime API Structs synthetic test\n");
// CHECK: hipChannelFormatDesc ChannelFormatDesc;
cudaChannelFormatDesc ChannelFormatDesc;
// CHECK: hipDeviceProp_t DeviceProp;
cudaDeviceProp DeviceProp;
// CHECK: hipExtent Extent;
cudaExtent Extent;
// CHECK: hipFuncAttributes FuncAttributes;
cudaFuncAttributes FuncAttributes;
// CHECK: hipIpcEventHandle_st IpcEventHandle_st;
// CHECK-NEXT: hipIpcEventHandle_t IpcEventHandle_t;
cudaIpcEventHandle_st IpcEventHandle_st;
cudaIpcEventHandle_t IpcEventHandle_t;
// CHECK: hipIpcMemHandle_st IpcMemHandle_st;
// CHECK-NEXT: hipIpcMemHandle_t IpcMemHandle_t;
cudaIpcMemHandle_st IpcMemHandle_st;
cudaIpcMemHandle_t IpcMemHandle_t;
// CHECK: hipMemcpy3DParms Memcpy3DParms;
cudaMemcpy3DParms Memcpy3DParms;
// CHECK: hipPitchedPtr PitchedPtr;
cudaPitchedPtr PitchedPtr;
// CHECK: hipPointerAttribute_t PointerAttributes;
cudaPointerAttributes PointerAttributes;
// CHECK: hipPos Pos;
cudaPos Pos;
// CHECK: hipResourceDesc ResourceDesc;
cudaResourceDesc ResourceDesc;
// CHECK: hipResourceViewDesc ResourceViewDesc;
cudaResourceViewDesc ResourceViewDesc;
// CHECK: hipTextureDesc TextureDesc;
cudaTextureDesc TextureDesc;
// CHECK: ihipEvent_t* event_st;
// CHECK-NEXT: hipEvent_t Event_t;
CUevent_st* event_st;
cudaEvent_t Event_t;
// CHECK: hipGraphicsResource* GraphicsResource;
// CHECK-NEXT: hipGraphicsResource_t GraphicsResource_t;
cudaGraphicsResource* GraphicsResource;
cudaGraphicsResource_t GraphicsResource_t;
// CHECK: hipArray* Array;
// CHECK-NEXT: hipArray_t Array_t;
// CHECK-NEXT: hipArray_const_t Array_const_t;
cudaArray* Array;
cudaArray_t Array_t;
cudaArray_const_t Array_const_t;
// CHECK: hipMipmappedArray* MipmappedArray;
// CHECK-NEXT: hipMipmappedArray_t MipmappedArray_t;
// CHECK-NEXT: hipMipmappedArray_const_t MipmappedArray_const_t;
cudaMipmappedArray* MipmappedArray;
cudaMipmappedArray_t MipmappedArray_t;
cudaMipmappedArray_const_t MipmappedArray_const_t;
// CHECK: ihipStream_t* stream_st;
// CHECK-NEXT: hipStream_t Stream_t;
CUstream_st* stream_st;
cudaStream_t Stream_t;
// CHECK: ihipModuleSymbol_t* func_st_ptr;
CUfunc_st* func_st_ptr;
// CHECK: hipUUID_t uuid_st;
CUuuid_st uuid_st;
// CHECK: hipMemcpy3DPeerParms Memcpy3DPeerParms;
cudaMemcpy3DPeerParms Memcpy3DPeerParms;
#if CUDA_VERSION >= 9000 && CUDA_VERSION < 13000
// CHECK: hipLaunchParams LaunchParams;
cudaLaunchParams LaunchParams;
#endif
#if CUDA_VERSION >= 10000
// CHECK: hipExternalMemoryBufferDesc ExternalMemoryBufferDesc;
cudaExternalMemoryBufferDesc ExternalMemoryBufferDesc;
// CHECK: hipExternalMemoryHandleDesc ExternalMemoryHandleDesc;
cudaExternalMemoryHandleDesc ExternalMemoryHandleDesc;
// CHECK: hipExternalSemaphoreHandleDesc ExternalSemaphoreHandleDesc;
cudaExternalSemaphoreHandleDesc ExternalSemaphoreHandleDesc;
// CHECK: hipExternalSemaphoreSignalParams ExternalSemaphoreSignalParams;
cudaExternalSemaphoreSignalParams ExternalSemaphoreSignalParams;
// CHECK: hipExternalSemaphoreWaitParams ExternalSemaphoreWaitParams;
cudaExternalSemaphoreWaitParams ExternalSemaphoreWaitParams;
// CHECK: hipHostNodeParams HostNodeParams;
cudaHostNodeParams HostNodeParams;
// CHECK: hipKernelNodeParams KernelNodeParams;
cudaKernelNodeParams KernelNodeParams;
// CHECK: hipMemsetParams MemsetParams;
cudaMemsetParams MemsetParams;
// CHECK: hipExternalMemory_t ExternalMemory_t;
cudaExternalMemory_t ExternalMemory_t;
// CHECK: hipExternalSemaphore_t ExternalSemaphore_t;
cudaExternalSemaphore_t ExternalSemaphore_t;
// CHECK: ihipGraph* graph_st;
// CHECK-NEXT: hipGraph_t Graph_t;
CUgraph_st* graph_st;
cudaGraph_t Graph_t;
// CHECK: hipGraphExec* graphExec_st;
// CHECK-NEXT: hipGraphExec_t GraphExec_t;
CUgraphExec_st* graphExec_st;
cudaGraphExec_t GraphExec_t;
// CHECK: hipGraphNode* graphNode_st;
// CHECK-NEXT: hipGraphNode_t GraphNode_t;
CUgraphNode_st* graphNode_st;
cudaGraphNode_t GraphNode_t;
#endif
#if CUDA_VERSION >= 11000
// CHECK: hipFunction_t func;
cudaFunction_t func;
// CHECK: hipAccessPolicyWindow AccessPolicyWindow;
cudaAccessPolicyWindow AccessPolicyWindow;
#endif
#if CUDA_VERSION >= 11020
#if CUDA_VERSION < 11030
// CHECK: hipExternalSemaphoreSignalParams ExternalSemaphoreSignalParams_v1;
cudaExternalSemaphoreSignalParams_v1 ExternalSemaphoreSignalParams_v1;
// CHECK: hipExternalSemaphoreWaitParams ExternalSemaphoreWaitParams_v1;
cudaExternalSemaphoreWaitParams_v1 ExternalSemaphoreWaitParams_v1;
#endif
// CHECK: hipMemPool_t memPool_t;
cudaMemPool_t memPool_t;
// CHECK: hipMemLocation memLocation;
cudaMemLocation memLocation;
// CHECK: hipMemAccessDesc MemAccessDesc;
cudaMemAccessDesc MemAccessDesc;
// CHECK: hipMemPoolProps MemPoolProps;
cudaMemPoolProps MemPoolProps;
// CHECK: hipExternalSemaphoreSignalNodeParams ExternalSemaphoreSignalNodeParams;
cudaExternalSemaphoreSignalNodeParams ExternalSemaphoreSignalNodeParams;
// CHECK: hipExternalSemaphoreWaitNodeParams ExternalSemaphoreWaitNodeParams;
cudaExternalSemaphoreWaitNodeParams ExternalSemaphoreWaitNodeParams;
#endif
#if CUDA_VERSION >= 11030
// CHECK: hipMemPoolPtrExportData memPoolPtrExportData;
cudaMemPoolPtrExportData memPoolPtrExportData;
// CHECK: hipUserObject_t userObject;
cudaUserObject_t userObject;
#endif
#if CUDA_VERSION >= 11040
// CHECK: hipMemAllocNodeParams MemAllocNodeParams;
cudaMemAllocNodeParams MemAllocNodeParams;
#endif
#if CUDA_VERSION >= 11080
// CHECK: hipLaunchConfig_st LaunchConfig_st;
// CHECK-NEXT: hipLaunchConfig_t launchConfig;
cudaLaunchConfig_st LaunchConfig_st;
cudaLaunchConfig_t launchConfig;
// CHECK: hipLaunchAttribute_st LaunchAttribute_st;
// CHECK-NEXT: hipLaunchAttribute LaunchAttribute;
cudaLaunchAttribute_st LaunchAttribute_st;
cudaLaunchAttribute LaunchAttribute;
#endif
#if CUDA_VERSION < 12000
// CHECK: surfaceReference surfaceRef;
surfaceReference surfaceRef;
#endif
#if CUDA_VERSION >= 12000
// CHECK: hipGraphInstantiateParams GRAPH_INSTANTIATE_PARAMS_st;
// CHECK-NEXT: hipGraphInstantiateParams GRAPH_INSTANTIATE_PARAMS;
cudaGraphInstantiateParams_st GRAPH_INSTANTIATE_PARAMS_st;
cudaGraphInstantiateParams GRAPH_INSTANTIATE_PARAMS;
// CHECK: hipLaunchMemSyncDomainMap LaunchMemSyncDomainMap_st;
// CHECK-NEXT: hipLaunchMemSyncDomainMap LaunchMemSyncDomainMap;
cudaLaunchMemSyncDomainMap_st LaunchMemSyncDomainMap_st;
cudaLaunchMemSyncDomainMap LaunchMemSyncDomainMap;
#endif
#if CUDA_VERSION >= 12010
// CHECK: hipKernel_t Kernel_t;
cudaKernel_t Kernel_t;
#endif
#if CUDA_VERSION >= 12020
// CHECK: hipExternalSemaphoreSignalNodeParams ExternalSemaphoreSignalNodeParams_v2;
cudaExternalSemaphoreSignalNodeParamsV2 ExternalSemaphoreSignalNodeParams_v2;
// CHECK: hipExternalSemaphoreWaitNodeParams ExternalSemaphoreWaitNodeParams_v2;
cudaExternalSemaphoreWaitNodeParamsV2 ExternalSemaphoreWaitNodeParams_v2;
// CHECK: hipMemFreeNodeParams MemFreeNodeParams;
cudaMemFreeNodeParams MemFreeNodeParams;
// CHECK: hipChildGraphNodeParams ChildGraphNodeParams;
cudaChildGraphNodeParams ChildGraphNodeParams;
// CHECK: hipEventRecordNodeParams EventRecordNodeParams;
cudaEventRecordNodeParams EventRecordNodeParams;
// CHECK: hipEventWaitNodeParams EventWaitNodeParams;
cudaEventWaitNodeParams EventWaitNodeParams;
// CHECK: hipGraphNodeParams *GraphNodeParams = nullptr
cudaGraphNodeParams *GraphNodeParams = nullptr;
#endif
#if CUDA_VERSION >= 12030
// CHECK: hipGraphEdgeData graphEdgeData_st;
// CHECK-NEXT: hipGraphEdgeData graphEdgeData;
cudaGraphEdgeData_st graphEdgeData_st;
cudaGraphEdgeData graphEdgeData;
#endif
#if CUDA_VERSION >= 12080
// CHECK: hipMemcpyAttributes MemcpyAttributes;
cudaMemcpyAttributes MemcpyAttributes;
// CHECK: hipOffset3D Offset3D;
cudaOffset3D Offset3D;
// CHECK: hipMemcpy3DOperand Memcpy3DOperand;
cudaMemcpy3DOperand Memcpy3DOperand;
// CHECK: hipMemcpy3DBatchOp Memcpy3DBatchOp;
cudaMemcpy3DBatchOp Memcpy3DBatchOp;
#endif
return 0;
}