cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Franchute13
Journeyman III

[OpenCL] It will be possible to compare a char16 * to char *?

Hello.
Sorry for my English.
I'm learning OpenCL.


It will be possible to compare a char16 * to char *?

char16 * is an array with many words.
char * is a word.

The idea is to explore whether char16 * contains the word of char *

very basic example:

__kernel void buscaPalabra(__global char16* words,__global char* word,__global int* result)

{

int i = get_global_id(0);

// **This comparison does not work because they are of different types. I could not convert **

if(words==word){

result =1;

}

Thk

}

0 Likes
5 Replies
Wenju
Elite

Re: [OpenCL] It will be possible to compare a char16 * to char *?

Hi Franchute13,

__kernel void buscaPalabra(__global char16* words,__global char* word,__global int* result)

{

int i = get_global_id(0);


if(words.s0==word){

result =1;

}
}

Try to use KernelAnalyzer.

0 Likes
Franchute13
Journeyman III

Re: [OpenCL] It will be possible to compare a char16 * to char *?

Hello.
Thanks for the reply!
I´m use KernelAnalyzer but not knowledge.

Thx

0 Likes
Wenju
Elite

Re: [OpenCL] It will be possible to compare a char16 * to char *?

I think you should have a look at OpenCL 1.2 specification.

0 Likes
Franchute13
Journeyman III

Re: [OpenCL] It will be possible to compare a char16 * to char *?

a question
this line


if(words.s0==word){

I understand that only compares the first character of CHAR16* WORDS  with the first character of CHAR* WORD and not the word contained in the pointers. Is this correct?

Thx


0 Likes
settle
Challenger

Re: [OpenCL] It will be possible to compare a char16 * to char *?

Have you tried something like the following?

if (any(words == word))

{

   ;

}

0 Likes