<commit_before>import pycuda.driver as drv
import pycuda.autoinit
from pycuda import curandom
from pycuda import gpuarray
from pycuda.compiler import SourceModule


import numpy as np

with open("../Cuda/KernelV2.cu") as f:
	mod = SourceModule(f.read())


numPoints = np.int32(128)
dim = np.int32(5)
numMixtures = np.int32(4)

#Generated data!!
Xpoints = np.random.normal(size=(numPoints,dim)).astype(np.float32)
Xpoints_gpu = drv.mem_alloc(Xpoints.nbytes)
drv.memcpy_htod(Xpoints_gpu,Xpoints)


numGen = curandom.MRG32k3aRandomNumberGenerator()

means_gpu = numGen.gen_normal(shape=(int(numMixtures),int(dim)), dtype = np.float32)
diagCovs_gpu = numGen.gen_uniform(shape=(int(numMixtures),int(dim)), dtype = np.float32)+1

weights_gpu = numGen.gen_uniform(shape=int(numMixtures), dtype = np.float32)
weights_gpu /= gpuarray.sum(weights_gpu).get()
print weights_gpu.get()
# weights_gpu=  

emptyLikelihood_gpu = gpuarray.zeros(shape = int(numPoints), dtype = np.float32)

likelihoodKernel = mod.get_function("likelihoodKernel")
likelihoodKernel.prepare('PPPPiiiP')

# likelihoodKernel(Xpoints_gpu, means_gpu, diagCovs_gpu, weights_gpu, 
# 	dim, numPoints, numMixtures, 
# 	emptyLikelihood_gpu,
# 	block = (128,1,1))

likelihoodKernel.prepared_call(grid = (1,1), block=(128, 1,1),  Xpoints_gpu, means_gpu, diagCovs_gpu, weights_gpu, dim, numPoints, numMixtures,	emptyLikelihood_gpu)
<commit_msg>Prep check<commit_after>import pycuda.driver as drv
import pycuda.autoinit
from pycuda import curandom
from pycuda import gpuarray
from pycuda.compiler import SourceModule
from pycuda.tools import DeviceData

devData = DeviceData()
print devData.max_threads, devData.shared_memory


import numpy as np

with open("../Cuda/KernelV2.cu") as f:
	mod = SourceModule(f.read())


numPoints = np.int32(128)
dim = np.int32(5)
numMixtures = np.int32(4)

#Generated data!!
Xpoints = np.random.normal(size=(numPoints,dim)).astype(np.float32)
Xpoints_gpu = drv.mem_alloc(Xpoints.nbytes)
drv.memcpy_htod(Xpoints_gpu,Xpoints)


numGen = curandom.MRG32k3aRandomNumberGenerator()

means_gpu = numGen.gen_normal(shape=(int(numMixtures),int(dim)), dtype = np.float32)
diagCovs_gpu = numGen.gen_uniform(shape=(int(numMixtures),int(dim)), dtype = np.float32)+1

weights_gpu = numGen.gen_uniform(shape=int(numMixtures), dtype = np.float32)
weights_gpu /= gpuarray.sum(weights_gpu).get()
print weights_gpu.get()
# weights_gpu=  

emptyLikelihood_gpu = gpuarray.zeros(shape = int(numPoints), dtype = np.float32)

likelihoodKernel = mod.get_function("likelihoodKernel")
likelihoodKernel.prepare('PPPPiiiP')

# likelihoodKernel(Xpoints_gpu, means_gpu, diagCovs_gpu, weights_gpu, 
# 	dim, numPoints, numMixtures, 
# 	emptyLikelihood_gpu,
# 	block = (128,1,1))

likelihoodKernel.prepared_call((1,1), (128, 1,1),  Xpoints_gpu, means_gpu, diagCovs_gpu, weights_gpu, dim, numPoints, numMixtures,	emptyLikelihood_gpu)

{'fraction_non_alphanumeric': 0.12530371398819853, 'fraction_numerical': 0.026379729260673376, 'mean_word_length': 7.0055555555555555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4252776', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1070, 'n_words': 189}