ManagedCuda.CudaOccupancy.cudaOccRegAllocationGranularity C# (CSharp) Method

cudaOccRegAllocationGranularity() private static method

private static cudaOccRegAllocationGranularity ( cudaOccDeviceProp properties, int regsPerThread ) : int
properties cudaOccDeviceProp
regsPerThread int
return int
        private static int cudaOccRegAllocationGranularity(cudaOccDeviceProp properties, int regsPerThread)
        {
            switch(properties.computeMajor)
            {
                //case 1:  return (properties.minor <= 1) ? 256 : 512;
                case 2:  switch(regsPerThread)
                         {
                            case 21:
                            case 22:
                            case 29:
                            case 30:
                            case 37:
                            case 38:
                            case 45:
                            case 46:
                                return 128;
                            default:
                                return 64;
                         }
                case 3:
                case 5:
                case 6:  return 256;
                default: throw new CudaOccupancyException(cudaOccError.ErrorUnknownDevice);
            }
        }