GPGPU performance in high-level languages [closed] - cuda

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
For my science fair project I have to write a computationally-intensive algorithm that is well suited to parallelization. I have read about OpenCL and CUDA and it seems they are mainly used from C/C++. While it would not be that difficult for me to pick up a bit of C to write a simple main, I was wondering how big the performance hit would be if I used Java or Python bindings for my GPU computation? Specifically, I was more interested in the performance hit using CUDA because that's the framework I'm planning on using.

In general, every time you add an abstraction layer you're loosing performance but, in the case of CUDA this is not completely true because, whether using Python or Java you'll end up writing your CUDA kernels on C/Fortran, so the performance in the GPU side will be the same as using C/Fortran (check some pyCUDA examples here)
The bad news it that Java and Python will never achieve the performance of compiled languages such as C on certain tasks, see this SO answer for a more detailed discussion about this topic. Here is a good discussion about C versus Java, also on SO.
There are many questions and discussions about performance comparison between interpreted and compiled languages, so I encourage you to read some of them.

Related

Platform vs Software Framework [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
CUDA advertises itself as a parallel computing platform. However, I'm having trouble seeing how it's any different from a software framework (a collection of libraries used for some functionality). I am using CUDA in class and all I'm seeing is that it provides libraries in C for - functions that help in parallel computing on the GPU - which fits my definition of a framework. So tell me, how is a platform like CUDA different from a framework? Thank you.
CUDA the hardware platform, is the actual GPU and its scheduler ("CUDA architecture"). However CUDA is also a programming language, which is very close to C. To work with the software written in CUDA you also need an API for calling these functions, allocating memory etc. from your host language. So CUDA is a platform, a language and a set of APIs.
If the latter (a set of APIs) matches your definition of a software framework, then the answer is simply yes, as both options are true.

Does the GameEngine you plan to use need to be written in the same language you are programming the game in? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
While my common sense says "Yeah. Duh.", I thought I read something somewhere long long ago that referenced the ability to use different programming languages in harmony and wondered if something like that applied here.
IE, if a game engine is written in C++, but the game I'm developing has been written in C#/XNA, can that game engine be utilized for this game?
Usually the language you use to write game engines aims for efficiency and speed. The language you use to write games aims for simplicity and expressiveness. So, it totally makes sense to use a different language for each purpose.
How they will work together is a different story. Usually, the engine's API will be given a convenient interface to be used in the game "scripting" language, so the latter will interact with the engine through successive API calls. The "heavy lifting" will be all done by the engine though...

Disadvantages of First-class functions [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Are there any disadvantages to having first class functions in a language?
Joel in this entry says
Object-oriented programming languages aren't completely convinced that
you should be allowed to do anything with functions.
I might be naïve here, but why don’t all languages support first class functions if there aren’t much issues
In an ideal world where there was never a cost associated with developing new features, the only downside I can see to including functional programming techniques would be confusion to developers who are not familiar with functional techniques (and I don't really see that as much of a downside).
In reality, treating functions as first-class typically requires significant rewrites to the compiler itself. The cost of doing this has to be weighed against the long-term gain.
Adding this feature might be a disadvantage if introducing the change requires a costly re-write of language compilers, interpreters, and other tools. It might also be a disadvantage if the language's culture is not familiar enough with the advantages provided by this feature in which case adding the feature is a waste of effort.
Additionally, first class functions require runtime interpretation of code and some form of garbage collection. Both of these add overhead that might not be suitable for certain problems and languages.

Getting started in Firmware development [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am a software development guy. Lately I was thinking of trying out some firmware development, as the company I work for is trying to enter that domain.
I have many questions regarding firmware devlopment - like:
What are the tools used - like IDE?
In which language is most of the code written in?
How to port the code into microcontroller?
How to code for different microcontrollers?
How to determine things I would need for building a specific application(choosing the microcontroller etc.)?
Anything else I should know about and where do I start? Sorry if this question is too basic, but I could not find out any satisfactory answers elsewhere.
Most microcontrollers have decent C compilers so are best coded for in C, although you might need to delve into assembly routines for occassional high performance routines. The choice of microcontroller is usually determined by the hardware demands, on board peripherals, performance and cost constraints.
You wouldn't generally be porting code from a Windows/Linux/Mac environment to a microcontroller one; you would generally be writing directly for the microcontroller, so strictly the compiler is a cross compiler - compiling on your PC to run on a different processor. You typically get debuggers, emulators and full editor capabilities in the IDE, so its a similar experience to writing code in a PC environment, but it runs slower, and has to be downloaded to the target hardware or emulated to be tested.
A great authority to start reading about embedded development is Jack Gansle and his firmware handbook. Also www.embedded.com for general articles.

How do you estimate a EAI project using Function point? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
How do you estimate a EAI project using Function point?
FP analysis is inappropriate for integration projects of any sort as it presupposes that you can specify the application up-front. Most of the work in any integration project of non-trivial complexity is reverse-engineering the nuances of the environment. Typically the environment will not be exhaustively documented in the sort of cases you would expect to use an EAI system in.
By the time you have actually done this level of reverse engineering to the point of having a complete specification you have done most of the work in the project - the actual development is fairly short and sweet by comparison. Therefore the function point analysis is only providing an estimate for a small part of the system.
As an aside, much of the work I do is data warehouse systems in Commercial insurance companies, where extensive prototyping and reconciliation exercises to produce detailed specification documents are actually quite appropriate to the environment. Typically this takes longer than actually developing the production system as most of the data issues are resolved in the prototyping work. EAI systems have a similar class of implementation issues.
Well given that FP counting is based on storage and end user interface, not sure if its even meaningful for EAI (from what little I remember).
I would say you can't, at least not in a useful way. FP counting is generally viewed as a dubious practice of varying accuracy, doing it to an integration project would just add more fuzzyness.