mankind is for enlightenment ...

I am, Nafee Mostafa Sadh, blogging about the ever refreshing earth, my land Bangladesh, my culture Bangaliyana, my lifestyle Islam and about literature, esthetics, history, heritage, fashion, about science, engineering, technology, electronics, information, networking, computing, programming and also about a lot more topics. But it is more about insight and idea which make people human.

Tuesday, April 7, 2009

Sadh's Talk on GPU Computing

Graphics processing units - powerful, programmable, and highly parallel - are increasingly targeting general-purpose computing applications. GPU Computing - J. D. Owens, M. Houston, D. Luebke, S. Green, J. E. Stone, and J. C. Phillips

What is GPU Computing?

GPU for General Purpose Computing

The idea of GPU Computing

GPU computing is the use of a GPU to do general purpose scientific and engineering computing

· The model is to use a CPU and GPU together in a heterogeneous computing model.

· The sequential part of the application runs on the CPU and the computationally-intensive part runs on the GPU.

· From the user’s perspective, the application just runs faster because it is using the high-performance of the GPU to boost performance.

Why GPU Computing…

Over the past few years, the GPU has evolved from a fixed-function special-purpose processor into a full-fledged parallel programmable processor with additional fixed-function special-purpose functionality

GPU for Non-Graphic Apps

The GPU is designed for a particular class of applications with the following characteristics,

· Computational requirements are large

· Parallelism is substantial

· Throughput is more important than latency

A growing community has identified other applications with similar characteristics and successfully mapped these applications onto the GPU

GPU extends its hand towards CPU for performance

· Parallelism is the future of computing

· Many programs have to process huge set of data following same functions

· Several stream processors can execute same set of instructions on different data sets and give a higher throughput

If GPU take some share of computation load from CPU, many applications can be benefitted in speed-up

GPU Architecture and Evolution

GPU is now turned into a programmable engine

GPU Pipeline

  • Input of Geometric Primitives
  • Vertex Operations
  • Primitive Assembly
  • Rasterization
  • Frament Operation
  • Composition
  • Screen Output

Evolution…

Fixed Function Pipeline : lack of generality
More fully featured instruction set
Unified Shader Model
Increased Program-mability
Program-mable engine surrounded by supporting fixed function units

GPU Computing Model

All GPU programs must be structured in this way: many parallel elements, each processed in parallel by a single program

Computing on the GPU

Programming a GPU for Graphics

1. programmer specifies geometry covering a screen region; rasterizer generates a fragment at each pixel location

2. Each fragment is shaded by the fragment program (FP).

3. FP computes the fragment by a combination of math operations and global memory reads

4. Resulting image can be used as texture on future passes.

Programming a GPU for General-Purpose Programs (Old)

1. programmer specifies geometric primitive covering computation domain of interest; rasterizer generates fragment

2. Each fragment is shaded by an SPMD general purpose FP

3. FP computes the fragment by a combination of math operations and ‘gather’ accesses from global memory.

4. Resulting buffer can be used as an input on future passes.

Programming a GPU for General-Purpose Programs (New)

1. programmer directly defines the computation domain of interest as a structured grid of threads

2. SPMD general-purpose program computes each thread

3. each thread is computed by a combination of math operations and both ‘gather’ (read) accesses from and ‘scatter’ (write) accesses to global memory; (same buffer can be used for both allowing more flexible algorithms)

4. resulting buffer in global memory can then be used as an input in future computation

Software Environments

· BrookGPU

· Microsoft’s Accelerator

· Vendor Specific GPGPU systems

o AMD ATI’s CTM (Close to the Metal)

o NVIDIA’s CUDA (Compute Unified Device Architecture)

Scan performance on CPU, OpenGL and CUDA

Scan performance on CPU, graphics-based GPU (using OpenGL), and direct-compute GPU (using CUDA). Results obtained on a GeForce 8800 GTX GPU and Intel Core2-Duo Extreme 2.93 GHz CPU.

(Figure adapted from Harris et al.)

Future…

· support for double-precision floating-point

· higher bandwidth path between CPU and GPU (like ATI’s HyperTransport)

· more tightly coupled CPU and GPU (AMD’s fusion or nVidia nForce)

· NVIDIA Quadro for Multiple GPU Collaboration

Finally, let us wait for new era when GPU Computing will rule

Thank You

it must be noted that, this blog is generated from a presentation slide, originally created for the first seminar of the course "Seminar" as an UG student at Dept of Computer Science and Engineering of Khulna Univ of Engg and Tech (KUET)

Saturday, June 7, 2008

Sadh’s Intro to Java

