Added autotuning notebook to get best block size

This commit is contained in:
André R. Brodtkorb 2018-08-15 08:08:43 +02:00
parent e48a408a7c
commit f60ceaa316
4 changed files with 562 additions and 1 deletions

547
Autotuning.ipynb Normal file

File diff suppressed because one or more lines are too long

View File

@ -28,6 +28,7 @@ import re
import io
import hashlib
import logging
import gc
import pycuda.compiler as cuda_compiler
import pycuda.gpuarray
@ -261,7 +262,15 @@ class CudaContext(object):
Clears the kernel cache (useful for debugging & development)
"""
def clear_kernel_cache(self):
self.logger.debug("Clearing cache")
self.kernels = {}
gc.collect()
"""
Synchronizes all streams etc
"""
def synchronize(self):
self.cuda_context.synchronize()

View File

@ -99,6 +99,7 @@ void computeFluxG(float Q[3][BLOCK_HEIGHT+4][BLOCK_WIDTH+4],
/**
* This unsplit kernel computes the 2D numerical scheme with a TVD RK2 time integration scheme
*/
extern "C" {
__global__ void KP07Kernel(
int nx_, int ny_,
float dx_, float dy_, float dt_,
@ -205,4 +206,5 @@ __global__ void KP07Kernel(
hv_row[ti] = hv_b;
}
}
}
}
} //extern "C"

View File

@ -183,4 +183,7 @@ class BaseSimulator:
def download(self):
return self.data.download(self.stream)
def synchronize(self):
self.stream.synchronize()