MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / handleReduceSumReal

Method handleReduceSumReal

src/library/blas/gens/kprintf.cpp:1533–1572  ·  view source on GitHub ↗

scalar = %REDUCE_SUM_REAL_HV(half-vector), %REDUCE_SUM_REAL_V(vector)

Source from the content-addressed store, hash-verified

1531// scalar = %REDUCE_SUM_REAL_HV(half-vector), %REDUCE_SUM_REAL_V(vector)
1532//
1533void kprintf::handleReduceSumReal(char **_src, char **_dst, int vlength)
1534{
1535 int numCharsWritten = 0;
1536 char id1[256];
1537 char * ptr;
1538 char *src = *_src;
1539 char *dst = *_dst;
1540
1541
1542 ptr = mystrtok( src, "(,)");
1543 ptr = mystrtok( NULL, "(,)"); // Get first ID
1544 strcpy( id1, ptr);
1545 *_src = ptr + strlen(ptr) + 1;
1546
1547 if (!vlength) //Can happen for SCALAR cases where source code contains this within COMPLEX define
1548 {
1549 //
1550 // Don't generate a thing.
1551 // The src pointer has already been advanced to next line
1552 // Just move on..
1553 //
1554 return;
1555 }
1556
1557 if (vlength != 1)
1558 {
1559 for( int i = 0 ; i < (vlength - 1); i++)
1560 {
1561 numCharsWritten = sprintf(dst,"(%s).%s + ", id1, vecIndices[i]);
1562 dst += numCharsWritten;
1563 }
1564 numCharsWritten = sprintf(dst,"(%s).%s;\n", id1, vecIndices[ (vlength - 1)]);
1565 dst += numCharsWritten;
1566 } else {
1567 numCharsWritten = sprintf(dst,"(%s);\n ", id1);
1568 dst += numCharsWritten;
1569 }
1570
1571 *_dst = dst;
1572}
1573
1574void kprintf::handleCONJUGATE(char **_src, char **_dst)
1575{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected