mirror of
https://github.com/smyalygames/FiniteVolumeGPU.git
synced 2025-07-05 07:51:00 +02:00
Added autotuning notebook to get best block size
This commit is contained in:
parent
e48a408a7c
commit
f60ceaa316
547
Autotuning.ipynb
Normal file
547
Autotuning.ipynb
Normal file
File diff suppressed because one or more lines are too long
@ -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()
|
||||
|
||||
|
||||
|
||||
|
@ -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"
|
@ -183,4 +183,7 @@ class BaseSimulator:
|
||||
|
||||
def download(self):
|
||||
return self.data.download(self.stream)
|
||||
|
||||
def synchronize(self):
|
||||
self.stream.synchronize()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user