#include <ComputeInterface.h>
Public Member Functions | |
| virtual | ~ComputeInterface ()=default |
| virtual void | RunKernel (const KernelDefinitionId id)=0 |
| virtual void | RunKernel (const KernelDefinitionId id, const DimensionVector &globalSize, const DimensionVector &localSize)=0 |
| virtual ComputeActionId | RunKernelAsync (const KernelDefinitionId id, const QueueId queue)=0 |
| virtual ComputeActionId | RunKernelAsync (const KernelDefinitionId id, const QueueId queue, const DimensionVector &globalSize, const DimensionVector &localSize)=0 |
| virtual void | WaitForComputeAction (const ComputeActionId id)=0 |
| virtual void | RunKernelWithProfiling (const KernelDefinitionId id)=0 |
| virtual void | RunKernelWithProfiling (const KernelDefinitionId id, const DimensionVector &globalSize, const DimensionVector &localSize)=0 |
| virtual uint64_t | GetRemainingProfilingRuns (const KernelDefinitionId id) const =0 |
| virtual uint64_t | GetRemainingProfilingRuns () const =0 |
| virtual QueueId | GetDefaultQueue () const =0 |
| virtual std::vector< QueueId > | GetAllQueues () const =0 |
| virtual void | SynchronizeQueue (const QueueId queue)=0 |
| virtual void | SynchronizeQueues ()=0 |
| virtual void | SynchronizeDevice ()=0 |
| virtual const DimensionVector & | GetCurrentGlobalSize (const KernelDefinitionId id) const =0 |
| virtual const DimensionVector & | GetCurrentLocalSize (const KernelDefinitionId id) const =0 |
| virtual const KernelConfiguration & | GetCurrentConfiguration () const =0 |
| virtual KernelRunMode | GetRunMode () const =0 |
| virtual void | ChangeArguments (const KernelDefinitionId id, const std::vector< ArgumentId > &arguments)=0 |
| virtual void | SwapArguments (const KernelDefinitionId id, const ArgumentId &first, const ArgumentId &second)=0 |
| virtual void | UpdateScalarArgument (const ArgumentId &id, const void *data)=0 |
| virtual void | UpdateLocalArgument (const ArgumentId &id, const size_t dataSize)=0 |
| virtual void | UploadBuffer (const ArgumentId &id)=0 |
| virtual TransferActionId | UploadBufferAsync (const ArgumentId &id, const QueueId queue)=0 |
| virtual void | DownloadBuffer (const ArgumentId &id, void *destination, const size_t dataSize=0)=0 |
| virtual TransferActionId | DownloadBufferAsync (const ArgumentId &id, const QueueId queue, void *destination, const size_t dataSize=0)=0 |
| virtual void | UpdateBuffer (const ArgumentId &id, const void *data, const size_t dataSize=0)=0 |
| virtual TransferActionId | UpdateBufferAsync (const ArgumentId &id, const QueueId queue, const void *data, const size_t dataSize=0)=0 |
| virtual void | CopyBuffer (const ArgumentId &destination, const ArgumentId &source, const size_t dataSize=0)=0 |
| virtual TransferActionId | CopyBufferAsync (const ArgumentId &destination, const ArgumentId &source, const QueueId queue, const size_t dataSize=0)=0 |
| virtual void | WaitForTransferAction (const TransferActionId id)=0 |
| virtual void | ResizeBuffer (const ArgumentId &id, const size_t newDataSize, const bool preserveData)=0 |
| virtual void | ClearBuffer (const ArgumentId &id)=0 |
| virtual bool | HasBuffer (const ArgumentId &id)=0 |
| virtual void | GetUnifiedMemoryBufferHandle (const ArgumentId &id, UnifiedBufferMemory &memoryHandle)=0 |
| virtual bool | GetProfiling (const KernelId id)=0 |
Interface for customizing kernel runs in order to run some part of computation on CPU, utilize iterative kernel launches, composite kernels and more. In order to use this functionality, custom kernel launcher function must be defined for the corresponding kernel.
|
virtualdefault |
Compute interface destructor.
|
pure virtual |
Changes kernel arguments for the specified kernel definitions under currently launched kernel.
| id | Id of kernel definition for which the arguments will be changed. The specified definition must be included in the currently launched kernel. |
| arguments | Ids of arguments to be used by the specified kernel definition. The order of ids must match the order of arguments inside kernel function. The provided ids must be unique. |
|
pure virtual |
Removes compute buffer for the specified vector argument. This method should be used mainly with arguments with ArgumentManagementType set to User.
| id | Id of vector argument whose buffer will be removed. |
|
pure virtual |
Copies part of the compute buffer of source vector argument to compute buffer of destination vector argument.
| destination | Id of destination vector argument. |
| source | Id of source vector argument. |
| dataSize | Size in bytes of buffer portion which will be copied to destination buffer, starting with the first byte. If zero, the entire buffer will be copied. |
|
pure virtual |
Copies part of the compute buffer of source vector argument to compute buffer of destination vector argument. The data will be transferred asynchronously in the specified queue.
| destination | Id of destination vector argument. |
| source | Id of source vector argument. |
| queue | Id of queue in which the command to copy argument will be submitted. |
| dataSize | Size in bytes of buffer portion which will be copied to destination buffer, starting with the first byte. If zero, the entire buffer will be copied. |
|
pure virtual |
Downloads the specified vector argument from compute buffer.
| id | Id of vector argument which will be downloaded. |
| destination | Buffer where the argument data will be downloaded. Its size must be equal or greater than the specified data size. |
| dataSize | Size in bytes of buffer portion which will be downloaded to specified destination, starting with the first byte. If zero, the entire buffer will be downloaded. |
|
pure virtual |
Downloads the specified vector argument from compute buffer. The data will be transferred asynchronously in the specified queue.
| id | Id of vector argument which will be downloaded. |
| queue | Id of queue in which the command to download argument will be submitted. |
| destination | Buffer where the argument data will be downloaded. Its size must be equal or greater than the specified data size. |
| dataSize | Size in bytes of buffer portion which will be downloaded to specified destination, starting with the first byte. If zero, the entire buffer will be downloaded. |
|
pure virtual |
Retrieves ids of all available device queues. Number of queues can be specified during tuner creation.
|
pure virtual |
Returns configuration of the currently launched kernel.
|
pure virtual |
Returns global thread size for the specified kernel definition based on the current configuration.
| id | Id of kernel definition for which the global size will be retrieved. The specified definition must be included in the currently launched kernel. |
|
pure virtual |
Returns local thread size for the specified kernel definition based on the current configuration.
| id | Id of kernel definition for which the local size will be retrieved. The specified definition must be included in the currently launched kernel. |
|
pure virtual |
Retrieves id of default device queue. All synchronous commands are submitted to this queue.
|
pure virtual |
Signals whether profiling is activated in the kernel
| id | Id of queried kernel. |
|
pure virtual |
Retrieves number of remaining profiling runs that are needed to collect all the profiling counters for the currently launched kernel. The number is derived from included kernel definitions which have kernel profiling functionality enabled.
|
pure virtual |
Retrieves number of remaining profiling runs that are needed to collect all the profiling counters for the specified kernel definition.
| id | Id of kernel definition for which the number of remaining profiling runs will be retrieved. The specified definition must be included in the currently launched kernel. |
|
pure virtual |
Returns run mode of the currently launched kernel.
|
pure virtual |
Retrieves memory handle for the specified unified memory argument. The handle can be used to manipulate argument memory on host side. Example usage: ktt::UnifiedBufferMemory memory; GetUnifiedMemoryBufferHandle(..., memory); float* floatArray = static_cast<float*>(memory);
| id | Id of vector argument whose memory handle will be retrieved. |
| memoryHandle | Location where the memory handle will be stored. |
|
pure virtual |
Checks whether compute buffer for the specified vector argument exists.
| id | Id of vector argument to check. |
|
pure virtual |
Resizes compute buffer for the specified vector argument.
| id | Id of vector argument whose buffer will be resized. |
| newDataSize | Size in bytes for the resized buffer. |
| preserveData | If true, data from the old buffer will be copied into resized buffer. If false, the old data will be discarded. |
|
pure virtual |
Runs the specified kernel definition using thread sizes based on the current configuration.
| id | Id of kernel definition which will be run. The specified definition must be included in the currently launched kernel. |
|
pure virtual |
Runs the specified kernel definition using provided thread sizes.
| id | Id of kernel definition which will be run. The specified definition must be included in the currently launched kernel. |
| globalSize | Dimensions for global size with which the kernel will be run. |
| localSize | Dimensions for local size with which the kernel will be run. |
|
pure virtual |
Runs the specified kernel definition using thread sizes based on the current configuration. The kernel will be launched asynchronously in the specified queue.
| id | Id of kernel definition which will be run. The specified definition must be included in the currently launched kernel. |
| queue | Id of queue in which the command to run kernel will be submitted. |
|
pure virtual |
Runs the specified kernel definition using provided thread sizes. The kernel will be launched asynchronously in the specified queue.
| id | Id of kernel definition which will be run. The specified definition must be included in the currently launched kernel. |
| queue | Id of queue in which the command to run kernel will be submitted. |
| globalSize | Dimensions for global size with which the kernel will be run. |
| localSize | Dimensions for local size with which the kernel will be run. |
|
pure virtual |
Runs the specified kernel definition using thread sizes based on the current configuration. Collection of kernel profiling counters will be enabled for this run which means that performance will be decreased. Running kernels with profiling will always cause implicit device synchronization before and after the kernel run is finished.
| id | Id of kernel definition which will be run. The specified definition must be included in the currently launched kernel. |
|
pure virtual |
Runs the specified kernel definition using provided thread sizes. Collection of kernel profiling counters will be enabled for this run which means that performance will be decreased. Running kernels with profiling will always cause implicit device synchronization before and after the kernel run is finished.
| id | Id of kernel definition which will be run. The specified definition must be included in the currently launched kernel. |
| globalSize | Dimensions for global size with which the kernel will be run. |
| localSize | Dimensions for local size with which the kernel will be run. |
|
pure virtual |
Swaps positions of kernel arguments for the specified kernel definition under currently launched kernel.
| id | Id of kernel definition for which the arguments will be swapped. The specified definition must be included in the currently launched kernel. |
| first | Id of the first argument which will be swapped. |
| second | Id of the second argument which will be swapped. |
|
pure virtual |
Blocks until all commands submitted to device are completed.
|
pure virtual |
Blocks until all commands submitted to the specified device queue are completed.
| queue | Id of queue which will be synchronized. |
|
pure virtual |
Blocks until all commands submitted to all device queues are completed.
|
pure virtual |
Updates data in compute buffer of the specified vector argument.
| id | Id of vector argument which will be updated. |
| data | Pointer to new data for vector argument. Its size must be equal or greater than the specified data size. The data must have matching kernel argument data type. |
| dataSize | Size in bytes of buffer portion which will be updated, starting with the first byte. If zero, the entire buffer will be updated. |
|
pure virtual |
Updates data in compute buffer of the specified vector argument. The data will be transferred asynchronously in the specified queue.
| id | Id of vector argument which will be updated. |
| queue | Id of queue in which the command to update argument will be submitted. |
| data | Pointer to new data for vector argument. Its size must be equal or greater than the specified data size. The data must have matching kernel argument data type. |
| dataSize | Size in bytes of buffer portion which will be updated, starting with the first byte. If zero, the entire buffer will be updated. |
|
pure virtual |
Updates the specified local memory argument under currently launched kernel.
| id | Id of local memory argument which will be updated. |
| dataSize | New size in bytes for the argument. |
|
pure virtual |
Updates the specified scalar argument under currently launched kernel.
| id | Id of scalar argument which will be updated. |
| data | Pointer to new data for scalar argument. The data must have matching kernel argument data type. |
|
pure virtual |
Uploads the specified vector argument into compute buffer. This method should be used mainly with arguments with ArgumentManagementType set to User.
| id | Id of vector argument which will be uploaded. |
|
pure virtual |
Uploads the specified vector argument into compute buffer. The data will be transferred asynchronously in the specified queue.
| id | Id of vector argument which will be uploaded. |
| queue | Id of queue in which the command to upload argument will be submitted. |
|
pure virtual |
Blocks until the specified compute action is finished.
| id | Id of compute action to wait for. |
|
pure virtual |
Blocks until the specified buffer transfer action is finished.
| id | Id of transfer action to wait for. |