Click here to Skip to main content
15,892,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ file stream read/write[SOLVED] Pin
Biruk Abebe3-Apr-16 10:26
Biruk Abebe3-Apr-16 10:26 
QuestionC, Win32 API: l need help with ReadFile function[Solved] Pin
Member 121394421-Apr-16 0:46
Member 121394421-Apr-16 0:46 
AnswerRe: C, Win32 API: l need help with ReadFile function Pin
Jochen Arndt1-Apr-16 1:30
professionalJochen Arndt1-Apr-16 1:30 
GeneralRe: C, Win32 API: l need help with ReadFile function Pin
Member 121394422-Apr-16 5:30
Member 121394422-Apr-16 5:30 
GeneralRe: C, Win32 API: l need help with ReadFile function Pin
Richard MacCutchan2-Apr-16 6:10
mveRichard MacCutchan2-Apr-16 6:10 
GeneralRe: C, Win32 API: l need help with ReadFile function Pin
Jochen Arndt2-Apr-16 21:02
professionalJochen Arndt2-Apr-16 21:02 
AnswerRe: C, Win32 API: l need help with ReadFile function Pin
David Crow1-Apr-16 2:25
David Crow1-Apr-16 2:25 
QuestionOpenCL program uses only 1 core from 192 cuda cores Pin
Javier Luis Lopez31-Mar-16 4:04
Javier Luis Lopez31-Mar-16 4:04 
I made following program to use opencl library supplied with Nvidia cuda 7.5.
As result I obtained:

Num of devices=1
Device name= quadro K600
Device vendor=NVIDIA Corporation
Device Version=OPENCL 1.2 CUDA
Driver Version= 353.90
DEVICE_MAX_COMPUTE_UNITS = 1 !!!!!!!!!!!!!!!!!!!!!!!!!!
DEVICE_MAX_CLOCK_FREQUENCY = 875 MHZ
DEVICE_GLOBAL_MEM_SIZE= 1073741824

Only 1 compute unit at 875 Mhz????
I read that K600 has 192


C++
#include <stdlib.h>
#define __CL_ENABLE_EXCEPTIONS
#pragma warning(disable:4996)
#include <CL/cl.hpp>
#include <fstream>
#include <iostream>
#include <time.h>
#include <cmath>

#define LOCAL_SIZE 512
#define WIDTH_A (4096*2)
#define HEIGHT_A (4096*2)

float *matrix_A;
float *vector_B;
float *result_vector;
float *result_vector_host;


#define MAX_SOURCE_SIZE (0x100000)	

int main()
{
	cl_platform_id platform_id = NULL;
	cl_device_id device_id = NULL;
	cl_context context = NULL;
	cl_command_queue command_queue = NULL;
	cl_mem Amobj = NULL;
	cl_mem Bmobj = NULL;
	cl_mem Cmobj = NULL;
	cl_program program = NULL;
	cl_kernel kernel = NULL;
	cl_uint ret_num_devices;
	cl_uint ret_num_platforms;
	cl_int ret;

	int i, j;

	/* Get Platform/Device Information*/
	ret = clGetPlatformIDs(1, &platform_id, &ret_num_platforms);
	ret = clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_DEFAULT, 1, &device_id, &ret_num_devices);

	/* Create OpenCL Context */
	context = clCreateContext(NULL, 1, &device_id, NULL, NULL, &ret);


	char buffer[10240];
	cl_uint buf_uint;
	cl_ulong buf_ulong;
	printf("Num of devices=%i", ret_num_devices);
	for (i = 0; i < ret_num_devices; i++)
	{
		printf("  -- %d --\n", i);
		clGetDeviceInfo(device_id, CL_DEVICE_NAME, sizeof(buffer), buffer, NULL);
		printf("  DEVICE_NAME = %s\n", buffer);
		clGetDeviceInfo(device_id, CL_DEVICE_VENDOR, sizeof(buffer), buffer, NULL);
		printf("  DEVICE_VENDOR = %s\n", buffer);
		clGetDeviceInfo(device_id, CL_DEVICE_VERSION, sizeof(buffer), buffer, NULL);
		printf("  DEVICE_VERSION = %s\n", buffer);
		clGetDeviceInfo(device_id, CL_DRIVER_VERSION, sizeof(buffer), buffer, NULL);
		printf("  DRIVER_VERSION = %s\n", buffer);
		clGetDeviceInfo(device_id, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(buf_uint), &buf_uint, NULL);
		printf("  DEVICE_MAX_COMPUTE_UNITS = %u\n", (unsigned int)buf_uint);
		clGetDeviceInfo(device_id, CL_DEVICE_MAX_CLOCK_FREQUENCY, sizeof(buf_uint), &buf_uint, NULL);
		printf("  DEVICE_MAX_CLOCK_FREQUENCY = %u\n", (unsigned int)buf_uint);
		clGetDeviceInfo(device_id, CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(buf_ulong), &buf_ulong, NULL);
		printf("  DEVICE_GLOBAL_MEM_SIZE = %llu\n", (unsigned long long)buf_ulong);
	}
}


