|
1 |
| -<!DOCTYPE html><html> <head><title>gpgpu playground</title><link rel="stylesheet" type="text/css" media="all" href="/learn-gpgpu/styles/index.css"><script type="module" src="/learn-gpgpu/_astro/hoisted.BVkJFRlA.js"></script> |
| 1 | +<!DOCTYPE html><html> <head><title>gpgpu playground</title><link rel="stylesheet" type="text/css" media="all" href="/learn-gpgpu/styles/index.css"><script type="module" src="/learn-gpgpu/_astro/hoisted.ozVI7Nxi.js"></script> |
2 | 2 | <script type="module" src="/learn-gpgpu/_astro/page.BO5rBSqo.js"></script></head> <body> <nav> <ul> <li><a href="/learn-gpgpu/docs">docs/</a></li> </ul> </nav> <div id="talvos"> <div> <main> <textarea class="module" autocorrect="off" autocomplete="off" autocapitalize="off" spellcheck="false" aria-label="SPIR-V module assembly (spv_text format)" wrap="off">; SPIR-V
|
3 |
| -; Version: 1.3 |
4 |
| -OpCapability Shader ; TODO we need this for descriptors? really? |
| 3 | +; Version: 1.5 |
5 | 4 | OpCapability Kernel
|
| 5 | +OpCapability BuffersTALVOS |
| 6 | +OpCapability ExecTALVOS |
| 7 | +OpCapability PhysicalStorageBufferAddresses |
| 8 | +OpExtension "SPV_TALVOS_buffers" |
| 9 | +OpExtension "SPV_TALVOS_exec" |
6 | 10 | OpMemoryModel Logical OpenCL
|
7 | 11 |
|
8 | 12 | OpEntryPoint Kernel %main_fn "main" %gl_GlobalInvocationID
|
9 | 13 |
|
10 |
| -; TODO instead of DISPATCH, one of these: |
11 |
| -;OpExecutionMode %main_fn LocalSize 16 1 1 |
12 |
| -;OpExecutionMode %main_fn GlobalSize 16 1 1 |
| 14 | +OpExecutionGlobalSizeTALVOS %main_fn 16 1 1 |
13 | 15 |
|
14 |
| -; TODO[seth]: is this a spec misread in talvos? Shouldn't the DISPATCH map to local size? |
15 |
| -; (or is it execution mode dependent?) |
16 | 16 | OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
|
| 17 | +OpDecorate %_arr_uint32_t ArrayStride 4 |
17 | 18 |
|
18 |
| -; TODO instead of descriptors, static allocation via `OpBufferTALVOS 64` (maybe w/ %ty? and/or name?) |
19 |
| -; TODO how do people pass data back & forth w/ OpenCL kernels for real? |
20 |
| -OpDecorate %buf0 DescriptorSet 0 |
21 |
| -OpDecorate %buf0 Binding 0 |
| 19 | +; types |
| 20 | + %void_t = OpTypeVoid |
| 21 | + %void_fn_t = OpTypeFunction %void_t |
| 22 | + %uint32_t = OpTypeInt 32 0 |
| 23 | + %gbl_id_t = OpTypeVector %uint32_t 3 |
22 | 24 |
|
23 |
| -; TODO instead of `DUMP`, something like `OpDumpAtEndTALVOS %buffer_id` ? |
24 |
| -; Or perhaps that's just implied by `OpBufferTALVOS` ? |
| 25 | + %arr_len = OpConstant %uint32_t 16 |
| 26 | + %_arr_uint32_t = OpTypeArray %uint32_t %arr_len |
25 | 27 |
|
26 |
| - ; types |
27 |
| - %void_t = OpTypeVoid |
28 |
| -%void_fn_t = OpTypeFunction %void_t |
29 |
| - %uint32_t = OpTypeInt 32 0 |
30 |
| - %gbl_id_t = OpTypeVector %uint32_t 3 |
| 28 | + %_ptr_Input_gbl_id_t = OpTypePointer Input %gbl_id_t |
| 29 | + %_ptr_Input_uint32_t = OpTypePointer Input %uint32_t |
31 | 30 |
|
32 |
| -%_arr_uint32_t = OpTypeRuntimeArray %uint32_t |
| 31 | +%_ptr_PhysicalStorageBuffer_uint32_t = OpTypePointer PhysicalStorageBuffer %uint32_t |
| 32 | +%_arr_PhysicalStorageBuffer_uint32_t = OpTypePointer PhysicalStorageBuffer %_arr_uint32_t |
33 | 33 |
|
34 |
| -%_ptr_StorageBuffer_uint32_t = OpTypePointer StorageBuffer %uint32_t |
35 |
| -%_arr_StorageBuffer_uint32_t = OpTypePointer StorageBuffer %_arr_uint32_t |
36 |
| - %_ptr_Input_gbl_id_t = OpTypePointer Input %gbl_id_t |
37 |
| - %_ptr_Input_uint32_t = OpTypePointer Input %uint32_t |
38 | 34 |
|
39 |
| - |
40 |
| - ; global arguments & constants |
| 35 | +; global arguments & constants |
41 | 36 | %n = OpConstant %uint32_t 0
|
42 | 37 | %gl_GlobalInvocationID = OpVariable %_ptr_Input_gbl_id_t Input
|
43 |
| - %buf0 = OpVariable %_arr_StorageBuffer_uint32_t StorageBuffer |
| 38 | + %buf0 = OpBufferTALVOS %_arr_PhysicalStorageBuffer_uint32_t PhysicalStorageBuffer 64 "a" |
44 | 39 |
|
45 |
| - ; FILL_IDX entry point |
| 40 | +; FILL_IDX entry point |
46 | 41 | %main_fn = OpFunction %void_t None %void_fn_t
|
47 | 42 | %0 = OpLabel
|
48 | 43 | %2 = OpAccessChain %_ptr_Input_uint32_t %gl_GlobalInvocationID %n
|
49 |
| - %3 = OpLoad %uint32_t %2 |
50 |
| - %4 = OpAccessChain %_ptr_StorageBuffer_uint32_t %buf0 %3 |
51 |
| - OpStore %4 %3 |
| 44 | + %3 = OpLoad %uint32_t %2 Aligned 4 |
| 45 | + %4 = OpAccessChain %_ptr_PhysicalStorageBuffer_uint32_t %buf0 %3 |
| 46 | + OpStore %4 %3 Aligned 4 |
52 | 47 | OpReturn
|
53 | 48 | OpFunctionEnd
|
54 |
| -</textarea> </main> <aside> <section> <textarea class="commands_todo_make_js_concatenate_all_the_commands inactive" autocorrect="off" autocomplete="off" autocapitalize="off" spellcheck="false" aria-label="Talvos commands (informational)" disabled wrap="off"># MODULE fill.spvasm</textarea> </section> <section> <label>ENTRY |
| 49 | +</textarea> </main> <aside> <section> <textarea class="commands_todo_make_js_concatenate_all_the_commands inactive" autocorrect="off" autocomplete="off" autocapitalize="off" spellcheck="false" aria-label="Talvos commands (informational)" disabled wrap="off"># MODULE fill_idx.spvasm</textarea> </section> <section> <label>ENTRY |
55 | 50 | <select name="entry"></select> </label> </section> <section> <textarea class="commands" style="height: 434px" autocorrect="off" autocomplete="off" autocapitalize="off" spellcheck="false" aria-label="Talvos commands (tcf format)" wrap="off">
|
56 |
| -BUFFER a 64 UNINIT |
57 |
| -# ^ bytes |
58 |
| - |
59 |
| -DESCRIPTOR_SET 0 0 0 a |
60 |
| - |
61 |
| -DISPATCH 16 1 1 |
62 |
| -# ^ work items (here, "elements") |
63 |
| - |
64 |
| -DUMP UINT32 a |
65 |
| -# ^ bits |
| 51 | +EXEC |
66 | 52 |
|
67 |
| -# NB: a's size and the DISPATCH must agree; |
68 |
| -# i.e. 16 elements == (64 bytes / (32 bits per element / 8 bits per byte)) |
69 |
| -# a should be filled with the value of %FILL |
70 | 53 | </textarea> </section> </aside> </div> <div id="controls"> <button class="validate exec">validate</button> <button class="run exec">run</button> <button class="debug exec">debug</button> <div hidden> <button class="exception">exception</button> <button class="assertion">assertion</button> <button class="shrubbery">shrubbery</button> </div> <div class="debugger" hidden> <!-- cf. PipelineExecutor::help --> <button class="step">step</button> <button class="switch">switch</button> <button class="print">print</button> <button class="continue">continue</button> <button class="stop">stop</button> <!-- missing: [break, breakpoint, help, quit] --> </div> </div> <!-- TODO
|
71 | 54 | can we pull out just this one wodget into a "component"?
|
72 | 55 | it'd be nice to write some code for turning `102043253.21231222ms` into a human time
|
|
0 commit comments