This example demonstrates how to port an existing stream-based application to a graph-based application. For more information on this topic, please refer to the HIP Documentation.
On Windows, this example can only be built by CMake and the Ninja generator. Visual Studio generators are not supported.
- The number of asynchronous engines on the device is queried.
- A phantom volume is created and forward projections are created from it.
- The required data buffers, hipFFT plans, etc. are set up.
- The forward projections are processed in batches. The batch size is equal to the number of asynchronous engines. Each
batch item is processed in its own stream. Each projection is processed in the following way:
- All pixels in the projection are normalized, i.e. transformed from a 12-bit unsigned integer value to a 32-bit floating-point value in the range [0, 1].
- The projection is log transformed.
- The projection is weighted.
- The projection is transformed into Fourier space.
- The projection is filtered in Fourier space.
- The filtered projection is transformed into real space.
- The filtered projection is back-projected.
- The resulting volume is saved to disk.
- The data is cleaned up.
- The number of asynchronous engines on the device is queried.
- A phantom volume is created and forward projections are created from it.
- The required data buffers, hipFFT plans, etc. are set up.
- The forward projections are processed in batches. The batch size is equal to the number of asynchronous engines. Each
batch item is processed in its own stream. All processing streams are captured into a HIP graph template.
Each projection is processed in the following way:
- All pixels in the projection are normalized, i.e. transformed from a 12-bit unsigned integer value to a 32-bit floating-point value in the range [0, 1].
- The projection is log transformed.
- The projection is weighted.
- The projection is transformed into Fourier space.
- The projection is filtered in Fourier space.
- The filtered projection is transformed into real space.
- The filtered projection is back-projected.
- The resulting graph template is instantiated and launched on a stream.
- The resulting volume is saved to disk.
- The data is cleaned up.
- The number of asynchronous engines on the device is queried.
- A phantom volume is created and forward projections are created from it.
- The required data buffers, hipFFT plans, etc. are set up.
- The forward projections are processed in batches. The batch size is equal to the number of asynchronous engines. Each
batch item represents a branch in the graph template, and each branch consists of the following steps where each step
represents a node in the graph:
- All pixels in the projection are normalized, i.e. transformed from a 12-bit unsigned integer value to a 32-bit floating-point value in the range [0, 1].
- The projection is log transformed.
- The projection is weighted.
- The projection is transformed into Fourier space.
- The projection is filtered in Fourier space.
- The filtered projection is transformed into real space.
- The filtered projection is back-projected.
- The resulting graph template is instantiated and launched on a stream.
- The resulting volume is saved to disk.
- The data is cleaned up.
atomicAddblockIdxblockDimcosfexpffabsffloorffmaxffminflogfmaxminroundfsinfsqrtftex2DthreadIdx
hipCreateChannelDeschipCreateTextureObjecthipDestroyTextureObjecthipDeviceSynchronizehipEventCreatehipEventDestroyhipEventRecordhipFreehipFreeHosthipGetDevicePropertieshipGetErrorStringhipGraphAddKernelNodehipGraphAddMemcpyNodehipGraphAddMemsetNodehipGraphCreatehipGraphDebugDotPrinthipGraphDestroyhipGraphExecDestroyhipGraphExecUpdatehipGraphGetNodeshipGraphInstantiatehipGraphLaunchhipGraphNodeGetDependentNodeshipHostMallochipLaunchHostFunchipMallochipMalloc3DhipMallocPitchhipMemcpy2DAsynchipMemcpy3DAsynchipMemGetInfohipMemset2DAsynchipMemset3DhipStreamBeginCapturehipStreamBeginCaptureToGraphhipStreamCreatehipStreamEndCapturehipStreamDestroyhipStreamSynchronizehipStreamWaitEventmake_hipExtentmake_hipPitchedPtrmake_hipPos
hipfftCreatehipfftExecC2RhipfftExecR2ChipfftDestroyhipfftMakePlanManyhipfftPlan1dhipfftSetStream