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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,5de22b900620079e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-24 03:10:11 PST Message-ID: <3D3E7ADA.CCC6376D@sympatico.ca> From: David Marceau X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.17-10mdksmp i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Nvidia , Cg, and Ada? References: <9is%8.145993$uw.90583@rwcrnsc51.ops.asp.att.net> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Wed, 24 Jul 2002 06:00:58 -0400 NNTP-Posting-Host: 65.92.162.175 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1027505312 65.92.162.175 (Wed, 24 Jul 2002 06:08:32 EDT) NNTP-Posting-Date: Wed, 24 Jul 2002 06:08:32 EDT Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:27358 Date: 2002-07-24T06:00:58-04:00 List-Id: Caffeine Junky wrote: > > Recently Nvidia announced that they'll be releasing thier CG compiler > under a very liberal license. > > I was curious if anyone had considered doing an Ada/Cg API, or if one > could achieve somewhat the same functionality using Interfaces.C > > Graphics programming will probably be my next step after I get a handle > on some of the other stuff in the Ada world. > > http://www.nvidia.com/view.asp?IO=IO_20020719_7269 > > Just curious. > > St4pL3 You got me curious too so I downloaded all their so-called open source stuff. I looked very briefly at the docs and sources for Cg, Glx and kernel. 1)Cg seems to be a complete compiler which if I understood correctly generates .o files which link in with the rest of an executable. 2)The contents of cg generated .o files hold low-level GPU instruction set specific code. 3)If I understood correctly, the low-level GPU instruction set is not documented anywhere in either the cg, glx or kernel sources. I didn't ask for these but someone out in ada land should ask NVIDIA for this. 4)Some alternatives for ada compiler compatibility I believe: a)have the ada compiler generate the low-level GPU instruction set � la inline-assembler if GPU instruction set documentation was made public. b)like you suggested create a thin-binding for the types and services cg provides however this limits the target to host platforms supported by the cg compiler. Personally I find it weird that a graphics card manufacturer is providing a compiler. We've got precompilers for databases, graphics cards and soon for coffee cups :) c)buy another kind of graphics card/another faster CPU/another CPU for your SMP box. This way you don't have to use this cg compiler without a performance loss. I would prefer alternative a) and let the ada/c/c++ compiler vendors generate the appropriate GPU instruction set and possibly have the ada compiler vendors provide an Interfaces.cg along with possibly pragma import(cg,...) but hey what do I know? If push came to shove I gather someone would generate small .cg files with one instruction in them and then examine the contents of the object file or look at the assembler in the gdb :) It reminds me what I think the ming sdk guys are doing to reverse-engineer .swf files in order to create .swf flash player files without using a GUI tool :) I understand recently someone mentioned F22 uses NVIDIA GPUs along with being written in ada. This means the binding you want probably has already been written however not for the general public. If you work for defense you might have a chance to ask for it. You can't have what you don't ask for :) Cheers, David Marceau