This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pyopencl as cl | |
| N = 32 | |
| its = 3 | |
| a = np.random.rand(N).astype(np.float32) | |
| gpu_idx = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "CL/cl.h" | |
| #include <iostream> | |
| #include <stdexcept> | |
| using namespace std; | |
| string kernelSource = R"( | |
| kernel void _z8setValuePfif(global float* data, long data_offset, int idx, float value) { | |
| data = (global float*)((global char *)data + data_offset); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pyopencl as cl | |
| N = 32 | |
| its = 3 | |
| np.random.seed(123) | |
| a = np.random.rand(N).astype(np.float32) | |
| gpu_idx = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "EasyCL/EasyCL.h" | |
| #include <iostream> | |
| #include <stdexcept> | |
| using namespace std; | |
| string kernelSource = R"( | |
| kernel void _z8setValuePfif(global float* data, long data_offset, int idx, float value) { | |
| data = (global float*)((global char *)data + data_offset); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "EasyCL/EasyCL.h" | |
| #include <iostream> | |
| #include <stdexcept> | |
| #include "cocl/cocl.h" | |
| using namespace std; | |
| string kernelSource = R"( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "EasyCL/EasyCL.h" | |
| #include <iostream> | |
| #include <stdexcept> | |
| #include "cocl/cocl.h" | |
| using namespace std; | |
| string kernelSource = R"( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "EasyCL/EasyCL.h" | |
| #include <iostream> | |
| #include <stdexcept> | |
| #include "cocl/cocl.h" | |
| using namespace std; | |
| string kernelSource = R"( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "EasyCL/EasyCL.h" | |
| #include <iostream> | |
| #include <stdexcept> | |
| #include "cocl/cocl.h" | |
| using namespace std; | |
| string kernelSource = R"( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "EasyCL/EasyCL.h" | |
| #include <iostream> | |
| #include <stdexcept> | |
| #include <cstddef> | |
| #include "cocl/cocl.h" | |
| using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "EasyCL/EasyCL.h" | |
| #include <iostream> | |
| #include <stdexcept> | |
| #include <cstddef> | |
| #include "cocl/cocl.h" | |
| using namespace std; |