Created
February 24, 2020 21:06
-
-
Save lisanhu/c48ba0a0aa2d971f8c1667782b8808f9 to your computer and use it in GitHub Desktop.
Deepcopy Sample code in Cpp
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
typedef struct Outer { | |
int *data, w, h; | |
#pragma acc policy<dpmove> copy(data[:w]) | |
// Outer(int *data = nullptr, int w = 0, int h = 0): data(data) {} | |
} Outer; | |
Outer init_outer(int *data, int w, int h) { | |
Outer r = {data, w, h}; | |
return r; | |
} | |
int main(int argc, char const *argv[]) { | |
int data[32 * 3]; | |
// int * data = nullptr; | |
// Outer one = Outer(data, 32, 3); | |
Outer one = init_outer(data, 32, 3); | |
#pragma acc data copy(one<dpmove>) | |
{ | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment