Compilation options for compiling ptxas.
| 31 | |
| 32 | // Compilation options for compiling ptxas. |
| 33 | struct PtxCompilationOptions { |
| 34 | bool disable_ptxas_optimizations; |
| 35 | |
| 36 | // CUDA directory which would be searched first. |
| 37 | std::string preferred_cuda_dir; |
| 38 | |
| 39 | std::vector<std::string> extra_flags; |
| 40 | |
| 41 | explicit PtxCompilationOptions(bool disable_ptxas_optimizations = false, |
| 42 | absl::string_view preferred_cuda_dir = "", |
| 43 | absl::Span<const std::string> extra_flags = {}) |
| 44 | : disable_ptxas_optimizations(disable_ptxas_optimizations), |
| 45 | preferred_cuda_dir(preferred_cuda_dir), |
| 46 | extra_flags(extra_flags.begin(), extra_flags.end()) {} |
| 47 | |
| 48 | using PtxOptionsTuple = |
| 49 | std::tuple<bool, std::string, std::vector<std::string>>; |
| 50 | |
| 51 | PtxOptionsTuple ToTuple() { |
| 52 | return std::make_tuple(disable_ptxas_optimizations, preferred_cuda_dir, extra_flags); |
| 53 | } |
| 54 | }; |
| 55 | |
| 56 | // Compiles the given PTX string using ptxas and returns the resulting machine |
| 57 | // code (i.e. a cubin) as a byte array. |
no outgoing calls
no test coverage detected