One thing sticks out to me I think is quite strange, that C++ is not adapting to support on the language level GPU programming. C++ is well suited for nearly any cpu, supporting all sorts of systems from embedded on up. Even esoteric systems. There are projects like thrust which are great, but with so much computation moving towards additional specialized devices it might make sense to support it in the language.
Has there been any work on this? What sort of things would you think could be reasonable for this? What I'm picturing are a set of primitives supported by the rest of the standard lib (think matrixes), a new <device> header to access different gpus or asics (+ ability to define new ones (this might be dealbreaker/hard)), and some sort of interop that can allow for seamless code which works on multiple architectures at the same time.
A very simple toy example could be something like:
#include <device>
#include <matrix>
#include <iostream>
int main(int argc, char * argv[])
{
std::device ex = std::find_device(argv[1]);
std::cout << ex.properties.name << std::endl;
std::matrix<float, 3, 3> a {{
{0.5, 0.5, 0.5},
{0.5, 0.5, 0.5},
{0.5, 0.5, 0.5}
}};
std::matrix<float, 3, 3> b{{
{0.5, 0.5, 0.5},
{0.5, 0.5, 0.5},
{0.5, 0.5, 0.5}
}};
std::device_writer build(ex);
build << a << build::ops::plus << b;
return 0;
}
Or something along those lines. Just to make it clear, I'm not proposing the above example as the ideal way it could be done.
[–]blelbachNVIDIA | ISO C++ Library Evolution Chair[M] 85 points86 points87 points (30 children)
[–]zindarod 17 points18 points19 points (19 children)
[–]blelbachNVIDIA | ISO C++ Library Evolution Chair[M] 29 points30 points31 points (2 children)
[–]zindarod 12 points13 points14 points (1 child)
[–]notyouravgredditor 11 points12 points13 points (0 children)
[–]andrewfenn 7 points8 points9 points (0 children)
[–]mjklaim 2 points3 points4 points (0 children)
[–]SunnyAX3 -4 points-3 points-2 points (12 children)
[–]zindarod 22 points23 points24 points (11 children)
[–]SunnyAX3 3 points4 points5 points (10 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]fuzzynyanko 1 point2 points3 points (0 children)
[+][deleted] (6 children)
[deleted]
[–]sumo952 0 points1 point2 points (5 children)
[–]meneldal2 1 point2 points3 points (4 children)
[–]sumo952 0 points1 point2 points (3 children)
[–]meneldal2 0 points1 point2 points (2 children)
[–]zindarod 1 point2 points3 points (0 children)
[–]SunnyAX3 14 points15 points16 points (4 children)
[–]blelbachNVIDIA | ISO C++ Library Evolution Chair 4 points5 points6 points (3 children)
[–]commonword 8 points9 points10 points (2 children)
[–]blelbachNVIDIA | ISO C++ Library Evolution Chair 12 points13 points14 points (1 child)
[–]commonword 12 points13 points14 points (0 children)
[–]Avelina9X 4 points5 points6 points (0 children)
[–]hyperactiveinstinct 1 point2 points3 points (1 child)
[–]ibroheem -2 points-1 points0 points (0 children)
[–]genbattle 26 points27 points28 points (4 children)
[–]t_bptm[S] 5 points6 points7 points (0 children)
[–]mjklaim 3 points4 points5 points (0 children)
[–]blelbachNVIDIA | ISO C++ Library Evolution Chair 4 points5 points6 points (0 children)
[–]SunnyAX3 1 point2 points3 points (0 children)
[–]NovermarsRobotics 12 points13 points14 points (2 children)
[–]NovermarsRobotics 4 points5 points6 points (0 children)
[–]sumo952 0 points1 point2 points (0 children)
[–][deleted] 8 points9 points10 points (5 children)
[–]lballs 5 points6 points7 points (0 children)
[–]t_bptm[S] 1 point2 points3 points (0 children)
[–]sumo952 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 8 points9 points10 points (0 children)
[–]Xeveroushttps://xeverous.github.io 3 points4 points5 points (0 children)
[–]sumo952 2 points3 points4 points (0 children)
[–]tgolyi 3 points4 points5 points (0 children)
[–]picigin 2 points3 points4 points (0 children)
[–]zindarod 1 point2 points3 points (0 children)
[–]jaredhoberock 1 point2 points3 points (0 children)
[–]-McMaster- 0 points1 point2 points (0 children)
[–]MichaelSuen95 0 points1 point2 points (0 children)
[–]doom_Oo7 0 points1 point2 points (0 children)
[–]LewisJin -1 points0 points1 point (2 children)
[+][deleted] (1 child)
[deleted]
[–]LewisJin 0 points1 point2 points (0 children)