Get gencode flags for current device or input.
(archs)
| 153 | |
| 154 | |
| 155 | def get_gencode_flags(archs): |
| 156 | """ |
| 157 | Get gencode flags for current device or input. |
| 158 | """ |
| 159 | cc_s = get_sm_version(archs) |
| 160 | flags = [] |
| 161 | for cc_val in cc_s: |
| 162 | if cc_val == 90: |
| 163 | arch_code = "90a" |
| 164 | flags += [ |
| 165 | "-gencode", |
| 166 | f"arch=compute_{arch_code},code=sm_{arch_code}", |
| 167 | ] |
| 168 | elif cc_val == 100: # Assuming 100 is the code for Blackwell SM10.x |
| 169 | # Per NVIDIA dev blog, for CUTLASS and architecture-specific features on CC 10.0, use '100a' |
| 170 | # https://developer.nvidia.com/blog/nvidia-blackwell-and-nvidia-cuda-12-9-introduce-family-specific-architecture-features/ |
| 171 | # "The CUTLASS build instructions specify using the a flag when building for devices of CC 9.0 and 10.0" |
| 172 | arch_code = "100a" |
| 173 | flags += [ |
| 174 | "-gencode", |
| 175 | f"arch=compute_{arch_code},code=sm_{arch_code}", |
| 176 | ] |
| 177 | else: |
| 178 | flags += ["-gencode", f"arch=compute_{cc_val},code=sm_{cc_val}"] |
| 179 | return flags |
| 180 | |
| 181 | |
| 182 | def find_end_files(directory, end_str): |
no test coverage detected