modified 31-Mar-16 11:32am.

QuestionRe: OpenCL program uses only 1 core from 192 cuda cores Pin
David Crow31-Mar-16 6:09
David Crow31-Mar-16 6:09 
AnswerRe: OpenCL program uses only 1 core from 192 cuda cores Pin
Javier Luis Lopez20-Apr-16 1:14
Javier Luis Lopez20-Apr-16 1:14 
QuestionHow to overwrite one angle arc over other during runtime Pin
Member 1053643030-Mar-16 1:45
Member 1053643030-Mar-16 1:45 
SuggestionRe: How to overwrite one angle arc over other during runtime Pin
Kornfeld Eliyahu Peter30-Mar-16 2:06
professionalKornfeld Eliyahu Peter30-Mar-16 2:06 
QuestionC, Win32 API: l need a help Pin
Member 1213944229-Mar-16 21:19
Member 1213944229-Mar-16 21:19 
SuggestionRe: C, Win32 API: l need a help Pin
David Crow30-Mar-16 10:09
David Crow30-Mar-16 10:09 
AnswerRe: C, Win32 API: l need a help Pin
Victor Nijegorodov31-Mar-16 1:11
Victor Nijegorodov31-Mar-16 1:11 
Questionproblem with compiler Pin
Ngoc Linh Nguyen29-Mar-16 20:52
Ngoc Linh Nguyen29-Mar-16 20:52 
AnswerRe: problem with compiler Pin
Jochen Arndt29-Mar-16 21:33
professionalJochen Arndt29-Mar-16 21:33 
GeneralRe: problem with compiler Pin
Ngoc Linh Nguyen30-Mar-16 3:14
Ngoc Linh Nguyen30-Mar-16 3:14 
GeneralRe: problem with compiler Pin
Jochen Arndt30-Mar-16 4:15
professionalJochen Arndt30-Mar-16 4:15 
GeneralRe: problem with compiler Pin
Ngoc Linh Nguyen30-Mar-16 5:36
Ngoc Linh Nguyen30-Mar-16 5:36 
GeneralRe: problem with compiler Pin
Jochen Arndt30-Mar-16 5:53
professionalJochen Arndt30-Mar-16 5:53 
GeneralRe: problem with compiler Pin
Ngoc Linh Nguyen30-Mar-16 5:58
Ngoc Linh Nguyen30-Mar-16 5:58 
GeneralRe: problem with compiler Pin
Ngoc Linh Nguyen31-Mar-16 0:39
Ngoc Linh Nguyen31-Mar-16 0:39 
GeneralRe: problem with compiler Pin
Jochen Arndt31-Mar-16 0:51
professionalJochen Arndt31-Mar-16 0:51 
Questionproblem with compiler Pin
Ngoc Linh Nguyen29-Mar-16 20:52
Ngoc Linh Nguyen29-Mar-16 20:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.