Я новичок в программировании Opencl. Я написал программу умножения матриц во время компиляции, которая выдает мне ошибку. Мои включаемые файлы:
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#include <CL/cl.h>
#include <stdbool.h>
Но я получил ошибку:
/usr/bin/ld: /tmp/ccxNPkyU.o: in function `main':
gmm.c:(.text+0x2d3): undefined reference to `clGetPlatformIDs'
/usr/bin/ld: gmm.c:(.text+0x2ef): undefined reference to `clGetPlatformIDs'
/usr/bin/ld: gmm.c:(.text+0x322): undefined reference to `clGetDeviceIDs'
/usr/bin/ld: gmm.c:(.text+0x376): undefined reference to `clCreateContext'
/usr/bin/ld: gmm.c:(.text+0x527): undefined reference to `clCreateCommandQueue'
/usr/bin/ld: gmm.c:(.text+0x5ab): undefined reference to `clCreateProgramWithSource'
/usr/bin/ld: gmm.c:(.text+0x5fc): undefined reference to `clBuildProgram'
/usr/bin/ld: gmm.c:(.text+0x64c): undefined reference to `clGetProgramBuildInfo'
/usr/bin/ld: gmm.c:(.text+0x682): undefined reference to `clCreateKernel'
/usr/bin/ld: gmm.c:(.text+0x6dc): undefined reference to `clCreateBuffer'
/usr/bin/ld: gmm.c:(.text+0x70c): undefined reference to `clCreateBuffer'
/usr/bin/ld: gmm.c:(.text+0x73c): undefined reference to `clCreateBuffer'
/usr/bin/ld: gmm.c:(.text+0x76e): undefined reference to `clCreateBuffer'
/usr/bin/ld: gmm.c:(.text+0x7a0): undefined reference to `clCreateBuffer'
/usr/bin/ld: /tmp/ccxNPkyU.o:gmm.c:(.text+0x7d2): more undefined references to `clCreateBuffer' follow
/usr/bin/ld: /tmp/ccxNPkyU.o: in function `main':
gmm.c:(.text+0x84c): undefined reference to `clSetKernelArg'
/usr/bin/ld: gmm.c:(.text+0x875): undefined reference to `clSetKernelArg'
/usr/bin/ld: gmm.c:(.text+0x89e): undefined reference to `clSetKernelArg'
/usr/bin/ld: gmm.c:(.text+0x8c7): undefined reference to `clSetKernelArg'
/usr/bin/ld: gmm.c:(.text+0x8f8): undefined reference to `clSetKernelArg'
/usr/bin/ld: /tmp/ccxNPkyU.o:gmm.c:(.text+0x929): more undefined references to `clSetKernelArg' follow
/usr/bin/ld: /tmp/ccxNPkyU.o: in function `main':
gmm.c:(.text+0xa58): undefined reference to `clEnqueueReadBuffer'
/usr/bin/ld: gmm.c:(.text+0xa9f): undefined reference to `clEnqueueReadBuffer'
/usr/bin/ld: gmm.c:(.text+0xae6): undefined reference to `clEnqueueReadBuffer'
/usr/bin/ld: gmm.c:(.text+0xb04): undefined reference to `clWaitForEvents'
/usr/bin/ld: gmm.c:(.text+0xb13): undefined reference to `clFinish'
/usr/bin/ld: gmm.c:(.text+0xb3c): undefined reference to `clGetEventProfilingInfo'
/usr/bin/ld: gmm.c:(.text+0xb65): undefined reference to `clGetEventProfilingInfo'
/usr/bin/ld: gmm.c:(.text+0xc9f): undefined reference to `clReleaseMemObject'
/usr/bin/ld: gmm.c:(.text+0xcae): undefined reference to `clReleaseMemObject'
/usr/bin/ld: gmm.c:(.text+0xcbd): undefined reference to `clReleaseMemObject'
/usr/bin/ld: gmm.c:(.text+0xccc): undefined reference to `clReleaseMemObject'
/usr/bin/ld: gmm.c:(.text+0xcdb): undefined reference to `clReleaseMemObject'
/usr/bin/ld: /tmp/ccxNPkyU.o:gmm.c:(.text+0xcea): more undefined references to `clReleaseMemObject' follow
collect2: error: ld returned 1 exit status
Я компилирую программу этим заявление: gcc -o gmmc gmm.c
. Может ли кто-нибудь помочь мне