diff --git a/network/CPP_Cuda/HDynamicCNNManyIP.cu b/network/CPP_Cuda/HDynamicCNNManyIP.cu index 2272276..723b66f 100644 --- a/network/CPP_Cuda/HDynamicCNNManyIP.cu +++ b/network/CPP_Cuda/HDynamicCNNManyIP.cu @@ -711,4 +711,26 @@ bool HDynamicCNNManyIP::gpu_update( return true; +}; + + +void HDynamicCNNManyIP::gpu_occupancy_export( + size_t dim_x, + size_t dim_y, + size_t number_of_pattern, + size_t h_dim, + int64_t setting_memory_addr, + size_t setting_dim_0, + size_t setting_dim_1) +{ + return; +}; + +void HDynamicCNNManyIP::gpu_occupancy_import( + int64_t setting_memory_addr, + size_t setting_dim_0, + size_t setting_dim_1 +) +{ + return; }; \ No newline at end of file diff --git a/network/CPP_Cuda/HDynamicCNNManyIP.h b/network/CPP_Cuda/HDynamicCNNManyIP.h index afe7ac1..2244942 100644 --- a/network/CPP_Cuda/HDynamicCNNManyIP.h +++ b/network/CPP_Cuda/HDynamicCNNManyIP.h @@ -38,6 +38,20 @@ class HDynamicCNNManyIP float forgetting_offset, int64_t gpu_tuning_factor); + void gpu_occupancy_export( + size_t dim_x, + size_t dim_y, + size_t number_of_pattern, + size_t h_dim, + int64_t setting_memory_addr, + size_t setting_dim_0, + size_t setting_dim_1); + + void gpu_occupancy_import( + int64_t setting_memory_addr, + size_t setting_dim_0, + size_t setting_dim_1); + private: bool update( diff --git a/network/CPP_Cuda/PyHDynamicCNNManyIP.cpp b/network/CPP_Cuda/PyHDynamicCNNManyIP.cpp index f59118b..469a4a8 100644 --- a/network/CPP_Cuda/PyHDynamicCNNManyIP.cpp +++ b/network/CPP_Cuda/PyHDynamicCNNManyIP.cpp @@ -9,6 +9,10 @@ PYBIND11_MODULE(PyHDynamicCNNManyIP, m) m.doc() = "HDynamicCNNManyIP Module"; py::class_(m, "HDynamicCNNManyIP") .def(py::init<>()) + .def("gpu_occupancy_export", + &HDynamicCNNManyIP::gpu_occupancy_export) + .def("gpu_occupancy_import", + &HDynamicCNNManyIP::gpu_occupancy_import) .def("update", &HDynamicCNNManyIP::update_entrypoint); } \ No newline at end of file diff --git a/network/CPP_Cuda/PySpikeGeneration2DManyIP.cpp b/network/CPP_Cuda/PySpikeGeneration2DManyIP.cpp index eaece6f..b338d23 100644 --- a/network/CPP_Cuda/PySpikeGeneration2DManyIP.cpp +++ b/network/CPP_Cuda/PySpikeGeneration2DManyIP.cpp @@ -10,6 +10,10 @@ PYBIND11_MODULE(PySpikeGeneration2DManyIP, m) m.doc() = "SpikeGeneration2DManyIP Module"; py::class_(m, "SpikeGeneration2DManyIP") .def(py::init<>()) + .def("gpu_occupancy_export", + &SpikeGeneration2DManyIP::gpu_occupancy_export) + .def("gpu_occupancy_import", + &SpikeGeneration2DManyIP::gpu_occupancy_import) .def("spike_generation", &SpikeGeneration2DManyIP::spike_generation_entrypoint); } diff --git a/network/CPP_Cuda/SpikeGeneration2DManyIP.cu b/network/CPP_Cuda/SpikeGeneration2DManyIP.cu index e0176e9..102448d 100644 --- a/network/CPP_Cuda/SpikeGeneration2DManyIP.cu +++ b/network/CPP_Cuda/SpikeGeneration2DManyIP.cu @@ -387,4 +387,25 @@ bool SpikeGeneration2DManyIP::gpu_spike_generation( cudaDeviceSynchronize(); return true; +}; + + +void SpikeGeneration2DManyIP::gpu_occupancy_export( + size_t dim_x, + size_t dim_y, + size_t number_of_pattern, + size_t spike_dim, + int64_t setting_memory_addr, + size_t setting_dim_0, + size_t setting_dim_1) +{ + return; +}; + +void SpikeGeneration2DManyIP::gpu_occupancy_import( + int64_t setting_memory_addr, + size_t setting_dim_0, + size_t setting_dim_1) +{ + return; }; \ No newline at end of file diff --git a/network/CPP_Cuda/SpikeGeneration2DManyIP.h b/network/CPP_Cuda/SpikeGeneration2DManyIP.h index 7c17031..62e8430 100644 --- a/network/CPP_Cuda/SpikeGeneration2DManyIP.h +++ b/network/CPP_Cuda/SpikeGeneration2DManyIP.h @@ -13,13 +13,22 @@ class SpikeGeneration2DManyIP ~SpikeGeneration2DManyIP(); bool spike_generation_entrypoint( - int64_t input_pointer_addr, int64_t input_dim_0, - int64_t input_dim_1, int64_t input_dim_2, int64_t input_dim_3, - int64_t random_values_pointer_addr, int64_t random_values_dim_0, - int64_t random_values_dim_1, int64_t random_values_dim_2, - int64_t random_values_dim_3, int64_t output_pointer_addr, - int64_t output_dim_0, int64_t output_dim_1, int64_t output_dim_2, - int64_t output_dim_3, int64_t number_of_cpu_processes); + int64_t input_pointer_addr, + int64_t input_dim_0, + int64_t input_dim_1, + int64_t input_dim_2, + int64_t input_dim_3, + int64_t random_values_pointer_addr, + int64_t random_values_dim_0, + int64_t random_values_dim_1, + int64_t random_values_dim_2, + int64_t random_values_dim_3, + int64_t output_pointer_addr, + int64_t output_dim_0, + int64_t output_dim_1, + int64_t output_dim_2, + int64_t output_dim_3, + int64_t number_of_cpu_processes); bool spike_generation( float* input_pointer, @@ -59,6 +68,20 @@ class SpikeGeneration2DManyIP size_t h_dim, size_t number_of_pattern); + void gpu_occupancy_export( + size_t dim_x, + size_t dim_y, + size_t number_of_pattern, + size_t spike_dim, + int64_t setting_memory_addr, + size_t setting_dim_0, + size_t setting_dim_1); + + void gpu_occupancy_import( + int64_t setting_memory_addr, + size_t setting_dim_0, + size_t setting_dim_1); + private: size_t lower_bound(float* data_ptr, size_t data_length, size_t data_ptr_stride,