Changeset: 76f442fe79e9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=76f442fe79e9
Modified Files:
        monetdb5/extras/bwd/cl_program_utilities.c
        monetdb5/extras/bwd/operations.c
        monetdb5/extras/bwd/utilities.c
        monetdb5/mal/mal_interpreter.mx
Branch: bwd
Log Message:

* merge


Unterschiede (107 Zeilen):

diff --git a/monetdb5/extras/bwd/cl_program_utilities.c 
b/monetdb5/extras/bwd/cl_program_utilities.c
--- a/monetdb5/extras/bwd/cl_program_utilities.c
+++ b/monetdb5/extras/bwd/cl_program_utilities.c
@@ -330,8 +330,8 @@ cl_program getHistogramCompactionProgram
                "  if(oldHistogramCounts[inputIndex] > 0){"
                "    atomic_inc(newHistogramCounts);"
                "    const unsigned int newSlot = atomic_inc(newHistogramOIDs);"
-               "    newHistogramOIDs[newSlot] = oldHistogramOIDs[inputIndex];"
-               "    newHistogramCounts[newSlot] = 
oldHistogramCounts[inputIndex];"
+               "    newHistogramOIDs[newSlot+2] = 
oldHistogramOIDs[inputIndex+2];"
+               "    newHistogramCounts[newSlot+2] = 
oldHistogramCounts[inputIndex+2];"
                "  }"
                "}\n";
        return compileProgram(sourceCode, "");
diff --git a/monetdb5/extras/bwd/operations.c b/monetdb5/extras/bwd/operations.c
--- a/monetdb5/extras/bwd/operations.c
+++ b/monetdb5/extras/bwd/operations.c
@@ -30,7 +30,8 @@ static const int WORK_GROUP_SIZE=128;
 const int VALUES_PER_WORK_ITEM = 1;
 extern const int VALUES_PER_WORK_ITEM;
 #endif
-#define MAX_INTERMEDIATE_RESULT_SIZE 16777216
+/* #define MAX_INTERMEDIATE_RESULT_SIZE 16777216 */
+#define MAX_INTERMEDIATE_RESULT_SIZE 59142609
 
 #pragma mark Actual MAL Operations Implementation
 
@@ -98,8 +99,6 @@ clTail* getApproximateValuesColumn(cl_me
        return buffer;
 }
 
-
-
 #ifndef CL_API_SUFFIX__VERSION_1_2
 cl_int clEnqueueFillBuffer(cl_command_queue    command_queue ,
                     cl_mem              buffer , 
@@ -1540,6 +1539,22 @@ str BWDMulticolumnGroupApproximate(Clien
                                assert(histogramSlot->headApproximation);
                                assert(histogramSlot->tailPositions);
                                assert(getCount(histogramSlot->tailPositions) 
== getCount(histogramSlot->tailApproximation));
+                               if(0){//print histogram
+                                       clHead* positions;
+                                       clTail* counts;
+                                       size_t bufferSize;
+                                       int i;
+                                       
getPositionsColumn(batHeadApproximation(histo), NULL, &bufferSize);
+                                       positions = 
getPositionsColumn(batHeadApproximation(histo), GDKmalloc(bufferSize), 
&bufferSize);
+                                       
getApproximateValuesColumn(batTailApproximation(histo), NULL, &bufferSize);
+                                       counts = 
getApproximateValuesColumn(batTailApproximation(histo), GDKmalloc(bufferSize), 
&bufferSize);
+                                       for (i = 0; i < positions->count; ++i)
+                                               if(((unsigned 
int*)counts->elements)[i])
+                                                       printf ("%u: %u, 
(i=%u)\n", positions->positions[i], ((unsigned int*)counts->elements)[i], i);
+
+                                       GDKfree(positions);
+                                       GDKfree(counts);
+                               }
 
                        }
                        BBPkeepref(*retbid = groupIDs->batCacheid);
diff --git a/monetdb5/extras/bwd/utilities.c b/monetdb5/extras/bwd/utilities.c
--- a/monetdb5/extras/bwd/utilities.c
+++ b/monetdb5/extras/bwd/utilities.c
@@ -102,10 +102,17 @@ const char* clError(int err){
        }
 }
 
+char* humanreadablesize(unsigned int value, char* buffer, size_t bufferSize){
+       snprintf(buffer, bufferSize, "%d %s", 
(value<1024)?value:((value<(1024*1024))?(value/1024):(value/(1024*1024))), 
(value<1024)?"byte":((value<(1024*1024)?"kb":"Mb")));
+       return buffer;
+}
+
 
 cl_mem bwdClCreateBuffer(cl_context context, cl_mem_flags flags, size_t size, 
void *host_ptr,  cl_int *errcode_ret){
        cl_mem result = clCreateBuffer (context, flags, size, 
host_ptr,errcode_ret);
-       printf ("created cl_mem %p of size %ld\n", result, size);
+       char buffer[64];
+       humanreadablesize(size, buffer, 64);
+       printf ("created cl_mem %p of size %s\n", result, buffer);
        return result;
 }
 
@@ -331,10 +338,6 @@ bounds findBounds(const int* subject, co
 }
 
 
-char* humanreadablesize(unsigned int value, char* buffer, size_t bufferSize){
-       snprintf(buffer, bufferSize, "%d %s", 
(value<1024)?value:((value<(1024*1024))?(value/1024):(value/(1024*1024))), 
(value<1024)?"byte":((value<(1024*1024)?"kb":"Mb")));
-       return buffer;
-}
 
 void forceLoadOntoGPU(clTail* approximation, const size_t approximationSize, 
DecomposedBATSlot* slot){ 
        cl_program program = NULL;
diff --git a/monetdb5/mal/mal_interpreter.mx b/monetdb5/mal/mal_interpreter.mx
--- a/monetdb5/mal/mal_interpreter.mx
+++ b/monetdb5/mal/mal_interpreter.mx
@@ -2177,6 +2177,11 @@ cntxt);
                        "address of pattern %s.%s missing", pci->modname, 
pci->fcnname);
        } else {
                @:safeTarget(@1)@
+               {
+               char* text = instruction2str(mb, stk, pci, LIST_MAL_EXPLAIN);
+               printf("%s\n", text);
+               GDKfree(text);
+       }       
                ret = (str)(*pci->fcn)(cntxt, mb, stk, pci);
                @:restoreTarget(@1,@3)@
        }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to