testtranspose.py 649 Bytes
Newer Older
Philippe Helluy's avatar
Philippe Helluy committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import absolute_import, print_function
import pyopencl as cl
import numpy as np


with open('kernels.cl', 'r') as f:
    source = f.read()
    
ctx = cl.create_some_context()


prg = cl.Program(ctx, source).build()

point = [ ( 0.0, 0.0, 0.0),
          ( 1.0, 0.0, 0.0),
          ( 1.0, 1.0, 0.0),
          ( 0.0, 1.0, 0.0),
          ( 0.0, 0.0, 1.0),
          ( 1.0, 0.0, 1.0),
          ( 1.0, 1.0, 1.0),
          ( 0.0, 1.0, 1.0)]

element = [0,1,2,3,4,5,6,7]

face2node = [[0,1,5,4],
	      [1,2,6,5],
	      [2,3,7,6],
	      [0,4,7,3],
	      [5,6,7,4],
	      [0,3,2,1]]