4 Replies Latest reply on Jun 6, 2011 3:02 PM by jiapei100

    Entry-level questions on some term relationships?

    jiapei100

       

       

       

      Hi, all:

       

      A very entry-level question:

       

      1) What is the relationship between CG and CUDA?

      2) What is the relationship between GPU and OpenCL?

      3) What is the relationship between OpenCL and OpenGL?

      4) What is ATI Stream SDK for? Is it corresponding to NVidia's CUDA?

       

      Sorry, so many fundamental questions. Expecting your detailed explanation.

       

      Best Regards

      Pei



        • Entry-level questions on some term relationships?
          bubu

          >1) What is the relationship between CG and CUDA?

          I assume GC = MacOSX's Grand Central Dispatch.

          GC is just a multithreaded CPU library, like TBB or OpenMP.

          CUDA is a massively parallel library for NVIDIA's GPUs.

           

           

          >2) What is the relationship between GPU and OpenCL?

          OpenCL can use the massively parallel architecture of the GPUs but also can utilize the CPU. Who will win in terms of performance heavily depends on your algorithms and optimizations.

           

           

          >3) What is the relationship between OpenCL and OpenGL?

          OpenGL is a graphics API, OpenCL is a GPGPU API. OpenCL can access OpenGL textures, images and buffers ( aka "GL interop" ).

           

           

          >4) What is ATI Stream SDK for? Is it corresponding to NVidia's CUDA?

          Originally, the Stream SDK was a close-to-metal low-level API. Then evolved into the more high-level and standarized OpenCL implementation from AMD called "AMD APP SDK". So yep, it's more or less the AMD's version of CUDA, although CUDA has more features currently ( like C++ support, etc... )

           

           

            • Entry-level questions on some term relationships?
              jiapei100

              Hi, bubu:

              First, thank you so much for your very kind and detailed explanation. I'm now much much much clearer than before. Thank you again !!

               

              Originally posted by: bubu >1) What is the relationship between CG and CUDA?

               

              I assume GC = MacOSX's Grand Central Dispatch.

               

              GC is just a multithreaded CPU library, like TBB or OpenMP.

               

              CUDA is a massively parallel library for NVIDIA's GPUs.

               

              CG can be found at http://developer.nvidia.com/cg-toolkit 

              Cuda can be found at http://developer.nvidia.com/cuda-toolkit-40

              it's CG, rather than GC. 

              By the way, I'd love to ask, does CG only work for NVidia, but not work for ATI video card?

               

               

               

               

              >2) What is the relationship between GPU and OpenCL?

               

              OpenCL can use the massively parallel architecture of the GPUs but also can utilize the CPU. Who will win in terms of performance heavily depends on your algorithms and optimizations. 

               

              >3) What is the relationship between OpenCL and OpenGL?

               

              OpenGL is a graphics API, OpenCL is a GPGPU API. OpenCL can access OpenGL textures, images and buffers ( aka "GL interop" ).

               

              Thank you so much. !!  I think 2) and 3) are clearly answered !!! 

               

               

               

               

               

              >4) What is ATI Stream SDK for? Is it corresponding to NVidia's CUDA?

               

              Originally, the Stream SDK was a close-to-metal low-level API. Then evolved into the more high-level and standarized OpenCL implementation from AMD called "AMD APP SDK". So yep, it's more or less the AMD's version of CUDA, although CUDA has more features currently ( like C++ support, etc... )



               

               

              Do you mean, current AMD APP SDK is still C support, instead of C++ support??

               

              Thanks again.

              Pei

               

               

               

                • Entry-level questions on some term relationships?
                  bubu

                  Cg was the inception of DirectX's HLSL ( high-level shading language ) or OpenCL's GLSL. Originally DirectX's shaders were coded using a kind of assembly instructions like add, sub, mul and registers. Then NVIDIA thought shaders would be much easier to code using a higher-level language with some build-in structures like float4 and a syntax closer to the C language. That's why its name "C for graphics".

                  Cg may work with ATI cards, but you'll need to use some tricks. Better use an NVIDIA card because it's an NVIDIA-propietary API so ... you know...

                   

                   

                  Do you mean, current AMD APP SDK is still C support, instead of C++ support??


                  The current OpenCL spec 1.1 does not support C++ ( templates, polymorphism, STL, etc... ) and neither dynamic memory allocation ( malloc/free/new/delete ) inside the kernel. CUDA 4 supports all that and much more ... but it's NVIDIA-only