Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/omega/slices/launch.osc # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / omega / slices / launch.osc` 91 lines · 3151 bytes Raw Blame History 1 // slice-entry: mthd_hdr qmd_mthd qmd_addr_hi qmd_addr_lo setup_words 2 // The FP8 path's submit scheme, copied into Omega. This is the proven way a 3 // kernel gets onto the chip (omega_gpu_session_launch). A pushbuffer word is 4 // one method header: opcode 2 in bits 31:28, count in 28:16, subchannel in 5 // 15:13, method in 12:0 as mthd>>2. A method must be 4-aligned and at most 6 // 0x7ffc, count at most 0x1fff, subchannel at most 7. The kernel launch is 7 // method 0x0318 on subchannel 1 with dependence 2. Its address is two words: 8 // bit 30 and address bits 48:40 in the first, address bits 39:8 in the second. 9 // The compute-class setup is the FP8 path's 18 words, byte for byte. 10 // Expected values from Wolfram. 11 // slice-run: mthd_hdr bytes: 1 540 1 -> `536944775` 12 // slice-run: mthd_hdr bytes: 1 392 2 -> `537010274` 13 // slice-run: mthd_hdr bytes: 1 384 2 -> `537010272` 14 // slice-run: mthd_hdr bytes: 1 432 1 -> `536944748` 15 // slice-run: mthd_hdr bytes: 0 92 5 -> `537198615` 16 // slice-run: mthd_hdr bytes: 0 40 4 -> `537133066` 17 // slice-run: mthd_hdr bytes: 1 542 1 -> `18446744073709551615` 18 // slice-run: mthd_hdr bytes: 8 392 2 -> `18446744073709551615` 19 // slice-run: qmd_mthd bytes: -> `543301830` 20 // slice-run: qmd_addr_hi bytes: `21474836480` -> `1073741824` 21 // slice-run: qmd_addr_lo bytes: `21474836480` -> `83886080` 22 // slice-run: qmd_addr_lo bytes: `4886718345` -> `19088743` 23 // slice-run: qmd_addr_lo bytes: `1099511628032` -> 1 24 // slice-run: qmd_addr_lo bytes: `562949953421312` -> `18446744073709551615` 25 // slice-run: setup_words cells:18 -> 0 cells=`536944737`,52928,`536944786`,1,`536944808`,15,`536946013`,3,`536946014`,`536870912`,`536946015`,`1048575`,`536946007`,3,`536946008`,`570425344`,`536946009`,0 26 // slice-run: setup_words cells:4 -> `18446744073709551615` 27 28 fn mthd_hdr(b: bytes, subc: u64, mthd: u64, count: u64) -> u64 { 29 if b.len > 0 { 30 return `18446744073709551615`; 31 } 32 if subc > 7 || count > 8191 { 33 return `18446744073709551615`; 34 } 35 if mthd & 3 != 0 || mthd > 32764 { 36 return `18446744073709551615`; 37 } 38 return `536870912` | (count << 16) | (subc << 13) | (mthd >> 2); 39 } 40 41 fn qmd_mthd(b: bytes) -> u64 { 42 if b.len > 0 { 43 return `18446744073709551615`; 44 } 45 return `543301830`; 46 } 47 48 fn qmd_addr_hi(b: bytes, va: u64) -> u64 { 49 if b.len > 0 { 50 return `18446744073709551615`; 51 } 52 if va >= `562949953421312` { 53 return `18446744073709551615`; 54 } 55 return `1073741824` | ((va >> 40) & 511); 56 } 57 58 fn qmd_addr_lo(b: bytes, va: u64) -> u64 { 59 if b.len > 0 { 60 return `18446744073709551615`; 61 } 62 if va >= `562949953421312` { 63 return `18446744073709551615`; 64 } 65 return (va >> 8) & `4294967295`; 66 } 67 68 fn setup_words(out: cells) -> u64 { 69 if out.len < 18 { 70 return `18446744073709551615`; 71 } 72 out[0] = `536944737`; 73 out[1] = 52928; 74 out[2] = `536944786`; 75 out[3] = 1; 76 out[4] = `536944808`; 77 out[5] = 15; 78 out[6] = `536946013`; 79 out[7] = 3; 80 out[8] = `536946014`; 81 out[9] = `536870912`; 82 out[10] = `536946015`; 83 out[11] = `1048575`; 84 out[12] = `536946007`; 85 out[13] = 3; 86 out[14] = `536946008`; 87 out[15] = `570425344`; 88 out[16] = `536946009`; 89 out[17] = 0; 90 return 0; 91 }