src/condor_tools/condor_gpu_discovery.cpp
int ConvertSMVer2Cores(int major, int minor)
{
	// Defines for GPU Architecture types (using the SM version to determine the # of cores per SM
    typedef struct {
        int SM; // 0xMm (hexidecimal notation), M = SM Major version, and m = SM minor version
        int Cores;
	} sSMtoCores;

    sSMtoCores nGpuArchCoresPerSM[] =
    {
        { 0x10,  8 }, // Tesla Generation (SM 1.0) G80 class
        { 0x11,  8 }, // Tesla Generation (SM 1.1) G8x class
        { 0x12,  8 }, // Tesla Generation (SM 1.2) G9x class
        { 0x13,  8 }, // Tesla Generation (SM 1.3) GT200 class
        { 0x20, 32 }, // Fermi Generation (SM 2.0) GF100 class
        { 0x21, 48 }, // Fermi Generation (SM 2.1) GF10x class
        { 0x30, 192}, // Kepler Generation (SM 3.0) GK10x class
        { 0x32, 192}, // Kepler Generation (SM 3.2) GK20A class
        { 0x35, 192}, // Kepler Generation (SM 3.5) GK11x class
        { 0x37, 192}, // Kepler Generation (SM 3.7) GK21x class
        { 0x50, 128}, // Maxwell Generation (SM 5.0) GM10x class
        { 0x52, 128}, // Maxwell Generation (SM 5.2) GM20x class
        { 0x53, 128}, // Maxwell Generation (SM 5.3) GM20x class
        { 0x60, 64 }, // Pascal Generation (SM 6.0) GP100 class
        { 0x61, 128}, // Pascal Generation (SM 6.1) GP10x class
        { 0x62, 128}, // Pascal Generation (SM 6.2) GP10x class
        { 0x70, 64 }, // Volta Generation (SM 7.0) GV100 class
        { 0x72, 64 }, // Volta Generation (SM 7.2) GV10B class
        { 0x75, 64 }, // Turing Generation (SM 7.5) TU1xx class
        {   -1, -1 }
    };

    int index = 0;
    while (nGpuArchCoresPerSM[index].SM != -1) {
        if (nGpuArchCoresPerSM[index].SM == ((major << 4) + minor) ) {
            return nGpuArchCoresPerSM[index].Cores;
        }
        index++;
    }
    // If we don't find the values, default to the last known generation
    return nGpuArchCoresPerSM[index-1].Cores;
}
// this coded was stolen from helper_cuda.h in the cuda 5.5 sdk.
this coded was stolen from helper_cuda.h in the cuda 5.5 sdk.
this coded was stolen from helper_cuda . h in the cuda 5 . 5 sdk .
int ConvertSMVer2Cores(int major, int minor)
{
    typedef struct {
        int SM; 
        int Cores;
	} sSMtoCores;
    sSMtoCores nGpuArchCoresPerSM[] =
    {
        { 0x10,  8 }, 
        { 0x11,  8 }, 
        { 0x12,  8 }, 
        { 0x13,  8 }, 
        { 0x20, 32 }, 
        { 0x21, 48 }, 
        { 0x30, 192}, 
        { 0x32, 192}, 
        { 0x35, 192}, 
        { 0x37, 192}, 
        { 0x50, 128}, 
        { 0x52, 128}, 
        { 0x53, 128}, 
        { 0x60, 64 }, 
        { 0x61, 128}, 
        { 0x62, 128}, 
        { 0x70, 64 }, 
        { 0x72, 64 }, 
        { 0x75, 64 }, 
        {   -1, -1 }
    };
    int index = 0;
    while (nGpuArchCoresPerSM[index].SM != -1) {
        if (nGpuArchCoresPerSM[index].SM == ((major << 4) + minor) ) {
            return nGpuArchCoresPerSM[index].Cores;
        }
        index++;
    }
    return nGpuArchCoresPerSM[index-1].Cores;
}
int ConvertSMVer2Cores ( int major , int minor ) { typedef struct { int SM ; int Cores ; } sSMtoCores ; sSMtoCores nGpuArchCoresPerSM [ ] = { { 0x10 , 8 } , { 0x11 , 8 } , { 0x12 , 8 } , { 0x13 , 8 } , { 0x20 , 32 } , { 0x21 , 48 } , { 0x30 , 192 } , { 0x32 , 192 } , { 0x35 , 192 } , { 0x37 , 192 } , { 0x50 , 128 } , { 0x52 , 128 } , { 0x53 , 128 } , { 0x60 , 64 } , { 0x61 , 128 } , { 0x62 , 128 } , { 0x70 , 64 } , { 0x72 , 64 } , { 0x75 , 64 } , { -1 , -1 } } ; int index = 0 ; while ( nGpuArchCoresPerSM [ index ] . SM != -1 ) { if ( nGpuArchCoresPerSM [ index ] . SM == ( ( major << 4 ) + minor ) ) { return nGpuArchCoresPerSM [ index ] . Cores ; } index ++ ; } return nGpuArchCoresPerSM [ index - 1 ] . Cores ; }
this coded was stolen from helper_cuda.h in the cuda 5.5 sdk.
this coded was stolen from helper_cuda . h in the cuda 5 . 5 sdk .
// Defines for GPU Architecture types (using the SM version to determine the # of cores per SM // 0xMm (hexidecimal notation), M = SM Major version, and m = SM minor version // Tesla Generation (SM 1.0) G80 class // Tesla Generation (SM 1.1) G8x class // Tesla Generation (SM 1.2) G9x class // Tesla Generation (SM 1.3) GT200 class // Fermi Generation (SM 2.0) GF100 class // Fermi Generation (SM 2.1) GF10x class // Kepler Generation (SM 3.0) GK10x class // Kepler Generation (SM 3.2) GK20A class // Kepler Generation (SM 3.5) GK11x class // Kepler Generation (SM 3.7) GK21x class // Maxwell Generation (SM 5.0) GM10x class // Maxwell Generation (SM 5.2) GM20x class // Maxwell Generation (SM 5.3) GM20x class // Pascal Generation (SM 6.0) GP100 class // Pascal Generation (SM 6.1) GP10x class // Pascal Generation (SM 6.2) GP10x class // Volta Generation (SM 7.0) GV100 class // Volta Generation (SM 7.2) GV10B class // Turing Generation (SM 7.5) TU1xx class // If we don't find the values, default to the last known generation