Commit f599b406d697eb67b5b44ce611d4efc015ddb054

Pientä viilausta
event-esimerkki/cuda.cu
(8 / 1)
  
111111 cudaEventElapsedTime(
112112 &globalToRamTime, globalToRamStart, globalToRamStop);
113113
114 float totalTime;
115 cudaEventElapsedTime(
116 &totalTime, ramToGlobalStart, globalToRamStop);
117
118
114119
115120 std::cout << "Siirto RAM -> Globaali muisti: " <<
116121 1.0E-3*ramToGlobalTime << " s" << std::endl;
123123 1.0E-3*kernelTime << " s" << std::endl;
124124 std::cout << "Siirto Globaali muisti -> RAM: " <<
125125 1.0E-3*globalToRamTime << " s" << std::endl;
126
126 std::cout << "Kokonaisaika: " <<
127 1.0e-3*totalTime << " s" << std::endl;
128
127129 cudaFree(deviceBuffer);
128130 cudaFreeHost(hostBuffer);
129131 cudaStreamDestroy(queue);
event-esimerkki/opencl.cpp
(2 / 2)
  
55#define __CL_ENABLE_EXCEPTIONS
66#include <CL/cl.hpp>
77
8#define N 74672162
8#define N 7467216
99
1010int main() {
1111
228228 1.0e-9*(kernelStop-kernelStart) << " s" << std::endl;
229229 std::cout << "Siirto Globaali muisti -> RAM: " <<
230230 1.0e-9*(globalToRamStop-globalMemoryToRamStart) << " s" << std::endl;
231 std::cout << "Kokonaisaika : " <<
231 std::cout << "Kokonaisaika: " <<
232232 1.0e-9*(globalToRamStop-ramToGlobalStart) << " s" << std::endl;
233233
234234