Skip to content

Instantly share code, notes, and snippets.

View FernandoS27's full-sized avatar

Fernando S. FernandoS27

View GitHub Profile
#include <cuda.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int N = 1000;
size_t size = N * sizeof(float);
CSETP stands for Constrol Code Set Predicate. It's a predicate set instruction that works on an special register called cc (Control Code)
it takes 2 input predicates to modify and one extra that's logicaly compared to flag in cc being tested.
Control Code is only updated when the instruction that generates it has bit 47 on. cc apears to be 32 bits wide and the values of cc are:
{ 0x0000000000000000ull, 0x0000000000001f00ull, N("f") },
{ 0x0000000000000100ull, 0x0000000000001f00ull, N("lt") },
{ 0x0000000000000200ull, 0x0000000000001f00ull, N("eq") },
{ 0x0000000000000300ull, 0x0000000000001f00ull, N("le") },
{ 0x0000000000000400ull, 0x0000000000001f00ull, N("gt") },