Skip to content

Commit

Permalink
[Examples] Updated examples to use snake_case
Browse files Browse the repository at this point in the history
  • Loading branch information
dmed256 committed Jul 7, 2018
1 parent d1fd6e0 commit 8691434
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 36 deletions.
18 changes: 9 additions & 9 deletions examples/1_add_vectors/c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ int main(int argc, char **argv) {
// "schedule : 'compact', "
// "chunk : 10");

// const char *deviceInfo = ("mode : 'OpenCL', "
// "platformID : 0, "
// "deviceID : 1");
// const char *deviceInfo = ("mode : 'OpenCL', "
// "platform_id : 0, "
// "device_id : 1");

// const char *deviceInfo = ("mode : 'CUDA', "
// "deviceID : 0");
// const char *deviceInfo = ("mode : 'CUDA', "
// "device_id : 0");

// const char *deviceInfo = ("mode : 'Threads', "
// "threadCount : 4, "
// "schedule : 'compact', "
// "pinnedCores : [0, 0, 1, 1]");
// const char *deviceInfo = ("mode : 'Threads', "
// "threads : 4, "
// "schedule : 'compact', "
// "pinned_cores : [0, 0, 1, 1]");

device = occaCreateDevice(occaString(deviceInfo));
//========================================================
Expand Down
18 changes: 9 additions & 9 deletions examples/1_add_vectors/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ int main(int argc, char **argv) {
// "schedule : 'compact', "
// "chunk : 10");

// device.setup("mode : 'OpenCL', "
// "platformID : 0, "
// "deviceID : 1");
// device.setup("mode : 'OpenCL', "
// "platform_id : 0, "
// "device_id : 1");

// device.setup("mode : 'CUDA', "
// "deviceID : 0");
// device.setup("mode : 'CUDA', "
// "device_id : 0");

// device.setup("mode : 'Threads', "
// "threadCount : 4, "
// "schedule : 'compact', "
// "pinnedCores : [0, 0, 1, 1]");
// device.setup("mode : 'Threads', "
// "threads : 4, "
// "schedule : 'compact', "
// "pinned_cores : [0, 0, 1, 1]");
//========================================================

// Allocate memory on the device
Expand Down
6 changes: 3 additions & 3 deletions examples/2_background_device/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ int main(int argc, char **argv) {

// Other useful functions:
// occa::setDevice("mode: 'OpenMP'")
// occa::device device("mode : 'OpenCL', "
// "platformID : 0, "
// "deviceID : 0");
// occa::device device("mode : 'OpenCL', "
// "platform_id : 0, "
// "device_id : 0");
// occa::device = occa::getDevice();

// Use the default device (mode = Serial)
Expand Down
4 changes: 2 additions & 2 deletions examples/3_reduction/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
int main(int argc, char **argv) {
occa::setDevice("mode: 'Serial'");
// occa::setDevice("mode: 'OpenMP'");
// occa::setDevice("mode: 'CUDA' , deviceID: 0");
// occa::setDevice("mode: 'OpenCL', platformID: 0, deviceID: 0");
// occa::setDevice("mode: 'CUDA' , device_id: 0");
// occa::setDevice("mode: 'OpenCL', platform_id: 0, device_id: 0");

occa::kernel reduction;

Expand Down
2 changes: 1 addition & 1 deletion examples/5_unified_memory/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <occa.hpp>

int main(int argc, char **argv) {
occa::setDevice("mode: 'CUDA', deviceID: 0");
occa::setDevice("mode: 'CUDA', device_id: 0");

int entries = 5;

Expand Down
10 changes: 5 additions & 5 deletions examples/6_arrays/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ template <class TM, const int TMi>
void printMatrix(occa::array<TM,TMi> &a);

int main(int argc, char **argv) {
// occa::setDevice("mode : 'OpenCL', "
// "platformID : 0, "
// "deviceID : 1, ");
// occa::setDevice("mode : 'OpenCL', "
// "platform_id : 0, "
// "device_id : 1, ");

// occa::setDevice("mode : 'CUDA', "
// "deviceID : 0, ");
// occa::setDevice("mode : 'CUDA', "
// "device_id : 0, ");

//---[ Testing API ]------------------
std::cout << "Testing API:\n";
Expand Down
4 changes: 2 additions & 2 deletions examples/7_streams/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <occa.hpp>

int main(int argc, char **argv) {
occa::setDevice("mode: 'CUDA', deviceID: 0");
// occa::setDevice("mode: 'OpenCL', platformID: 0, deviceID: 1");
occa::setDevice("mode: 'CUDA', device_id: 0");
// occa::setDevice("mode: 'OpenCL', platform_id: 0, device_id: 1");

int entries = 8;

Expand Down
2 changes: 1 addition & 1 deletion examples/8_mpi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int argc, char **argv) {
occa::json config = occa::json::parse(
"["
" { mode: 'OpenMP' },"
" { mode: 'CUDA', deviceID: 0 },"
" { mode: 'CUDA', device_id: 0 },"
"]"
);

Expand Down
4 changes: 2 additions & 2 deletions examples/interop_examples/native/addVectors/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ int main(int argc, char **argv) {

//---[ Device setup with string flags ]-------------------
device.setup("mode: 'Serial'");
// device.setup("mode: 'CUDA', deviceID: 0");
// device.setup("mode: 'OpenCL', platformID : 0, deviceID: 1");
// device.setup("mode: 'CUDA', device_id: 0");
// device.setup("mode: 'OpenCL', platform_id : 0, device_id: 1");
//========================================================

o_a = device.malloc(entries*sizeof(float));
Expand Down
4 changes: 2 additions & 2 deletions examples/interop_examples/native/reduction/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <occa.hpp>

int main(int argc, char **argv) {
occa::setDevice("mode: 'CUDA', deviceID: 0");
// occa::setDevice("mode: 'OpenCL', platformID: 0, deviceID: 0");
occa::setDevice("mode: 'CUDA', device_id: 0");
// occa::setDevice("mode: 'OpenCL', platform_id: 0, device_id: 0");

occa::kernel reduction;

Expand Down

0 comments on commit 8691434

Please sign in to comment.