
Ich verstehs nicht wieso ich keine Motivation mehr habe.
Ich versuchs schon seit ein paar Jahren, vielleicht hauts ja jetzt irgendwann hin mit der Motivation, aber ich glaube eher nicht.Norbie hat geschrieben:such Motivation!
Code: Alles auswählen
dataA + dataB
Code: Alles auswählen
vec3 calc(int startOffset) {
vec3 result;
vec3 dataA;
vec3 dataB;
dataA = getData(0, startOffset);
dataB = getData(1, startOffset);
// Und nun die Formel 3 mal einfügen (Weil ja 3 Floats gleichzeitig verarbeitet werden sollen):
result.x = dataA.x + dataB.x;
result.y = dataA.y + dataB.y;
result.z = dataA.z + dataB.z;
return result;
}
Code: Alles auswählen
result = dataA + dataB;
Schaut doch schon viel besser ausInitializing
Allocating some memory
Loading the dataset into the GPU
Binding the code
Calculating
Time needed for GPU Calculation (5000 times): 281ms
Dataset A: 0.000 0.100 0.200 0.300 0.400 0.500 [...]
Dataset B: 0.100 0.100 0.100 0.100 0.100 0.100 [...]
--------------------------------------------------------------------------------
Dataset R: 0.000 0.004 0.017 0.045 0.096 0.178 [...]
Time needed for CPU Calculation (5000 times): 3188ms
Dataset A: 0.000 0.100 0.200 0.300 0.400 0.500 [...]
Dataset B: 0.100 0.100 0.100 0.100 0.100 0.100 [...]
--------------------------------------------------------------------------------
Dataset R: 0.000 0.004 0.017 0.045 0.096 0.178 [...]
Both result-buffers are equal (Maximum tolerance between floats: 0.0000010000.
We must use this, because of different algorithms for square roots and power
of functions).
Press any key to release all data and to exit.
Allocating some memory
Loading the dataset into the GPU
Binding the code
Calculating
Time needed for GPU Calculation (5000 times): 1341ms
Dataset A: 0.000 0.100 0.200 0.300 0.400 0.500 [...]
Dataset B: 0.100 0.100 0.100 0.100 0.100 0.100 [...]
--------------------------------------------------------------------------------
Dataset R: 0.000 0.004 0.017 0.045 0.096 0.178 [...]
Time needed for CPU Calculation (5000 times): 6381ms
Dataset A: 0.000 0.100 0.200 0.300 0.400 0.500 [...]
Dataset B: 0.100 0.100 0.100 0.100 0.100 0.100 [...]
--------------------------------------------------------------------------------
Dataset R: 0.000 0.004 0.017 0.045 0.096 0.178 [...]
Both result-buffers are equal (Maximum tolerance between floats: 0.0000010000. W
e must use this, because of different algorithms for square roots and power of f
unctions).