comparison src/of-fl-core-1-fixes.patch @ 4043:b54e00ea56bc

of-fl-core: readd fl-core patch in dos mode * src/of-fl-core-1-fixes.patch: readd patch
author John Donoghue
date Fri, 02 Oct 2015 10:24:38 -0400
parents 1c72016826aa
children
comparison
equal deleted inserted replaced
4042:320b6359718e 4043:b54e00ea56bc
1 diff -ur fl-core/src/Makefile fl-core.new/src/Makefile
2 --- fl-core/src/Makefile 2011-02-06 14:09:03.000000000 -0500
3 +++ fl-core.new/src/Makefile 2015-03-20 13:45:48.577323118 -0400
4 @@ -1,15 +1,23 @@
5 OCT = fl_compose.oct
6 SRC := $(OCT:.oct=.cc)
7 BASE := $(OCT:.oct=)
8 -ifdef COMSPEC
9 +
10 +MKOCTFILE ?= mkoctfile
11 +OCTAVE_CONFIG ?= octave-config
12 +
13 +ifneq (,$(findstring mingw,$(shell $(OCTAVE_CONFIG) -p CANONICAL_HOST_TYPE)))
14 + ADDPARAM := -lpthread
15 +else
16 + ifdef COMSPEC
17 ADDPARAM := -lpthreadVC2
18 + endif
19 endif
20
21 .phony: all
22 all: $(OCT)
23
24 %.oct: %.cc
25 - mkoctfile -s $< $(ADDPARAM)
26 + $(MKOCTFILE) -s $< $(ADDPARAM)
27
28 .phony: clean
29 clean:
30 Only in fl-core.orig: fl-core
31 diff -ur fl-core.orig/src/fl_compose.cc fl-core/src/fl_compose.cc 1 diff -ur fl-core.orig/src/fl_compose.cc fl-core/src/fl_compose.cc
32 --- fl-core.orig/src/fl_compose.cc 2015-03-20 13:43:53.970074780 -0400 2 --- fl-core.orig/src/fl_compose.cc 2015-10-02 10:13:53.044225859 -0400
33 +++ fl-core/src/fl_compose.cc 2015-09-30 13:51:56.498187582 -0400 3 +++ fl-core/src/fl_compose.cc 2015-10-02 10:22:05.635130470 -0400
34 @@ -63,14 +63,14 @@ 4 @@ -63,14 +63,14 @@
35 // Structure for thread arguments. Each thread will perform the computation between the start_index and end_index row. 5 // Structure for thread arguments. Each thread will perform the computation between the start_index and end_index row.
36 struct threadArg 6 struct threadArg
37 { 7 {
38 - int start_index; 8 - int start_index;
64 -int col_index_increment; 34 -int col_index_increment;
65 +octave_idx_type col_index_increment; 35 +octave_idx_type col_index_increment;
66 36
67 // Number of threads that will be created 37 // Number of threads that will be created
68 int num_threads; 38 int num_threads;
69 @@ -357,8 +357,8 @@ 39 @@ -357,8 +357,9 @@
70 else 40 else
71 { 41 {
72 Matrix outMatrix(rowsC,colsC); 42 Matrix outMatrix(rowsC,colsC);
73 - for(int i=0;i<rowsC;i++) 43 - for(int i=0;i<rowsC;i++)
74 - for(int j=0;j<colsC;j++) 44 - for(int j=0;j<colsC;j++)
45 +
75 + for(octave_idx_type i=0;i<rowsC;i++) 46 + for(octave_idx_type i=0;i<rowsC;i++)
76 + for(octave_idx_type j=0;j<colsC;j++) 47 + for(octave_idx_type j=0;j<colsC;j++)
77 outMatrix(i,j) = get_elem(c,i,j,colsC); 48 outMatrix(i,j) = get_elem(c,i,j,colsC);
78 49
79 if(sparse_res) 50 if(sparse_res)
80 @@ -390,15 +390,15 @@ 51 @@ -390,15 +391,15 @@
81 // Initialize the first matrix 52 // Initialize the first matrix
82 Matrix tempMatrix = args(0).matrix_value(); 53 Matrix tempMatrix = args(0).matrix_value();
83 a = new float[rowsA*colsA]; 54 a = new float[rowsA*colsA];
84 - for (int i=0; i<rowsA; i++) 55 - for (int i=0; i<rowsA; i++)
85 - for(int j=0; j<colsA;j++) 56 - for(int j=0; j<colsA;j++)
95 + for (octave_idx_type i=0; i<rowsB; i++) 66 + for (octave_idx_type i=0; i<rowsB; i++)
96 + for(octave_idx_type j=0; j<colsB;j++) 67 + for(octave_idx_type j=0; j<colsB;j++)
97 b[i*colsB+j] = tempMatrix(i,j); 68 b[i*colsB+j] = tempMatrix(i,j);
98 69
99 70
100 @@ -418,7 +418,7 @@ 71 @@ -418,7 +419,7 @@
101 } 72 }
102 73
103 // Define the number interval of rows for each thread 74 // Define the number interval of rows for each thread
104 - int interval = rowsA / num_threads; 75 - int interval = rowsA / num_threads;
105 + octave_idx_type interval = rowsA / num_threads; 76 + octave_idx_type interval = rowsA / num_threads;
106 77
107 int i; 78 int i;
108 // Define the threads 79 // Define the threads
109 @@ -465,22 +465,22 @@ 80 @@ -465,22 +466,22 @@
110 float tnorm_val; 81 float tnorm_val;
111 82
112 // Initialize the result sparse matrix 83 // Initialize the result sparse matrix
113 - sparseC = SparseMatrix((int)colsB, (int)rowsA, (int)(colsB*rowsA)); 84 - sparseC = SparseMatrix((int)colsB, (int)rowsA, (int)(colsB*rowsA));
114 + sparseC = SparseMatrix(colsB, rowsA, (colsB*rowsA)); 85 + sparseC = SparseMatrix(colsB, rowsA, (colsB*rowsA));
132 + octave_idx_type ka = a.cidx(i); 103 + octave_idx_type ka = a.cidx(i);
133 + octave_idx_type kb = b.cidx(j); 104 + octave_idx_type kb = b.cidx(j);
134 snorm_val = 0; 105 snorm_val = 0;
135 106
136 // Check if the values of the matrix are really not 0 (it happens if the column of a or b hasn't any value) 107 // Check if the values of the matrix are really not 0 (it happens if the column of a or b hasn't any value)
137 @@ -549,18 +549,18 @@ 108 @@ -549,18 +550,18 @@
138 float tnorm_val; 109 float tnorm_val;
139 110
140 // Get the row start_index and end_index 111 // Get the row start_index and end_index
141 - int start_index = thread_args->start_index; 112 - int start_index = thread_args->start_index;
142 - int end_index = thread_args->end_index; 113 - int end_index = thread_args->end_index;
156 - for(int k=1; k<colsA; k++) 127 - for(int k=1; k<colsA; k++)
157 + for(octave_idx_type k=1; k<colsA; k++) 128 + for(octave_idx_type k=1; k<colsA; k++)
158 { 129 {
159 tnorm_val = calc_tnorm(get_elem(a,i,k,colsA),get_elem(b,k,j,colsB)); 130 tnorm_val = calc_tnorm(get_elem(a,i,k,colsA),get_elem(b,k,j,colsB));
160 snorm_val = calc_snorm(snorm_val,tnorm_val); 131 snorm_val = calc_snorm(snorm_val,tnorm_val);
161 @@ -767,7 +767,7 @@ 132 @@ -767,7 +768,7 @@
162 133
163 134
164 /* Get the (i,j)-th element from the vector vec. The column number of the original matrix (numCols) is required */ 135 /* Get the (i,j)-th element from the vector vec. The column number of the original matrix (numCols) is required */
165 -float get_elem(float vec[], int row, int col,int numCols) 136 -float get_elem(float vec[], int row, int col,int numCols)
166 +float get_elem(float vec[], octave_idx_type row, octave_idx_type col,octave_idx_type numCols) 137 +float get_elem(float vec[], octave_idx_type row, octave_idx_type col,octave_idx_type numCols)
167 { 138 {
168 return vec[row*numCols+col]; 139 return vec[row*numCols+col];
169 } 140 }
170 @@ -775,7 +775,7 @@ 141 @@ -775,7 +776,7 @@
171 142
172 143
173 /* Set the (i,j)-th element from the vector vec. The column number of the original matrix (numCols) is required */ 144 /* Set the (i,j)-th element from the vector vec. The column number of the original matrix (numCols) is required */
174 -void set_elem(float vec[], int row, int col, int numCols, float elem) 145 -void set_elem(float vec[], int row, int col, int numCols, float elem)
175 +void set_elem(float vec[], octave_idx_type row, octave_idx_type col, octave_idx_type numCols, float elem) 146 +void set_elem(float vec[], octave_idx_type row, octave_idx_type col, octave_idx_type numCols, float elem)
176 { 147 {
177 vec[row*numCols+col] = elem; 148 vec[row*numCols+col] = elem;
178 return; 149 return;
150 diff -ur fl-core.orig/src/Makefile fl-core/src/Makefile
151 --- fl-core.orig/src/Makefile 2015-10-02 10:13:53.044225859 -0400
152 +++ fl-core/src/Makefile 2015-10-02 10:16:20.899198805 -0400
153 @@ -1,15 +1,23 @@
154 OCT = fl_compose.oct
155 SRC := $(OCT:.oct=.cc)
156 BASE := $(OCT:.oct=)
157 -ifdef COMSPEC
158 - ADDPARAM := -lpthreadVC2
159 +
160 +MKOCTFILE ?= mkoctfile
161 +OCTAVE_CONFIG ?= octave-config
162 +
163 +ifneq (,$(findstring mingw,$(shell $(OCTAVE_CONFIG) -p CANONICAL_HOST_TYPE)))
164 + ADDPARAM := -lpthread
165 +else
166 + ifdef COMSPEC
167 + ADDPARAM := -lpthreadVC2
168 + endif
169 endif
170
171 .phony: all
172 all: $(OCT)
173
174 %.oct: %.cc
175 - mkoctfile -s $< $(ADDPARAM)
176 + $(MKOCTFILE) -s $< $(ADDPARAM)
177
178 .phony: clean
179 clean: