comp.lang.ada
 help / color / mirror / Atom feed
From: David Marceau <davidmarceau@sympatico.ca>
Subject: Re: Nvidia , Cg, and Ada?
Date: Wed, 24 Jul 2002 06:00:58 -0400
Date: 2002-07-24T06:00:58-04:00	[thread overview]
Message-ID: <3D3E7ADA.CCC6376D@sympatico.ca> (raw)
In-Reply-To: 9is%8.145993$uw.90583@rwcrnsc51.ops.asp.att.net

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



  reply	other threads:[~2002-07-24 10:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-24  7:02 Nvidia , Cg, and Ada? Caffeine Junky
2002-07-24 10:00 ` David Marceau [this message]
2002-07-24 20:04   ` Caffeine Junky
2002-08-23 11:10   ` Preben Randhol
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox