From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c08aa0f01f894da6 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!gv8g2000vbb.googlegroups.com!not-for-mail From: Gene Newsgroups: comp.lang.ada Subject: Re: GPUs and CUDA Date: Tue, 12 Jul 2011 11:53:44 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4dc22324-ddea-4f3b-b51a-ce42ff93dd43@gv8g2000vbb.googlegroups.com> References: <783efc18-a581-4ae2-bde4-04afa3568ff8@glegroupsg2000goo.googlegroups.com> <4e1c2153$0$2581$703f8584@news.kpn.nl> NNTP-Posting-Host: 74.39.171.53 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1310497604 8399 127.0.0.1 (12 Jul 2011 19:06:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 12 Jul 2011 19:06:44 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: gv8g2000vbb.googlegroups.com; posting-host=74.39.171.53; posting-account=-BkjswoAAACC3NU8b6V8c50JQ2JBOs04 User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: ARLUEHNKC X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; HPNTDF; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20184 Date: 2011-07-12T11:53:44-07:00 List-Id: On Jul 12, 6:26=A0am, "ldries46" wrote: > |"Rego, P." =A0schreef in berichtnews:783efc18-a581-4ae2-bde4-04afa3568ff= 8@glegroupsg2000goo.googlegroups.com... > | > |>This would allow something like > |> Pragma CUDA( Ralph ); > |>to indicate that the subprogram "Ralph" is to be run on the GPUs; and > |>it would also allow non-CUDA enabled compilers to compile the source > |>regardless of whether or not their compiler actually knows about CUDA. > | > |That's the idea. It would be very good. > > At this moment I don't know if this is a good idea, because CUDA is a > language developped only for NVidia GPU's. One of the purposes of Ada I > think is that a program can always be used on another computer with only = the > a simple recompilation. I would like a Pragma GPU( Ralph ) that can check > which GPU is used and if that GPU has a CUDA like environment available. > > L. Dries Indeed, GPUs are highly specialized processors that excel mostly at certain kinds of floating point computations with limited branching behaviors. Compiler tricks to find good mappings for general code onto GPUs are very much a current topic of research. Nvidia's CUDA implementation relies on language extensions to C and Fortran buit into GCC. I don't think it would be useful or even possible to map GPU-style threads into Ada tasks. So getting access to CUDA primitives from Ada looks like a tough problem, certainly more than adding a Pragma and tweaking the GNAT code generator. On the other hand, there are many numerical libraries already rewritten and tuned to exploit CUDA. Ada bindings for these would be very useful and straingthforwrd to build.