示例#1
0
        /// <summary>
        /// copies platform too, to stop different ClNumberCruncher instances destroying their common platform
        /// </summary>
        /// <param name="devicePartitionEnabled"></param>
        /// <param name="streamingEnabled"></param>
        /// <param name="MAX_CPU_CORES"></param>
        /// <returns></returns>
        internal ClDevice copyWithPlatformCopy(bool devicePartitionEnabled = false, bool streamingEnabled = false, int MAX_CPU_CORES = -1)
        {
            ClDevice result = new ClDevice(clPlatformForCopy.copy(),
                                           deviceTypeCodeInClPlatformForCopy,
                                           iForCopy,
                                           devicePartitionForCopy | devicePartitionEnabled,
                                           GPU_STREAMForCopy | streamingEnabled,
                                           ((MAX_CPU_CORES <= 0) ? MAX_CPUForCopy : MAX_CPU_CORES));


            return(result);
        }
示例#2
0
        internal ClDevice copyExact()
        {
            ClDevice result = new ClDevice(clPlatformForCopy.copy(),
                                           deviceTypeCodeInClPlatformForCopy,
                                           iForCopy,
                                           devicePartitionForCopy,
                                           GPU_STREAMForCopy,
                                           MAX_CPUForCopy);


            return(result);
        }
示例#3
0
 /// <summary>
 /// creates a context for a device, this library makes use of explicit multi device control for compute
 /// </summary>
 /// <param name="device">device to use for context</param>
 public ClContext(ClDevice device)
 {
     hDevice   = device.h();
     hPlatform = device.hp();
     hContext  = createContext(hPlatform, hDevice);
 }