Class MainMemoryMarshaler
Marshaler to main memory - to be used for OMP and AVX flavors
Usage example:
\begin{lstlisting}[style=customcs]
[DllImport("{DLL name}.dll", EntryPoint = "{EntryPointName}", CallingConvention = CallingConvention.Cdecl)] private static extern int methodName ( [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(MainMemoryMarshaler))] TypeToBemarshaled param);
\end{lstlisting}
Implements
System.Runtime.InteropServices.ICustomMarshaler
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()
Namespace: Hybridizer.Runtime.CUDAImports
Assembly: Hybridizer.Runtime.CUDAImports.dll
Syntax
public class MainMemoryMarshaler : AbstractNativeMarshaler, ICustomMarshaler
Properties
Instance
current instance
Declaration
public static MainMemoryMarshaler Instance { get; set; }
Property Value
Type | Description |
---|---|
MainMemoryMarshaler |
Methods
Create(HybridizerFlavor)
Create an instance of MainMemoryMarshaler for the given flavor
Declaration
public static MainMemoryMarshaler Create(HybridizerFlavor flavor)
Parameters
Type | Name | Description |
---|---|---|
HybridizerFlavor | flavor |
Returns
Type | Description |
---|---|
MainMemoryMarshaler |
GetInstance(String)
Singleton implementation
Declaration
public static ICustomMarshaler GetInstance(string cookie)
Parameters
Type | Name | Description |
---|---|---|
System.String | cookie |
Returns
Type | Description |
---|---|
System.Runtime.InteropServices.ICustomMarshaler |
MarshalManagedToNative(Object)
Marshals Managed to Native
Declaration
public override IntPtr MarshalManagedToNative(object managedObj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | managedObj |
Returns
Type | Description |
---|---|
System.IntPtr |
Overrides
Implements
System.Runtime.InteropServices.ICustomMarshaler