Java, the buzzword of modern computer technology, is no less familiar to all; even though I place this document here to represent some useful data about Java. Java, at above, is a platform. It is also a programming language. However, I like to call it a tool for the people working in the field of Computer. It is with its wide variety of options and diverse power of designing has brought about a revolution in modern civilization. Java can do anything! You can imagine of the gene of `Aladdin’ which can do a diverse job. Java is not the jack but the master of, o Programming o Software development o Web designing o Web applications o Graphics o Hardware interfacing Moreover, anything you may relate to computer industry. Many electronics and hardware companies produce API for java to drive their devices. Many web designers have been designing pages and web applications in Java. Most of the cell phone manufacuring companies try to integrate Java support in their mobile phone sets. Modern communication system largely depends on Java technology. Above all many software companies now totally rely on Java. Google's project ANDROID is also focused at Java.( Android is a platform which provide both Mobile OS and application running on it. But Android as an OS support applications built with only java and their official supported IDE is eclipse and their SDK is plugged-in with eclipse.) In this document, I will mainly try to show some path to learn Java. Java and Object Oriented Programming Java, as a programming language, is ideally object oriented. Object oriented technology is the best way of writting large-scale programs and managing real life applications. Any modern development methodology orients with objects. In the initial stage of programming people just liked to write some code to do some very simple tasks like calculating or so. However, with the advance of computer people started to think of diverse use of computer. From word processing to system analysis - computer is the most useful tool. Even though hardware developed widely, a good method of managing programs was not developed suddenly. Therefore, the programmers started to think of a system of managing software development in an easier way. Actually, any technology must have a system to track its own development. Software developers realized that, they have to waste many time writing same codes for several different programs.`Object oriented programming’ (often abbreviated OOP) came with the solution. OOP taught people to encapsulate codes. It means that a part of a program’s code should be altogether within itself; codes of other part must not know how it acts but know what it does. The real life idea of object is the idea here. In the real life, we see many objects (e.g. bird, book, car etc). We know what they do but do not know how they do. In managing, a big program, which has different operations and parts it is useful to segment it in different modules or objects. OOP does this and hence it is called modular programming. OOP helps us in many ways,
  • OOP gives modularity. Therefore, we need not to redesign a whole program but may improve just a part of it.
  • We may use codes designed for a program in other programs with slight or even with no modification.
  • We can think of systems easily in more human like method than a machine like method.
  • We can find and solve the bottlenecks easily with OOP.
  • OOP provides reusability. You may not pass a long time with a code for re-inventing same track.
  • We can use well-tested and highly debugged codes of others for trusted development.
  • OOP facilitates the distribution of a development project amongst the members of a team of programmers.
  • OOP helps maintaining version and easy upgrade of software. It also gives the opportunity to add further features with a software even after a long period of its release.

Last but not the least; OOP has given the fuel to drive the industry of software development. As I mentioned earlier Java is a complete solution to meet the challenge of OOP. There is hardly any feature demanded by OOP but not provided by Java.

the Java Platform Java is not only a programming language but also a platform. Any Java program runs on Java platform called “Java Runtime Environment” (abbreviated JRE) that works on any OS (Operating System) platform (including Win32, UNIX, Linux, MacOS and Solaris). Therefore, Java at last made the long cherished dream of programmers of achieving platform independence come true. You may write, develop and test a Java program in Windows environment and will find it running correctly in a Linux platform or an Apple Macintosh machine. The only requirement is that all the platforms have the JRE installed. So, why a programmer will not dive into the world of Java? Entering the world of Java If one wants to learn Java, he must learn two things: the language and the platform. To develop and debug a Java application you simply need the Java Development Kit (JDK) and a simple text editor.

However, it is not the day of just using the least facility. Now there are many text editors specially designed for Java. Nevertheless, there are many editors, which provide automatic code completion hints and dynamic documentation; you need not to cram the huge library of classes and methods – just have an idea about them and it will do a great deal. There are many text editors for coding in, but all of them use the same compiler – JDK. JDK actually stands for JavaSE Development Kit. JavaSE is the abbreviation of “Java Standard Edition”. From the days after the development of Java, its wide variety of APIs and diverse usability demanded the division of Java platform. Java platform is now parted in three editions:-- 1. JavaSE, Java Standard Edition 2. JavaME, Java Mobile Edition 3. JavaEE, Java Enterprise Edition Each of the three editions has its own field of work.

JavaSE deals with general purpose applications to run in PCs.

JavaME makes the applications for mobile devices and other small electronics.

J2EE manages workstations and large-scale applications.

Downloading and Installing JDK To be a Java programmer one must always be checking its official website http://java.sun.com/

Other important links are:

http://developers.sun.com/downloads/

http://java.sun.com/javase/downloads/

http://java.sun.com/developer/onlineTraining/

DOWNLOAD JDK

You may need to install JDK on your computer if you like to program in Java. JDK is a freeware and latest version and updates of it is available at http://java.sun.com/javase/downloads/.

