Created
May 3, 2010 00:01
-
-
Save mikejs/387566 to your computer and use it in GitHub Desktop.
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 clyther | |
import copencl as cl | |
@clyther.kernel | |
def broken(a): | |
b = a << 2 | |
c = a >> 2 | |
if __name__ == '__main__': | |
clyther.init('GPU') | |
devices = cl.get_devices('GPU') | |
context = cl.Context([devices[0]]) | |
broken = broken.argtypes(int, context=context) | |
print broken.source |
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
// === === === === === === === | |
//CLyther Module | |
struct _array_desc_ { | |
size_t start[3]; | |
size_t stop[3]; | |
size_t step[3]; | |
size_t shape[3]; | |
size_t size; | |
}; | |
typedef struct _array_desc_ array_desc; | |
// === === === === === === === | |
// Prototypes | |
// === === === === === === === | |
__kernel | |
void broken( int a ); | |
// === === === === === === === | |
// End Prototypes | |
// === === === === === === === | |
__kernel | |
void broken( int a ) | |
{ | |
/* function broken */ | |
int b; | |
int c; | |
b = a << 2; | |
c = a << 2; | |
} | |
// === === === === === === === | |
// === === === === === === === |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment