From 6549253348b6135f63e91a02c2fe8b460984b6bf Mon Sep 17 00:00:00 2001 From: mgkeka Date: Tue, 14 Jan 2025 12:25:24 +0000 Subject: [PATCH 1/3] Update wrapper code. --- app/Makefile | 5 +++-- app/wrapper_exec-args.c | 6 +++--- app/wrapper_exec.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/Makefile b/app/Makefile index 7c1d45f..879c641 100644 --- a/app/Makefile +++ b/app/Makefile @@ -3,8 +3,9 @@ CC=gcc LD=gcc CFLAGS=-Wall -VACCEL_CFLAGS=-I../vaccelrt/src/include -I../vaccelrt/third-party/slog/src -VACCEL_LDFLAGS=-L../vaccelrt/build/src -lvaccel -ldl +VACCEL_INSTALL_PATH=/ #Add here the of vaccel meson setup --prefix option +VACCEL_CFLAGS=-I${VACCEL_INSTALL_PATH}/include +VACCEL_LDFLAGS=-L${VACCEL_INSTALL_PATH}/lib/x86_64-linux-gnu -lvaccel -ldl VADD_LDFLAGS=-L${PWD}/opencl_examples/build/vector_add -lvector_add OCL_LDFLAGS=-L/usr/lib/x86_64-linux-gnu/ -lOpenCL diff --git a/app/wrapper_exec-args.c b/app/wrapper_exec-args.c index b0f0114..9927cc6 100644 --- a/app/wrapper_exec-args.c +++ b/app/wrapper_exec-args.c @@ -12,13 +12,13 @@ int vaccel_vector_add(int *A, int *B, int *C, int dimension) struct vaccel_arg op_args[6]; struct vaccel_session sess; - ret = vaccel_sess_init(&sess, 0); + ret = vaccel_session_init(&sess, 0); if (ret != VACCEL_OK) { fprintf(stderr, "Could not initialize session\n"); return 1; } - printf("Initialized session with id: %u\n", sess.session_id); + printf("Initialized session with id: %lu\n", sess.id); char *library = "/tmp/libvector_add.so"; char *operation = "vector_add"; @@ -41,7 +41,7 @@ int vaccel_vector_add(int *A, int *B, int *C, int dimension) } close_session: - if (vaccel_sess_free(&sess) != VACCEL_OK) { + if (vaccel_session_release(&sess) != VACCEL_OK) { fprintf(stderr, "Could not clear session\n"); return 1; } diff --git a/app/wrapper_exec.c b/app/wrapper_exec.c index 04bc0b5..4008054 100644 --- a/app/wrapper_exec.c +++ b/app/wrapper_exec.c @@ -10,13 +10,13 @@ int vaccel_vector_add() int ret = 0; struct vaccel_session sess; - ret = vaccel_sess_init(&sess, 0); + ret = vaccel_session_init(&sess, 0); if (ret != VACCEL_OK) { fprintf(stderr, "Could not initialize session\n"); return 1; } - printf("Initialized session with id: %u\n", sess.session_id); + printf("Initialized session with id: %lu\n", sess.id); char *library = "opencl_examples/build/vector_add/libvector_add.so"; char *operation = "vector_add"; @@ -28,7 +28,7 @@ int vaccel_vector_add() } close_session: - if (vaccel_sess_free(&sess) != VACCEL_OK) { + if (vaccel_session_release(&sess) != VACCEL_OK) { fprintf(stderr, "Could not clear session\n"); return 1; } From bb754c8b01180b2968959a03bf3ed4799710c34e Mon Sep 17 00:00:00 2001 From: mgkeka Date: Tue, 25 Feb 2025 12:00:45 +0000 Subject: [PATCH 2/3] Update repo for latest vaccel version. --- README.md | 2 ++ app/Makefile | 3 ++- vaccelrt | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) delete mode 160000 vaccelrt diff --git a/README.md b/README.md index 90700dc..6c9bc87 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,5 @@ This is a helper repo to accomodate https://github.com/nubificus/vaccel-tutorials. + +Set the vAccel installation path on the `VACCEL_INSTALL_PATH` variable in the `app/Makefile`. diff --git a/app/Makefile b/app/Makefile index 879c641..3395346 100644 --- a/app/Makefile +++ b/app/Makefile @@ -3,7 +3,8 @@ CC=gcc LD=gcc CFLAGS=-Wall -VACCEL_INSTALL_PATH=/ #Add here the of vaccel meson setup --prefix option +#Add here the of vaccel meson setup --prefix option +VACCEL_INSTALL_PATH= VACCEL_CFLAGS=-I${VACCEL_INSTALL_PATH}/include VACCEL_LDFLAGS=-L${VACCEL_INSTALL_PATH}/lib/x86_64-linux-gnu -lvaccel -ldl VADD_LDFLAGS=-L${PWD}/opencl_examples/build/vector_add -lvector_add diff --git a/vaccelrt b/vaccelrt deleted file mode 160000 index 12f8280..0000000 --- a/vaccelrt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 12f82805fd9476667cf39dde1d566835be678965 From 78356acdebf835b82dafa4cadd4dc9e0daa4e9fa Mon Sep 17 00:00:00 2001 From: mgkeka Date: Mon, 24 Mar 2025 16:07:15 +0000 Subject: [PATCH 3/3] Minor changes. --- README.md | 1 - app/Makefile | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6c9bc87..df136bc 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,3 @@ This is a helper repo to accomodate https://github.com/nubificus/vaccel-tutorials. -Set the vAccel installation path on the `VACCEL_INSTALL_PATH` variable in the `app/Makefile`. diff --git a/app/Makefile b/app/Makefile index 3395346..de6fd8a 100644 --- a/app/Makefile +++ b/app/Makefile @@ -3,12 +3,11 @@ CC=gcc LD=gcc CFLAGS=-Wall -#Add here the of vaccel meson setup --prefix option -VACCEL_INSTALL_PATH= +VACCEL_INSTALL_PATH=(pkg-config --variable=prefix vaccel) VACCEL_CFLAGS=-I${VACCEL_INSTALL_PATH}/include VACCEL_LDFLAGS=-L${VACCEL_INSTALL_PATH}/lib/x86_64-linux-gnu -lvaccel -ldl VADD_LDFLAGS=-L${PWD}/opencl_examples/build/vector_add -lvector_add -OCL_LDFLAGS=-L/usr/lib/x86_64-linux-gnu/ -lOpenCL +OCL_LDFLAGS=(pkg-config --libs OpenCL) all: wrapper wrapper-args wrapper-vaccel wrapper-args-vaccel