Click here to Skip to main content
15,894,343 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: QR CODE IN ARABIC Pin
Daniel Pfeffer21-Mar-18 9:37
professionalDaniel Pfeffer21-Mar-18 9:37 
GeneralRe: QR CODE IN ARABIC Pin
Member 1054250021-Mar-18 11:13
Member 1054250021-Mar-18 11:13 
GeneralRe: QR CODE IN ARABIC Pin
leon de boer21-Mar-18 16:35
leon de boer21-Mar-18 16:35 
GeneralRe: QR CODE IN ARABIC Pin
Daniel Pfeffer21-Mar-18 20:24
professionalDaniel Pfeffer21-Mar-18 20:24 
QuestionWinTECH opc client Pin
D.Manivelan20-Mar-18 21:28
D.Manivelan20-Mar-18 21:28 
AnswerRe: WinTECH opc client Pin
Victor Nijegorodov20-Mar-18 22:26
Victor Nijegorodov20-Mar-18 22:26 
AnswerRe: WinTECH opc client Pin
Richard MacCutchan20-Mar-18 22:43
mveRichard MacCutchan20-Mar-18 22:43 
Questionporting _beginthreadex from VS2005 to VS2017 Pin
jimNLX20-Mar-18 5:13
jimNLX20-Mar-18 5:13 
AnswerRe: porting _beginthreadex from VS2005 to VS2017 Pin
Jochen Arndt20-Mar-18 5:43
professionalJochen Arndt20-Mar-18 5:43 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
jimNLX6-Apr-18 9:03
jimNLX6-Apr-18 9:03 
AnswerRe: porting _beginthreadex from VS2005 to VS2017 Pin
leon de boer20-Mar-18 8:00
leon de boer20-Mar-18 8:00 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
jimNLX6-Apr-18 9:06
jimNLX6-Apr-18 9:06 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
jimNLX11-Apr-18 9:03
jimNLX11-Apr-18 9:03 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
leon de boer17-Apr-18 21:45
leon de boer17-Apr-18 21:45 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
jimNLX18-Apr-18 3:49
jimNLX18-Apr-18 3:49 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
leon de boer18-Apr-18 15:27
leon de boer18-Apr-18 15:27 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
jimNLX9-May-18 9:18
jimNLX9-May-18 9:18 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
leon de boer9-May-18 16:11
leon de boer9-May-18 16:11 
GeneralRe: porting _beginthreadex from VS2005 to VS2017 Pin
jimNLX11-May-18 6:23
jimNLX11-May-18 6:23 
QuestionOpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 1370349219-Mar-18 19:19
User 1370349219-Mar-18 19:19 
Hello all

I am performing multiplication between two square bit-matrices using a specific formula (not the dot product of row/col, I will describe it below). My implementation works correctly but it blows up when I attempt to do tiling in the local memory. Even though I understand the principles behind it (i.e. putting some of my data in local arrays, then using barriers to synchronize my work-items), I keep getting the wrong results.

This is an example of how I setup the matrices:
C++
int N = 256; // number of bits in a row/col (or any number that is evenly divisible by 64)
unsigned long long A = new unsigned long long[n*n/64]; // stores bits in 64-bit integers
unsigned long long B = new unsigned long long[n*n/64]; // for example, one row consists of 256 bits and uses 4x64-bit integers to store them
int C  = new int[n*n];
This is the actual formula:
Row i of matrix A is XORed with row j of matrix B. Yes, it is a row to row operation. Then, I count the number of 1s and assign the sum to C[i][j].

This is how I launch the kernel:
C++
const size_t global[2] = { n, n };
clEnqueueNDRangeKernel(queue, kernel, 2, NULL, global, 0, 0, NULL, &event);
This is the actual kernel which works correctly:
C++
__kernel void BitProduct(const int N, const __global ulong* A, const __global ulong* B, __global int* C)
    {
    	const int i = get_global_id(0);
    	const int j = get_global_id(1);
 
    	ulong sum = 0;
 
    	for (int k = 0;k < N/64;k++)
    		sum += popcount( A[ i*(N/64) + k ] ^ B[ j*(N/64) + k ] );
 
    	C[ i * N + j ] = (int) sum;
    }

AnswerRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
leon de boer19-Mar-18 23:47
leon de boer19-Mar-18 23:47 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 1370349220-Mar-18 1:02
User 1370349220-Mar-18 1:02 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
leon de boer20-Mar-18 3:12
leon de boer20-Mar-18 3:12 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
User 1370349220-Mar-18 10:09
User 1370349220-Mar-18 10:09 
GeneralRe: OpenCL bit-matrix multiplication (implementing tiling in local memory) Pin
leon de boer20-Mar-18 15:27
leon de boer20-Mar-18 15:27 

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.