در این مثال روش ضرب دو ماتریس با استفاده از GPU را مشاهده می کنید:

// You might need to change this header based on your install:
// You might need to change this header based on your install:
#include <CL/cl.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <fstream>
#include <time.h>
#include <windows.h>
#define SUCCESS 0
#define FAILURE 1
using namespace std;
#pragma comment(lib, "OpenCl.lib")
static void check_error(cl_int error, char* name) {
if (error != CL_SUCCESS) {
fprintf(stderr, "Non-successful retu code %d for %s. Exiting.n", error, name);
exit(1);
}
}
//برای دیدن کد کامل، ادامه مطلب را ببینید
ادامه مطلب برنامه نویسی - تمرین سری صفرم...
ما را در سایت برنامه نویسی - تمرین سری صفرم دنبال میکنید
برچسب:
نویسنده:
بازدید: 110
تاريخ: جمعه
14 آبان
1395 ساعت: 16:20