Jump to content

C++ Accelerated Massive Parallelism


Atton

Recommended Posts

Accelerated Massive Parallelism or AMP is a tool that allows you to use the GPU to perform mathematical operations on the GPU. From what I know the GPU is simply much better at doing this. Its standard in VS2012 and may even work with linux OpenGL, below is an example of simple addition. I would suggest consideration of this technology as it might be helpful with certain operations.

https://en.wikipedia.org/wiki/C%2B%2B_AMP

void CppAmpMethod()  
{ 
    const int size = 5; 
    int aCPP[] = {1, 2, 3, 4, 5}; 
    int bCPP[] = {6, 7, 8, 9, 10}; 
    int sumCPP[size]; 
     
    // Create C++ AMP objects. 
    array_view<const int, 1> a(size, aCPP); 
    array_view<const int, 1> b(size, bCPP); 
    array_view<int, 1> sum(size, sumCPP); 
     
     
    sum.discard_data(); 
        parallel_for_each( sum.extent,[=](index<1> idx) restrict(amp) 
        { 
            sum[idx] = a[idx] + b[idx];  
        } 
        ); 
    // Print the results. The expected output is "7, 9, 11, 13, 15". 
    for (int i = 0; i < size; i++) { 
        std::cout << sum[i] << "\n"; 
    } 
} 
  

Also this video might be interesting.

Link to comment

Using such systems in MTA would not improve the performance significantly as GTA:SA is the main bottleneck here and since GTA:SA is single-threaded by design, it's a very difficult task to change that at assembly level.

Also, another question is if it's really worth the effort. Systems that have powerful GPUs (or vector processors) are able to run MTA/GTA at the FPS maximum anyway and I guess the overhead on older systems (that probably use onboard graphics as well) is much higher than the actual theoretical performance improvement so that it may even run worse on these systems.

Link to comment
Using such systems in MTA would not improve the performance significantly as GTA:SA is the main bottleneck here and since GTA:SA is single-threaded by design, it's a very difficult task to change that at assembly level.

Also, another question is if it's really worth the effort. Systems that have powerful GPUs (or vector processors) are able to run MTA/GTA at the FPS maximum anyway and I guess the overhead on older systems (that probably use onboard graphics as well) is much higher than the actual theoretical performance improvement so that it may even run worse on these systems.

In many cases with older systems it would not run at all.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...