Hi, Tom, <div><br></div><div>now i want to try out the new features of gallium/clover. I notice you have updated your wiki page for installation. with your new instruction, i can not build clang any more :(</div><div><br>
</div><div>xliu@xliu-desktop:~/Development/llvm-tstellar/tools/clang$ make</div><div>make[1]: Entering directory `/home/xliu/Development/llvm-tstellar/tools/clang/utils/TableGen'</div><div>llvm[1]: Compiling ClangDiagnosticsEmitter.cpp for Debug+Asserts build</div>
<div>ClangDiagnosticsEmitter.cpp:398:9: error: use of undeclared identifier 'PrintFatalError'; did you mean 'PrintError'?</div><div> PrintFatalError(R.getLoc(), "Error " + R.getName() +</div>
<div> ^~~~~~~~~~~~~~~</div><div> PrintError</div><div>/home/xliu/Development/llvm-tstellar/include/llvm/TableGen/Error.h:38:6: note: 'PrintError' declared here</div><div>void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);</div>
<div> ^</div><div>ClangDiagnosticsEmitter.cpp:398:37: error: no viable conversion from 'basic_string<char, std::char_traits<char>, std::allocator<char> >' to 'const llvm::Twine'</div>
<div> PrintFatalError(R.getLoc(), "Error " + R.getName() +</div><div> ^~~~~~~~~~~~~~~~~~~~~~~~</div><div>/home/xliu/Development/llvm-tstellar/include/llvm/TableGen/Error.h:38:56: note: passing argument to parameter 'Msg' here</div>
<div>void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);</div><div> ^</div><div>ClangDiagnosticsEmitter.cpp:560:7: error: use of undeclared identifier 'PrintFatalError'; did you mean 'PrintError'?</div>
<div> PrintFatalError("Invalid character in diagnostic group '" +</div><div> ^~~~~~~~~~~~~~~</div><div> PrintError</div><div>/home/xliu/Development/llvm-tstellar/include/llvm/TableGen/Error.h:38:6: note: 'PrintError' declared here</div>
<div>void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);</div><div> ^</div><div>ClangDiagnosticsEmitter.cpp:561:37: error: too few arguments to function call, expected 2, have 1</div><div> I->first + "'");</div>
<div> ^</div><div>/home/xliu/Development/llvm-tstellar/include/llvm/TableGen/Error.h:38:1: note: 'PrintError' declared here</div><div>void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);</div>
<div>^</div><div>4 errors generated.</div><div>make[1]: *** [/home/xliu/Development/llvm-tstellar/tools/clang/utils/TableGen/Debug+Asserts/ClangDiagnosticsEmitter.o] Error 1</div><div>make[1]: Leaving directory `/home/xliu/Development/llvm-tstellar/tools/clang/utils/TableGen'</div>
<div>make: *** [all] Error 1</div><div><br></div><div><br></div><div><br></div><div>here is my clang version. i think that it is the latest version. is there anything mismatching or clang 's new checkin is broken? </div>
<div><br></div><div>xliu@xliu-desktop:~/Development/llvm-tstellar/tools/clang$ git log</div><div>commit a6600a339fee660cac2bd9b04cf578fa47ed491d</div><div>Author: Nico Weber <<a href="mailto:nicolasweber@gmx.de">nicolasweber@gmx.de</a>></div>
<div>Date: Sun Nov 11 01:35:05 2012 +0000</div><div><br></div><div> FileCheckize test</div><div> </div><div> git-svn-id: <a href="https://llvm.org/svn/llvm-project/cfe/trunk@167680">https://llvm.org/svn/llvm-project/cfe/trunk@167680</a> 91177308-0d34-0410-b5e6-96231b3b80d8</div>
<div> </div><div><br></div><div>thanks,</div><div>--lx</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Tue, Oct 9, 2012 at 9:44 PM, Tom Stellard <span dir="ltr"><<a href="mailto:tom@stellard.net" target="_blank">tom@stellard.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Oct 05, 2012 at 10:24:00PM +0800, Liu Xin wrote:<br>
> Hi, Tom,<br>
><br>
</div><div class="im">> thanks for your kind guidance. within a daunting day, we have made clover<br>
> work on our APU platform. for your information, we are running on ubuntu<br>
> 12-04, i386.<br>
><br>
> out of curiosity, r600 driver relies on the newest llvm API, see llvm 3.2.<br>
> is it stable? we know LLVM is a fast moving project and their APIs are<br>
> subject to change year by year. I assume you are working tightly to llvm<br>
> 3.2 because AMD backend will merge to trunk, right? we ask this question<br>
> because android-x86 can not support up-to-date llvm. it only has llvm 2.8<br>
> now. we may port a certain version of llvm to satisfy with android and<br>
> mesa.<br>
><br>
<br>
</div>The version of the backend included in the Mesa tree will work with LLVM 3.1, but<br>
I don't expect much more development to happen on this version, so it<br>
is recommended that you upgrade to LLVM 3.2<br>
<br>
LLVM 3.2 is not stable yet, but it will be in a month or two. I would<br>
like to get the backend merged into the LLVM tree prior to the 3.2<br>
release, but it's uncertain whether or not this will happen.<br>
<div class="HOEnZb"><div class="h5"><br>
-Tom<br>
<br>
> thanks,<br>
> --lx<br>
><br>
><br>
> On Thu, Oct 4, 2012 at 11:04 PM, Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>> wrote:<br>
><br>
> > On Thu, Oct 4, 2012 at 10:53 AM, Tom Stellard <<a href="mailto:tom@stellard.net">tom@stellard.net</a>> wrote:<br>
> > > On Thu, Oct 04, 2012 at 10:42:45PM +0800, Liu Xin wrote:<br>
> > >> Hi, Tom,<br>
> > >><br>
> > >> thank you for your instant response. we decide to try clover for r600.<br>
> > it<br>
> > >> should work on ubuntu(11.10), right?<br>
> > >> have you refined tgsi compiler for r600?<br>
> > >><br>
> > ><br>
> > > Build instructions for clover + r600g are here:<br>
> > > <a href="http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install" target="_blank">http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install</a><br>
> > > these should work on most any distro.<br>
> > ><br>
> > > We are in the process of transitioning from LLVM 3.2 to LLVM 3.1, so<br>
> > > these instructions may change in the near future.<br>
> ><br>
> > 3.1 to 3.2 ;)<br>
> ><br>
> > ><br>
> > > There are no plans to update the r600g tgsi compiler to handle TGSI<br>
> > > compute instructions. LLVM IR is the preferred IR for compute programs,<br>
> > > and it is well supported.<br>
> > ><br>
> > > -Tom<br>
> > ><br>
> > ><br>
> > >> thanks,<br>
> > >> --lx<br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >><br>
> > >> On Thu, Oct 4, 2012 at 9:42 PM, Tom Stellard <<a href="mailto:tom@stellard.net">tom@stellard.net</a>> wrote:<br>
> > >><br>
> > >> > On Wed, Oct 03, 2012 at 08:15:07PM +0800, Liu Xin wrote:<br>
> > >> > > Hi, Gallium Hackers,<br>
> > >> > ><br>
> > >> > > We are working on Gallium3D on android-x86, APU. We want to run<br>
> > general<br>
> > >> > > compute programs on r600 GPU, specifically, "Radeon HD6310(Evergreen<br>
> > >> > > family)".<br>
> > >> > ><br>
> > >> > > The first thing drawn our eyes are gallium/tests/trivial/compute.c<br>
> > >> > because<br>
> > >> > > it calls general compute APIs and attempts to execute tgsi programs<br>
> > on a<br>
> > >> > > back-end. unfortunately, we failed to execute it even we have<br>
> > >> > pipe_r600.so<br>
> > >> > > on android-x86. now we have a healthy android-x86 and it supports<br>
> > opengl<br>
> > >> > > well. further, we can run tri.c under tests/trivial/ directory as<br>
> > well.<br>
> > >> > ><br>
> > >> ><br>
> > >> > The gallium/tests/trivial/compute.c program won't work on r600g,<br>
> > because<br>
> > >> > the driver only supports compute programs written in LLVM IR and not<br>
> > >> > TGSI.<br>
> > >> ><br>
> > >> > There are some example OpenCL programs here:<br>
> > >> > <a href="http://cgit.freedesktop.org/~tstellar/opencl-example/" target="_blank">http://cgit.freedesktop.org/~tstellar/opencl-example/</a><br>
> > >> > that work with r600g. Make sure you build Mesa with the<br>
> > --enable-opencl<br>
> > >> > configure flag.<br>
> > >> ><br>
> > >> > If you don't want to use OpenCL and just want to play with the Gallium<br>
> > >> > compute interface, you can replace the TGSI program with LLVM IR.<br>
> > >> > You can use the LLVM C API builder interface to create a program (see:<br>
> > >> > <a href="http://llvm.org/docs/doxygen/html/Core_8h.html" target="_blank">http://llvm.org/docs/doxygen/html/Core_8h.html</a>) or you can write the<br>
> > >> > LLVM IR by hand and then parse it into LLVM bitcode (I think there<br>
> > are C<br>
> > >> > API functions that will do this too).<br>
> > >> ><br>
> > >> ><br>
> > >> > Hope this helps.<br>
> > >> ><br>
> > >> > -Tom<br>
> > >> > > let's take a simple example. can a kind person give us pointers?<br>
> > >> > > static void test_resource_access(struct context *ctx)<br>
> > >> > > {<br>
> > >> > > const char *src = "COMP\n"<br>
> > >> > > "DCL RES[0], BUFFER, RAW, WR\n"<br>
> > >> > > "DCL RES[1], 2D, RAW, WR\n"<br>
> > >> > > "DCL SV[0], BLOCK_ID[0]\n"<br>
> > >> > > "DCL TEMP[0], LOCAL\n"<br>
> > >> > > "DCL TEMP[1], LOCAL\n"<br>
> > >> > > "IMM UINT32 { 15, 0, 0, 0 }\n"<br>
> > >> > > "IMM UINT32 { 16, 1, 0, 0 }\n"<br>
> > >> > > "\n"<br>
> > >> > > " BGNSUB\n"<br>
> > >> > > " UADD TEMP[0].x, SV[0].xxxx, SV[0].yyyy\n"<br>
> > >> > > " AND TEMP[0].x, TEMP[0], IMM[0]\n"<br>
> > >> > > " UMUL TEMP[0].x, TEMP[0], IMM[1]\n"<br>
> > >> > > " LOAD TEMP[0].xyzw, RES[0], TEMP[0]\n"<br>
> > >> > > " UMUL TEMP[1], SV[0], IMM[1]\n"<br>
> > >> > > " STORE RES[1].xyzw, TEMP[1], TEMP[0]\n"<br>
> > >> > > " RET\n"<br>
> > >> > > " ENDSUB\n";<br>
> > >> > > void init0(void *p, int s, int x, int y) {<br>
> > >> > > *(float *)p = 8.0 - (float)x;<br>
> > >> > > }<br>
> > >> > > void init1(void *p, int s, int x, int y) {<br>
> > >> > > *(uint32_t *)p = 0xdeadbeef;<br>
> > >> > > }<br>
> > >> > > void expect(void *p, int s, int x, int y) {<br>
> > >> > > *(float *)p = 8.0 - (float)((x + 4*y) & 0x3f);<br>
> > >> > > }<br>
> > >> > ><br>
> > >> > > printf("- %s\n", __func__);<br>
> > >> > ><br>
> > >> > > init_prog(ctx, 0, 0, 0, src, NULL);<br>
> > >> > > init_tex(ctx, 0, PIPE_BUFFER, true, PIPE_FORMAT_R32_FLOAT,<br>
> > >> > > 256, 0, init0);<br>
> > >> > > init_tex(ctx, 1, PIPE_TEXTURE_2D, true,<br>
> > PIPE_FORMAT_R32_FLOAT,<br>
> > >> > > 60, 12, init1);<br>
> > >> > > init_compute_resources(ctx, (int []) { 0, 1, -1 });<br>
> > >> > > launch_grid(ctx, (uint []){1, 1, 1}, (uint []){15, 12, 1},<br>
> > 0,<br>
> > >> > NULL);<br>
> > >> > > check_tex(ctx, 1, expect, NULL);<br>
> > >> > > destroy_compute_resources(ctx);<br>
> > >> > > destroy_tex(ctx);<br>
> > >> > > destroy_prog(ctx);<br>
> > >> > > }<br>
> > >> > ><br>
> > >> > > for init_prog, here is the key functions:<br>
> > >> > > *tgsi_text_translate(psrc, prog, Elements(prog));<br>
> > >> > > what's the meaning for this API? the input is tgsi program, what's<br>
> > the<br>
> > >> > > output?<br>
> > >> > > in a nutshell, how can gallium translate tgsi to evergreen's ISA.<br>
> > >> > ><br>
> > >> > > *ctx->hwcs = pipe->create_compute_state(pipe, &cs);<br>
> > >> > > *pipe->bind_compute_state(pipe, ctx->hwcs);<br>
> > >> > > in evergreen_compute.c, it doesn't calloc kernels array and process<br>
> > >> > > cso->prog if HAVE_OPENCL is not set. should we set HAVE_OPENCL for<br>
> > >> > general<br>
> > >> > > compute?<br>
> > >> > ><br>
> > >> > > thanks,<br>
> > >> > > --lx<br>
> > >> ><br>
> > >> > > _______________________________________________<br>
> > >> > > mesa-dev mailing list<br>
> > >> > > <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> > >> > > <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
> > >> ><br>
> > >> ><br>
> > > _______________________________________________<br>
> > > mesa-dev mailing list<br>
> > > <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> > > <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
> ><br>
</div></div></blockquote></div><br></div>