chsasank / llama.lisp

Lisp dialect designed for HPC and AI
GNU Lesser General Public License v2.1
14 stars 7 forks source link

SPIR-V generator #74

Open Ameya674 opened 1 month ago

Ameya674 commented 1 month ago
    **sycl-lisp**            cuda-lisp
           \                /                                                 We have to make sycl-lisp
             \           /
                c-lisp                                                       Phase 1 - https://github.com/oneapi-src/unified-runtime  
                    |                                                           Phase 2 - https://github.com/KhronosGroup/SPIRV-LLVM-Translator
             brilisp                                                       
                    |
                   llvm 
          /     |      |    \ 
        /       |      |      \ 
     x86  arm  ptx     spirv
chsasank commented 1 month ago

Compile this example: https://github.com/oneapi-src/unified-runtime/tree/main/examples/codegen

Get the LLVM IR created at this: https://github.com/oneapi-src/unified-runtime/blob/a7920efd89bd137ac2929467ffaeeebefaa29953/examples/codegen/helpers.cpp#L73

We'll then figure out how to do it in our framework

Ameya674 commented 1 month ago

codegen done and documented. now finding spirv mangling and demangling specs

chsasank commented 1 month ago

@Ameya674 can you post LLVM IR that's used to generate SPIR-V kernel here? Can you try to correlate spir-v with LLVM to understand how spir-v/llvm translator works? I suspect you'll be able to generate this LLVM with c-lisp like in #71.