Fixed bug when freeing distanceArrays
This commit is contained in:
12
.gitignore
vendored
12
.gitignore
vendored
@@ -3,3 +3,15 @@ esc-50-audio/
|
|||||||
|
|
||||||
# executable
|
# executable
|
||||||
soundknn.exe
|
soundknn.exe
|
||||||
|
cltest.exe
|
||||||
|
|
||||||
|
# opencl lib
|
||||||
|
OpenCL.lib
|
||||||
|
CL/
|
||||||
|
|
||||||
|
#vscode stuff
|
||||||
|
.vscode
|
||||||
|
|
||||||
|
#extrastuff
|
||||||
|
src/testcl.c
|
||||||
|
src/starterkernel.cl
|
||||||
@@ -16,7 +16,7 @@ With loudnorm to try to improve performance by normalizing loudness
|
|||||||
Used for gathering the image data
|
Used for gathering the image data
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
`clang src/main.c -Iexternal -O3 -fopenmp -march=native -o soundknn.exe`
|
`clang src/main.c -Iexternal -Lexternal -lOpenCL -O3 -fopenmp -march=native -o soundknn.exe`
|
||||||
|
|
||||||
### Todo
|
### Todo
|
||||||
- [x] Load all images from directory
|
- [x] Load all images from directory
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
|
#define CL_TARGET_OPENCL_VERSION 120
|
||||||
|
#include <CL/cl.h>
|
||||||
|
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
#include "stb_image.h"
|
#include "stb_image.h"
|
||||||
@@ -131,7 +133,7 @@ int main(){
|
|||||||
|
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
computeDistanceMatrixOMP(audioData, distanceArrays,nfiles, counter);
|
computeDistanceMatrixOMP(audioData, distanceArrays,nfiles, counter);
|
||||||
printf("Time it took to compute matrix: %lld\n seconds",time(NULL)-now);
|
printf("Time it took to compute matrix: %lld seconds\n",time(NULL)-now);
|
||||||
|
|
||||||
// Searches for index of specific image
|
// Searches for index of specific image
|
||||||
char img[]="esc-50-audio/img/4-189838-A-22.png";
|
char img[]="esc-50-audio/img/4-189838-A-22.png";
|
||||||
@@ -167,7 +169,7 @@ int main(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Freeing memeing of distance arrays
|
// Freeing memeing of distance arrays
|
||||||
for(int i=0;i<2000;i++){
|
for(int i=0;i<nfiles;i++){
|
||||||
free(distanceArrays[i]);
|
free(distanceArrays[i]);
|
||||||
}
|
}
|
||||||
free(distanceArrays);
|
free(distanceArrays);
|
||||||
|
|||||||
Reference in New Issue
Block a user