Results 1 to 3 of 3

Thread: Testing vectors for equality

  1. #1
    Junior Member
    Join Date
    Oct 2010

    Testing vectors for equality


    I've read through the 1.1 standard, but I can't find a good way to test two vectors for equality. For example, if x and y are char16s, I can't use if(x == y) because the "==" operator returns a char16.

    I thought the any and all functions might help, but they only count the MSBs of the input vectors.

    Any thoughts? I'll test the individual components if I have to, but it seems like there should be a better way.

  2. #2
    Junior Member
    Join Date
    Oct 2010

    Re: Testing vectors for equality

    Never mind. I forgot that the '==' operator returns all ones (0xFF, 0xFFFF, and so on) for equality. So you can use the 'any' and 'all' functions to test the result.

  3. #3

    Re: Testing vectors for equality

    Way to problem solve! Answered your own question. Any and All functions work good.

Similar Threads

  1. 2D Vectors
    By BratSinot in forum OpenCL
    Replies: 2
    Last Post: 09-13-2011, 04:21 AM
  2. using ?: with vectors
    By ksi in forum OpenCL
    Replies: 3
    Last Post: 03-23-2011, 03:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean