search for: matmult

Displaying 20 results from an estimated 44 matches for "matmult".

Did you mean: matmul
2008 May 29
1
Problem with .C()
...(Well, it makes it easy to check if one is getting the right answer!) After obtaining some advice from a Certain Very Wise Person at Oxford, (to find out how to deal with array indexing in C functions called from elsewhere) I wrote the following C code: # define MAT(X,I,J,M) (X[(I)+(M)*(J)]) void matmult(x,y,mx,nx,my,ny,z) double *x, *y, *z; int *mx, *nx, *my, *ny; { int vmx, vnx, vmy, vny, i, j, k; vmx = *mx; vnx = *nx; vmy = *my; vny = *ny; for(i=0; i<vmx; i++) { for(j=0; j<vny; j++) { MAT(z,i,j,vmx) = 0.; for(k=0; k<vny; k++) {...
2002 Jun 22
1
Does matmult exist?
Does the function 'matmult' still exist in R? It has a help page and is referenced in the help page for 'kronecker', but I can't seem to access the function itself. Obviously, not an issue of great concern but just a curiosity. > version _ platform i386-pc-mingw32 arch i386...
2012 Sep 19
3
[LLVMdev] counting branch frequencies
Thanks everyone for the replies. After some experimentation, I found that the order in which the passes are specified matters: opt -O3 -profile-loader matmult.bc -o matmult.opt.bc (works) opt -profile-loader -O3 matmult.bc -o matmult.opt.bc (does not work) Also, I am able to avoid the inconsistency warning only for optimization levels -O3 and -O2. I get that warning when using -O1 and -disable-opt. Anyone else have this experience? Or, any ideas why...
2009 Sep 09
2
Matrix multiplication and random numbers
...ness of the different matrices but I think I?m putting the for loop in the wrong place. Also when I try and save the matrices using write.table only the first one is saved The code so far is below, any help would be greatly appreciated Cheers Tom InitialPop<-matrix(c(500,0,0,0,0,0,0)) matmult<-function(InitialPop,N){ mat3<-matrix(c(0,rnorm(1,0.6021,0.0987),0,0,0,0,0,0,0,rnorm(1,0.6021,0.0987),0,0,0,0,1.9,0,0,rnorm(1,0.6021,0.0987),0,0,0,4.8,0,0,0,rnorm(1,0.6021,0.0987),0,0,9.7,0,0,0,0,rnorm(1,0.6021,0.0987),0,18,0,0,0,0,0,rnorm(1,0.6021,0.0987),32.6,0,0,0,0,0,0),nrow=7) for (i in...
2009 Jan 31
1
[LLVMdev] -msse3 can degrade performance
...gt; The -msse3 flag? Does the -msse2 flag have a similar effect? Yes: $ llvm-gcc -Wall -lm -O3 -msse2 *.c -o scimark2 $ ./scimark2 Composite Score: 525.99 FFT Mflops: 538.35 (N=1024) SOR Mflops: 472.29 (100 x 100) MonteCarlo: Mflops: 120.92 Sparse matmult Mflops: 585.14 (N=1000, nz=5000) LU Mflops: 913.27 (M=100, N=100) But -msse does not: $ llvm-gcc -Wall -lm -O3 -msse *.c -o scimark2 $ ./scimark2 Composite Score: 540.08 FFT Mflops: 535.04 (N=1024) SOR Mflops: 469.99 (100 x 100) M...
2009 Jan 31
2
[LLVMdev] -msse3 can degrade performance
...ve Monte Carlo part of the test: $ llvm-gcc -Wall -lm -O3 *.c -o scimark2 $ ./scimark2 Using 2.00 seconds min time per kenel. Composite Score: 432.84 FFT Mflops: 358.90 (N=1024) SOR Mflops: 473.45 (100 x 100) MonteCarlo: Mflops: 210.54 Sparse matmult Mflops: 354.25 (N=1000, nz=5000) LU Mflops: 767.04 (M=100, N=100) $ llvm-gcc -Wall -lm -O3 -msse3 *.c -o scimark2 $ ./scimark2 Composite Score: 548.53 FFT Mflops: 609.87 (N=1024) SOR Mflops: 497.92 (100 x 100) MonteCarlo: Mflop...
2011 Apr 24
2
random roundoff?
...erous matrix multiplications, I have a situation in in which the result depends on the nature of nearby I/O. Thus, with all arithmetic done with type double, and where values are mostly in the range [-1.0e0,+1.0e0] or nearby, I do: cerr << "some stuff" << endl; mat3 = matmult(mat1,mat2); I get a difference of the order 1.0e-15 depending on whether the cerr line does or does not end in "endl" as shown. I am imagining that there is some "randomness" in the roundoff that depends on the I/O situation. Is this credible? Any other suggestions? Thanks...
2012 Sep 19
0
[LLVMdev] counting branch frequencies
...If my assumption is not wrong, is there any way to fix the results? Thanks. -Apala On 09/19/2012 09:53 AM, apala guha wrote: > Thanks everyone for the replies. After some experimentation, I found > that the order in which the passes are specified matters: > > opt -O3 -profile-loader matmult.bc -o matmult.opt.bc (works) > opt -profile-loader -O3 matmult.bc -o matmult.opt.bc (does not work) > > > Also, I am able to avoid the inconsistency warning only for > optimization levels -O3 and -O2. I get that warning when using -O1 and > -disable-opt. > > Anyone else ha...
2012 Sep 19
0
[LLVMdev] counting branch frequencies
Hi Apala, Dibyendu is correct that this is likely due to pass order, but things get a bit complicated with -O[1-9] or -std-compile-opts as they insert early passes *before* the profiling code. I recommend that you use identical optimizations to insert instrumentation and to load the profiling data. E.g.: opt -insert-edge-profiling -O3 foo.bc -o foo.2.bc opt -profile-loader -O3 foo.bc
2009 Jan 31
0
[LLVMdev] -msse3 can degrade performance
On Fri, Jan 30, 2009 at 5:43 PM, Jon Harrop <jon at ffconsultancy.com> wrote: > > I just remembered an anomalous result that I stumbled upon whilst tweaking the > command-line options to llvm-gcc. Specifically, the -msse3 flag The -msse3 flag? Does the -msse2 flag have a similar effect? -Eli
2015 Feb 17
6
[LLVMdev] [3.6 Release] RC3 has been tagged
...rst noticed from the review of 3.6-rc1 at > http://www.phoronix.com/scan.php?page=article&item=llvm-clang-3.5-3.6-rc1). > This same issue has also been reported in > http://llvm.org/bugs/show_bug.cgi?id=22058. In the case of the 22% > performance degradation in SciMark2's Sparse matmult benchmark, I have > identified both commits that contribute equally to this regression in > http://llvm.org/bugs/show_bug.cgi?id=22589... Thank you very much for trying out the release candidate. I asked a few of the other developers, and the consensus was that while unfortunate, we won'...
2009 Feb 04
0
[LLVMdev] -msse3 can degrade performance
...t; performance results completely (still x86): > > $ llvm-gcc -O3 -msse3 -lm all.c -o all > $ ./all > Composite Score: 570.07 > FFT Mflops: 599.40 (N=1024) > SOR Mflops: 476.97 (100 x 100) > MonteCarlo: Mflops: 278.17 > Sparse matmult Mflops: 582.54 (N=1000, nz=5000) > LU Mflops: 913.27 (M=100, N=100) > $ gcc -O3 -msse3 -lm all.c -o all > $ ./all > Composite Score: 539.20 > FFT Mflops: 516.05 (N=1024) > SOR Mflops: 472.29 (100 x 100) > MonteC...
2011 Mar 19
3
How would you avoid loops in this simple example?
I'm trying to code more R-like and avoid loops. Here is an example I'm having a hard time getting away from loops with, and the real matrices are rather large, and the computation is too time-consuming. ### Dimensions N <- 2 M <- 3 P <- 4 ### Array and Matrices nu <- array(NA,dim=c(N,M,P)) Lambda <- matrix(1:12,P,M) F <- matrix(1:8,N,P) ### Loop to avoid for (i in 1:N)
2017 Sep 22
2
S4 method implementation for S3 class
Hi all, I'm trying to implement the matrix multiplication operator, which is S4 generic, for an old-style S3 class. The following works as expected: x <- 1:10 class(x) <- "myClass" setOldClass("myClass") setGeneric("myMethod", function(x, y) standardGeneric("myMethod")) setMethod("myMethod", c("myClass", "myClass"),
2012 Sep 18
4
[LLVMdev] counting branch frequencies
I tried getting profile data from LLVM 3.1, using the method mentioned below. I tried it out on a simple matrix multiplication program. However, I noticed the following problems: 1. There is a warning message: "WARNING: profile information is inconsistent with the current program!" 2. The basic block counts (obtained from ProfileInfo::getExecutionCount(const BasicBlock*)) are
2017 Aug 21
2
Control multi-threading in standard matrix product
...t;> >> I now know that it is possible to control the number of BLAS threads >> thanks to the package 'RhpcBLASctl'. However, being able to control the >> number of threads should maybe not require to use an additional package. >> >> In addition, the doc 'matmult' does not mention this point, it points to >> the 'options' doc page and especially the 'matprod' section, in which >> the multi-threading is not discussed. >> >> >> Here is the results of the 'sessionInfo()' function on my machine for >&...
2017 Aug 21
3
Control multi-threading in standard matrix product
...lti-threading-in-blas-parallel-matrix-product), I now know that it is possible to control the number of BLAS threads thanks to the package 'RhpcBLASctl'. However, being able to control the number of threads should maybe not require to use an additional package. In addition, the doc 'matmult' does not mention this point, it points to the 'options' doc page and especially the 'matprod' section, in which the multi-threading is not discussed. Here is the results of the 'sessionInfo()' function on my machine for R-3.4.1: R version 3.4.1 (2017-06-30) Platfor...
2017 Sep 22
2
S4 method implementation for S3 class
...xplanation. > In general, it's best to define an S4 class when using S4 dispatch, > but it sounds like you're stuck using some legacy S3 objects. In that > case, one would normally define an S3 method for `%*%()` that > delegates to a custom non-primitive generic, perhaps "matmult" in this > case. But since %*% is not an S3 generic, that's not an option. > > It would help to hear more about the context of the problem. This is a problem that Edzer Pebesma and I are facing in our packages units and errors respectively (you can find both on CRAN). They are de...
2020 Mar 26
2
unstable corner of parameter space for qbeta?
...version of 'Rmpfr' on R-forge now > contains facilities to enlarge the precision of the computations > by a factor 'fPrec' with default 'fPrec = 1'; > notably, instead of x %*% y (where the `%*%` cannot have more > than two arguments) does have a counterpart matmult(x,y, ....) > which allows more arguments, namely 'fPrec', or directly 'precBits'; > and of course there are crossprod() and tcrossprod() one should > use when applicable and they also got the 'fPrec' and > 'precBits' arguments. > > {The %*% etc p...
2017 Aug 21
1
Control multi-threading in standard matrix product
Hi Ista, Maybe a little comment in the 'matmult {base}' doc page or on the 'options {base}' in the field 'matprod' would be useful to remind users to be cautious regarding BLAS multi-threading? I understand why this is a BLAS related issue and not directly an R related issue. Nonetheless, my concern was for non-advanced R...