// check wheter compute capability cc works func ccIsOK(cc int) (ok bool) { defer func() { if err := recover(); err == cu.ERROR_NO_BINARY_FOR_GPU { ok = false } }() cu.ModuleLoadData(madd2_map[cc]).GetFunction("madd2") return true }
// load PTX code for function name, find highest SM that matches our card. func fatbinLoad(sm map[int]string, fn string) cu.Function { cc := determineCC() return cu.ModuleLoadData(sm[cc]).GetFunction(fn) }