Select the appropriate distribution of JDK for your system. There are different JDKs for Windows, UNIX, Linux, Solaris and MacOSX.

Install in Windows If you are running Windows, just download the JDK using a good download manager and run the single installation application. It will install java on your computer in the default location “C:\Program Files\Java\jdk1.6.0” or any location you show. (I always prefer the default location). Setting the Path variable (optional for windows) Next, you may update the environment variable “Path” if you like to use the java compiler from the command prompt. Follow instructions:-- · Go to : My Computer >> Properties >>Advanced >> Environment Variables · Select variable Path · Click on Edit button · Place cursor in the text field Variable Value and stroke the home key to go at the start · Add the directory of JDK bin folder (e.g. C:\Program Files\Java\jdk1.6.0\bin ;) You may skip this step if you do not need to use the command prompt.

Install in Linux

If you are running any Linux distribution, you may install it from a bin file downloaded from the specified site.

Java and class files Java codes are stored in .java files. After compiling, it will create a .class file; i.e. if you compile YourFile.java with java compiler, the compiler will create YourFile.class file. If YourFIle.java has a main method then you may run it from YourFile.class. You may use the command > java YourFile from you command line (cmd or terminal) to run the program. Java programs are stored in .jar files, which are said to be the java executable files. Using an Editor There are many editors. I am going to place note about some. JCreator V3 JCreator version 3 is a very simple editor. It is just a simple text editor like “Notepad” but it has some tool buttons. You may open any .java file with this editor just by double-clicking on the file. Then you may edit or compile the file. You can also run program by using it if it has main method. However, it will not create .jar file for you.

eclipse Eclipse is one of the popular java editors. Fedora and many other Linux distributions have it as optional application. (I wonder why Fedora 7 has left it away! Although, Fedora 8 brought it back). However, eclipse provides good project management and tools; it has its own workbench and a cool welcome screen. It also shows dynamic help and code completion hints. It is downloadable from http://www.eclipse.org/

NetBeans IDE It is my favorite editor. The latest release NetBeans IDE 6.1 is very cool and slick. Any coder can easily become “used to” with it. Its official site is http://www.netbeans.org/

It can be downloaded from http://download.netbeans.org/netbeans/6.1/final/. You must choose a platform (Windows, Linux …),Language (English,Portuguese) and a setup (from 7: All,Java SE, Web and Java EE, Mobility). The full download meets NetBeans slogan “the only IDE you will ever need”. Nevertheless, the basic will do a good deal and many will even never use all facilities of even the standard installation. Also, keep in mind that the more options you use the more memory and speed you require. A free DVD is available from http://www.netbeans.org/about/media.html .It includes NetBeans along with JDK, tutorials,documents, trails and a huge stock of stuffs full-filling your every need.

http://www.netbeans.org/kb/ provide tutorials on the IDE and you may find lot of help from it. Never mind to get helps. [ N.B.: 6 months from the  publication of this blog, NetBeans 6.5 has been released. please look for a comment below ] Books and Tutorials JAVA how to program by Deitel & Deitel You can start learning Java with this book. This book describes every idea relating Java from the ground and one can easily acquire good knowledge from it. Even though this huge book may turn into a boring piece, just turning on its pages will help you a lot. Try to pick up information from this book and read its highlighted tips, hints and observations. These are very helpful in developing your concepts. Try to get its latest edition. (I know about the sixth edition).

JAVA Complete Reference by Herbert Schildt (7th edition) This is a handy book and any professional may like to keep this book on his/her desk. It is most complete reference one may need.

Tutorial from Sun A tutorial, prepared by Sun, is available at: http://java.sun.com/docs/books/tutorialNB/download/tutorial.zip

Downloadand unzip it. Browse the tutorial using the html file index.html or reallybigindex.html ; this tutorial is the best I found. And I suggest anyone to use this tutorial rather than any book if s/he wants to be an efficient Java developer without wasting his/her time. Use the tutorials and demos from your editor Editors like NetBeans IDE and eclipse provide own demo and documentations, which are very helpful for being "used-to" with that IDE and quickly acquiring the language JAVA. Last but not the least, I must say

develop the habit of browsing and surfing

[this blog is written with the essence of my slide titled "Java Platform : What are we targetting at"]

Let me end this blog by wishing you icy cool greeetings...

Friday, June 6, 2008

Getting into this blog spot and a little more...

I am, Nafee Mostafa Sadh, starting to blog about the ever refreshing earth, my land Bangladesh, my culture Bangaliyana, my lifestyle Islam and about literature, esthetics, history, heritage, fashion, about science, engineering, technology, electronics, information, networking, computing, programming and also about a lot more subjects. But it is more about insight and idea which make people human. I am now an undergraduate student of Computer Science and Engineering and living in Bangladesh. So, obviously i will blog more about computer than anything else.