Class HybRunner
This class allows to call hybridized methods without explicitly declaring native methods
Usage: int res = HybRunner.Cuda(target).Distrib(gridDimX, blockDimX).methodName(args);
Inheritance
System.Object
HybRunner
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Hybridizer.Runtime.CUDAImports.dll
Syntax
Properties
BlockDimX
Declaration
public int BlockDimX { get; }
Property Value
Type |
Description |
System.Int32 |
|
BlockDimY
Declaration
public int BlockDimY { get; }
Property Value
Type |
Description |
System.Int32 |
|
BlockDimZ
Declaration
public int BlockDimZ { get; }
Property Value
Type |
Description |
System.Int32 |
|
GridDimX
Declaration
public int GridDimX { get; }
Property Value
Type |
Description |
System.Int32 |
|
GridDimY
Declaration
public int GridDimY { get; }
Property Value
Type |
Description |
System.Int32 |
|
LastKernelDuration
Last kernel duration (from launch to synchronize)
Declaration
public Stopwatch LastKernelDuration { get; }
Property Value
Type |
Description |
System.Diagnostics.Stopwatch |
|
Marshaller
Declaration
public AbstractNativeMarshaler Marshaller { get; }
Property Value
Shared
Declaration
public int Shared { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Stream
Declaration
public cudaStream_t Stream { get; set; }
Property Value
UseGridSync
Declaration
public bool UseGridSync { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
UseStream
Is using non-default stream?
Declaration
public bool UseStream { get; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
AutoCPU()
Automatically detects processor features (flags) to load the appropriate satellite dll
satellite dlls must have a name ending with the flavor (AVX/AVX2/AVX512)
LINUX ONLY
Declaration
public static HybRunner AutoCPU()
Returns
Type |
Description |
HybRunner |
The appropriate HybRunner
|
AVX(Object, String)
Allows to call AVX implementations of an object's entrypoints
Declaration
public static dynamic AVX(object o, string dllName)
Parameters
Type |
Name |
Description |
System.Object |
o |
Object to be wrapped
|
System.String |
dllName |
name of the DLL containing the native method
|
Returns
Type |
Description |
System.Object |
A dynamic proxy to the object
|
AVX(String)
Wraps a dll into an HybRunner using AVX flavor
Declaration
public static HybRunner AVX(string dllName = null)
Parameters
Type |
Name |
Description |
System.String |
dllName |
|
Returns
AVX512(Object, String)
Wraps a dll into an HybRunner using AVX512 flavor
Declaration
public static dynamic AVX512(object o, string dllName)
Parameters
Type |
Name |
Description |
System.Object |
o |
|
System.String |
dllName |
|
Returns
Type |
Description |
System.Object |
|
AVX512(String)
Wraps a dll into an HybRunner using AVX512 flavor
Declaration
public static HybRunner AVX512(string dllName = null)
Parameters
Type |
Name |
Description |
System.String |
dllName |
|
Returns
CheckExceptions()
Declaration
public void CheckExceptions()
Cuda(Object, String)
Allows to call CUDA implementations of an object's entrypoints
Declaration
public static dynamic Cuda(object o, string dllName)
Parameters
Type |
Name |
Description |
System.Object |
o |
Object to be wrapped
|
System.String |
dllName |
name of the DLL containing the native method
|
Returns
Type |
Description |
System.Object |
A dynamic proxy to the object
|
Cuda(String)
Wraps a dll into an HybRunner using CUDA, allowing to further set the work distribution parameter (see SetDistrib)
Declaration
public static HybRunner Cuda(string dllName = null)
Parameters
Type |
Name |
Description |
System.String |
dllName |
|
Returns
Cuda(String, cudaStream_t, CudaMarshaler)
Wraps a dll into an HybRunner using CUDA flavor
Declaration
public static HybRunner Cuda(string dllName, cudaStream_t stream, CudaMarshaler marshaler)
Parameters
Returns
Env()
Instanciates a HybRunner with a flavor from an environment variable (%HYBRIDIZER_FLAVOR%) [CUDA if not present]
possible values for %HYBRIDIZER_FLAVOR% : [CUDA, AVX, AVX2, AVX512, AUTOCPU]
Declaration
public static HybRunner Env()
Returns
Type |
Description |
HybRunner |
HybRunner instance
|
GetCudaVersion()
Gets CUDA version from app.config
Declaration
public static string GetCudaVersion()
Returns
Type |
Description |
System.String |
|
OMP(Object, String)
Allows to call OMP implementations of an object's entrypoints
Declaration
public static dynamic OMP(object o, string dllName)
Parameters
Type |
Name |
Description |
System.Object |
o |
Object to be wrapped
|
System.String |
dllName |
name of the DLL containing the native method
|
Returns
Type |
Description |
System.Object |
A dynamic proxy to the object
|
OMP(String)
Wraps a dll into an HybRunner using OMP flavor
Declaration
public static HybRunner OMP(string dllName)
Parameters
Type |
Name |
Description |
System.String |
dllName |
|
Returns
saveAssembly(String)
INTERNAL METHOD - For debugging only
Declaration
public void saveAssembly(string name = "HybridizerHybRunner_Generated.dll")
Parameters
Type |
Name |
Description |
System.String |
name |
name : example.dll
|
SetDistrib(dim3, dim3)
Set cuda work distribution parameters
Declaration
public HybRunner SetDistrib(dim3 grid, dim3 block)
Parameters
Type |
Name |
Description |
dim3 |
grid |
NOTE: grid.z is ignored !
|
dim3 |
block |
|
Returns
SetDistrib(Int32, Int32)
Set cuda work distribution parameters
Declaration
public HybRunner SetDistrib(int gridDimX, int blockDimX)
Parameters
Type |
Name |
Description |
System.Int32 |
gridDimX |
|
System.Int32 |
blockDimX |
|
Returns
SetDistrib(Int32, Int32, Int32, Int32, Int32, Int32)
Configures a launch (CUDA-only)
Declaration
public HybRunner SetDistrib(int gridDimX, int gridDimY, int blockDimX, int blockDimY, int blockDimZ, int shared)
Parameters
Type |
Name |
Description |
System.Int32 |
gridDimX |
|
System.Int32 |
gridDimY |
|
System.Int32 |
blockDimX |
|
System.Int32 |
blockDimY |
|
System.Int32 |
blockDimZ |
|
System.Int32 |
shared |
|
Returns
SetGridSync(Boolean)
Declaration
public HybRunner SetGridSync(bool value)
Parameters
Type |
Name |
Description |
System.Boolean |
value |
|
Returns
SetShared(Int32)
Sets the shared memory size parameter for a launch (CUDA-only)
Declaration
public HybRunner SetShared(int shared)
Parameters
Type |
Name |
Description |
System.Int32 |
shared |
|
Returns
Wrap(Object)
Wraps an object using the current flavor
Declaration
public dynamic Wrap(object o)
Parameters
Type |
Name |
Description |
System.Object |
o |
|
Returns
Type |
Description |
System.Object |
|