(assembly: string)
| 224 | } |
| 225 | |
| 226 | async splitDeviceCode(assembly: string) { |
| 227 | // Check to see if there is any offload code in the assembly file. |
| 228 | if (!offloadRegexp.test(assembly)) return null; |
| 229 | |
| 230 | offloadRegexp.lastIndex = 0; |
| 231 | const matches = assembly.matchAll(offloadRegexp); |
| 232 | let prevStart = 0; |
| 233 | const devices: Record<string, string> = {}; |
| 234 | for (const match of matches) { |
| 235 | const [full, startOrEnd, triple] = match; |
| 236 | if (startOrEnd === '__START__') { |
| 237 | prevStart = match.index + full.length + 1; |
| 238 | } else { |
| 239 | devices[triple] = assembly.substring(prevStart, match.index); |
| 240 | } |
| 241 | } |
| 242 | return devices; |
| 243 | } |
| 244 | |
| 245 | override async extractDeviceCode(result, filters: ParseFiltersAndOutputOptions, compilationInfo: CompilationInfo) { |
| 246 | const split = await this.splitDeviceCode(result.asm); |
no test coverage detected