/// <summary> /// Constructs a new PTX intrinsic that can handle all architectures. /// </summary> /// <param name="targetMethod">The associated target method.</param> /// <param name="mode">The code-generation mode.</param> public PTXIntrinsic(MethodInfo targetMethod, IntrinsicImplementationMode mode) : base( BackendType.PTX, targetMethod, mode) { }
/// <summary> /// Constructs a new OpenCL intrinsic that can handle all architectures. /// </summary> /// <param name="targetMethod">The associated target method.</param> /// <param name="mode">The code-generation mode.</param> public CLIntrinsic(MethodInfo targetMethod, IntrinsicImplementationMode mode) : base( BackendType.OpenCL, targetMethod, mode) { }
/// <summary> /// Creates a new CL intrinsic. /// </summary> /// <param name="name">The name of the intrinsic.</param> /// <param name="mode">The implementation mode.</param> /// <returns>The created intrinsic.</returns> private static CLIntrinsic CreateIntrinsic( string name, IntrinsicImplementationMode mode) => new CLIntrinsic( CLIntrinsicsType, name, mode);
public ILIntrinsic( Type handlerType, string methodName, IntrinsicImplementationMode mode) : base(BackendType.IL, handlerType, methodName, mode) { }
/// <summary> /// Constructs a new OpenCL intrinsic that can handle all architectures. /// </summary> /// <param name="handlerType">The associated target handler type.</param> /// <param name="mode">The code-generation mode.</param> public CLIntrinsic(Type handlerType, IntrinsicImplementationMode mode) : base( BackendType.OpenCL, handlerType, null, mode) { }
/// <summary> /// Constructs a new PTX intrinsic that can handle all architectures. /// </summary> /// <param name="handlerType">The associated target handler type.</param> /// <param name="mode">The code-generation mode.</param> /// <param name="architecture">The target architecture (if any).</param> public PTXIntrinsic( Type handlerType, IntrinsicImplementationMode mode, PTXArchitecture architecture) : this(handlerType, mode) { MinArchitecture = architecture; }
/// <summary> /// Constructs a new PTX intrinsic that can handle all architectures. /// </summary> /// <param name="handlerType">The associated target handler type.</param> /// <param name="mode">The code-generation mode.</param> public PTXIntrinsic(Type handlerType, IntrinsicImplementationMode mode) : base( BackendType.PTX, handlerType, null, mode) { }
/// <summary> /// Creates a new PTX intrinsic. /// </summary> /// <param name="name">The name of the intrinsic.</param> /// <param name="mode">The implementation mode.</param> /// <param name="minArchitecture">The minimum architecture.</param> /// <param name="maxArchitecture">The maximum architecture.</param> /// <returns>The created intrinsic.</returns> private static PTXIntrinsic CreateIntrinsic( string name, IntrinsicImplementationMode mode, PTXArchitecture?minArchitecture, PTXArchitecture maxArchitecture) => new PTXIntrinsic( PTXIntrinsicsType, name, mode, minArchitecture, maxArchitecture);
/// <summary> /// Constructs a new PTX intrinsic. /// </summary> /// <param name="handlerType">The associated target handler type.</param> /// <param name="methodName">The target method name (or null).</param> /// <param name="mode">The code-generator mode.</param> /// <param name="architecture">The target architecture (if any).</param> public PTXIntrinsic( Type handlerType, string methodName, IntrinsicImplementationMode mode, PTXArchitecture architecture) : base( BackendType.PTX, handlerType, methodName, mode) { MinArchitecture = architecture; }
/// <summary> /// Constructs a new implementation. /// </summary> /// <param name="backendType">The main backend type.</param> /// <param name="handlerType">The associated target handler type.</param> /// <param name="methodName">The target method name (or null).</param> /// <param name="mode">The code-generation mode.</param> protected IntrinsicImplementation( BackendType backendType, Type handlerType, string methodName, IntrinsicImplementationMode mode) : this( backendType, handlerType.GetMethod( methodName ?? "Invoke", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance), mode) { }
/// <summary> /// Constructs a new implementation. /// </summary> /// <param name="backendType">The main backend type.</param> /// <param name="targetMethod">The associated target method.</param> /// <param name="mode">The code-generation mode.</param> protected IntrinsicImplementation( BackendType backendType, MethodInfo targetMethod, IntrinsicImplementationMode mode) { BackendType = backendType; TargetMethod = targetMethod ?? throw new NotSupportedException( string.Format(ErrorMessages.NotSupportedIntrinsic, GetType())); if (TargetMethod.IsGenericMethod) { TargetMethod = TargetMethod.GetGenericMethodDefinition(); } Mode = mode; }
/// <summary> /// Constructs a new PTX intrinsic. /// </summary> /// <param name="handlerType">The associated target handler type.</param> /// <param name="methodName">The target method name (or null).</param> /// <param name="mode">The code-generator mode.</param> /// <param name="minArchitecture">The min architecture (if any).</param> /// <param name="maxArchitecture">The max architecture (exclusive).</param> public PTXIntrinsic( Type handlerType, string methodName, IntrinsicImplementationMode mode, CudaArchitecture?minArchitecture, CudaArchitecture maxArchitecture) : base( BackendType.PTX, handlerType, methodName, mode) { MinArchitecture = minArchitecture; MaxArchitecture = maxArchitecture; }