[Gridflow-cvs] [svn] commit: r3940 - in /trunk: base/flow_objects.c base/grid.c gridflow.h optional/fftw.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Jun 25 14:48:15 EDT 2008


Author: matju
Date: Wed Jun 25 14:48:14 2008
New Revision: 3940

Log:
move CHECK_ALIGN to gridflow.h

Modified:
    trunk/base/flow_objects.c
    trunk/base/grid.c
    trunk/gridflow.h
    trunk/optional/fftw.c

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Wed Jun 25 14:48:14 2008
@@ -156,9 +156,9 @@
 \def 0 to_ascii(...) {
 	std::ostringstream os;
 	pd_oprint(os,argc,argv);
-	long n = os.str().length();
+	string s = os.str();
+	long n = s.length();
 	if (!dim) out=new GridOutlet(this,0,new Dim(n),cast);
-	string s = os.str();
 	process(n,(uint8 *)s.data());
 }
 

Modified: trunk/base/grid.c
==============================================================================
--- trunk/base/grid.c (original)
+++ trunk/base/grid.c Wed Jun 25 14:48:14 2008
@@ -47,6 +47,7 @@
 #define CHECK_BUSY(s) \
 	if (!dim) RAISE("%s: " #s " not busy (wanting to write %ld values)",ARGS(parent),(long)n);
 
+#undef CHECK_ALIGN
 #define CHECK_ALIGN(d) \
 	{int bytes = number_type_table[nt].size/8; \
 	int align = ((long)(void*)d)%bytes; \
@@ -301,6 +302,7 @@
 	if (!dim->prod()) {finish(); return;}
 	int32 lcm_factor = 1;
 	for (uint32 i=0; i<inlets.size(); i++) lcm_factor = lcm(lcm_factor,inlets[i]->factor());
+	//size_t ntsz = number_type_table[nt].size;
 	// biggest packet size divisible by lcm_factor
 	int32 v = (MAX_PACKET_SIZE/lcm_factor)*lcm_factor;
 	if (v==0) v=MAX_PACKET_SIZE; // factor too big. don't have a choice.
@@ -312,7 +314,7 @@
 void GridOutlet::send_direct(long n, T *data) {TRACE;
 	CHECK_BUSY(outlet); CHECK_TYPE(*data); CHECK_ALIGN(data);
 	for (; n>0; ) {
-		long pn = min((long)n,MAX_PACKET_SIZE);
+		long pn = n;//min((long)n,MAX_PACKET_SIZE);
 		for (uint32 i=0; i<inlets.size(); i++) try {inlets[i]->flow(4,pn,data);} CATCH_IT;
 		data+=pn, n-=pn;
 	}

Modified: trunk/gridflow.h
==============================================================================
--- trunk/gridflow.h (original)
+++ trunk/gridflow.h Wed Jun 25 14:48:14 2008
@@ -820,6 +820,12 @@
 	if (in.size()<=i) in.resize(i+1); \
 	if (!in[i]) in[i]=new GridInlet((FObject *)this,&class##_grid_##i##_hand);
 
+#define CHECK_ALIGN(d,nt) \
+	{int bytes = 16; \
+	int align = ((ulong)(void*)d)%bytes; \
+	if (align) {_L_;post("%s(%s): Alignment Warning: %s=%p is not %d-aligned: %d", \
+		ARGS(this), __PRETTY_FUNCTION__,#d,(void*)d,bytes,align);}}
+
 struct BFProxy;
 struct BFObject : t_object {
 	void *gemself; // this absolutely needs to be the first field, to make GEM happy

Modified: trunk/optional/fftw.c
==============================================================================
--- trunk/optional/fftw.c (original)
+++ trunk/optional/fftw.c Wed Jun 25 14:48:14 2008
@@ -23,12 +23,6 @@
 #include <fftw3.h>
 
 typedef unsigned long ulong;
-
-#define CHECK_ALIGN(d,nt) \
-	{int bytes = 16; \
-	int align = ((ulong)(void*)d)%bytes; \
-	if (align) {_L_;post("%s(%s): Alignment Warning: %s=%p is not %d-aligned: %d", \
-		ARGS(this), __PRETTY_FUNCTION__,#d,(void*)d,bytes,align);}}
 
 \class GridFFT : FObject {
 	fftwf_plan plan;



More information about the Gridflow-cvs mailing list