Files
whetstone_DSL/editor/src/CUDALibraryProfile.h

67 lines
2.9 KiB
C
Raw Normal View History

#pragma once
// Step 1978: CUDALibraryProfile
// Full CUDA capability ledger: cublas, cufft, thrust, cudnn.
// Scores, preferredAPIs, and knownWeaknesses for each (library, domain) pair.
#include "LibraryCapabilityLedger.h"
namespace whetstone {
class CUDALibraryProfile {
public:
static LibraryCapabilityLedger buildLedger() {
LibraryCapabilityLedger ledger;
// --- cublas ---
ledger.set({"cublas", "compute.matrix", 0.99f,
{"cublasSgemm()", "cublasDgemm()", "cublasSgemv()",
"cublasCreate()", "cublasDestroy()"},
{"requires-device-memory-management",
"no-automatic-handle-lifecycle",
"single-gpu-only-without-multi-gpu-wrappers"},
false, "2026-03-02", "benchmark+api-analysis"});
ledger.set({"cublas", "compute.statistics", 0.00f,
{},
{"not-applicable-for-statistics"},
true, "2026-03-02", "api-analysis"});
// --- cufft ---
ledger.set({"cufft", "compute.fft", 0.99f,
{"cufftPlan1d()", "cufftExecC2C()", "cufftDestroy()",
"cufftPlanMany()"},
{"requires-separate-cufft-handle-lifecycle",
"complex-plan-setup-for-batched-transforms"},
false, "2026-03-02", "benchmark"});
// --- thrust ---
ledger.set({"thrust", "compute.parallel", 0.97f,
{"thrust::transform()", "thrust::reduce()", "thrust::copy()",
"thrust::fill()", "thrust::for_each()"},
{"host-device-copy-required-for-mixed-workloads"},
false, "2026-03-02", "benchmark"});
ledger.set({"thrust", "compute.sort", 0.97f,
{"thrust::sort()", "thrust::stable_sort()",
"thrust::sort_by_key()", "thrust::stable_sort_by_key()"},
{"comparator-must-be-device-compatible"},
false, "2026-03-02", "benchmark"});
// --- cudnn ---
ledger.set({"cudnn", "compute.ml.inference", 0.99f,
{"cudnnConvolutionForward()", "cudnnActivationForward()",
"cudnnPoolingForward()", "cudnnCreate()", "cudnnDestroy()"},
{"workspace-memory-must-be-pre-allocated",
"descriptor-setup-verbose"},
false, "2026-03-02", "benchmark"});
ledger.set({"cudnn", "compute.ml.training", 0.97f,
{"cudnnConvolutionBackwardData()", "cudnnConvolutionBackwardFilter()",
"cudnnActivationBackward()"},
{"workspace-memory-must-be-pre-allocated",
"gradient-accumulation-manual"},
false, "2026-03-02", "benchmark"});
return ledger;
}
};
} // namespace whetstone