gtcasl / gpuocelot

GPUOCelot: A dynamic compilation framework for PTX
http://gpuocelot.gatech.edu/
BSD 3-Clause "New" or "Revised" License
280 stars 69 forks source link

Add an AMD IL backend #29

Open jwang323 opened 9 years ago

jwang323 commented 9 years ago

From gregory....@gatech.edu on October 08, 2009 13:47:27

Describe the New Feature: At a high level this would be an IR, translator, and executive kernel for AMD's IL language. Which milestone does the feature belong to? 2.0.0 Which branch does the new feature go in? Trunk

Original issue: http://code.google.com/p/gpuocelot/issues/detail?id=30

jwang323 commented 9 years ago

From mailsud...@gmail.com on October 08, 2009 18:53:50

Assigned to rod

Owner: rodrigo.d.dominguez

jwang323 commented 9 years ago

From oscarbar...@gmail.com on October 23, 2009 11:29:59

What exactly do you expect to do? I mean I think you want to write a AMD IL backend for having AMD IL-> LLVM. Would be possible to have AMD IL-> PTX or from PTX->AMD IL? i.e. you have a way to do LLVM-> PTX or AMD IL->PTX? Anyway seems that a LLVM->AMD IL is currently avaiable as part of AMD Stream 2.0 SDK.. ./llc -regalloc=amdil -filetype=asm -march=amdil kernel.bc -o kernel.il see http://forums.amd.com/devforum/messageview.cfm?catid=390&threadid=120683& enterthread=y for details Also similary as Nvidia OpenCL backend (which uses not yet published PTX spec) AMD OpenCL SDK is using a not yet published AMD IL spec (il_cs_2_0). If you want to add for testing and regression the kernels form OpenCL kernel codes use my wrapper (as currently it doesn't work on on AMD OpenCL the API for getting built device binaries).. The wrapper also gets device assembly code (similar in concept to cubin as PTX is similar to AMD IL in concept).. see http://oscarbg.blogspot.com/2009/10/cal-wrapper-for-getting-amd-il-from.html

jwang323 commented 9 years ago

From gregory....@gatech.edu on October 23, 2009 17:54:27

Actually the idea is to go from PTX to AMD IL so that we can execute pre-compiled CUDA programs on AMD GPUs.

I was unaware that there was an LLVM to AMD IL backend available as part of the Stream SDK. Thanks for the info. We might be able to take advantage of our PTX to LLVM translator, but I am doubtful because we loose a lot of information about the thread hierarchy in PTX when we go to LLVM.

Right now rod is working on this so I will leave it open to him to elaborate.

jwang323 commented 9 years ago

From rodrigo.d.dominguez@gmail.com on March 10, 2010 16:12:00

Hi oscar, I have a question regarding your calclwrapper library (from the link above)... It's not working for me. Let me know if you read this post. Thank you.

jwang323 commented 9 years ago

From juvesea...@gmail.com on April 18, 2011 01:43:57

Hi, I am new, can someone explain what exactly are you going to do in this issue? I am wondering how do you get LLVM to generate code to run on AMD GPU? The AMD IL Bankend is not open source.

jwang323 commented 9 years ago

From rodrigo.d.dominguez@gmail.com on April 18, 2011 06:17:49

The AMD GPU backend translates PTX directly into IL. This paper describes the implementation details: http://doi.acm.org/10.1145/1964179.1964186 . You can find documentation about the AMD IL at http://developer.amd.com/gpu/AMDAPPSDK/documentation .

jwang323 commented 9 years ago

From gregory....@gatech.edu on June 23, 2011 15:05:08

Status: Started

jwang323 commented 9 years ago

From villmow on March 15, 2012 10:37:39

Just a FYI, AMD open sourced its backend in December. This might help with what you are attempting to do. http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-December/046136.html