search for: func1

Displaying 20 results from an estimated 106 matches for "func1".

Did you mean: func
2015 Apr 19
2
[LLVMdev] LLVM IR for inline functions
Hi, I have a naive question on how to generate LLVM IR for inline functions. I have compiled this C code: *inline void func1()* * {* * int x=3;* * }* * void func2()* * {* * func1();* * int y = 4;* * }* into LLVM IR, using clang -emit-llvm -S -c <filename> But the generated LLVM IR file does *not* have func1() expanded (see below for the relevant parts). *; Function Attrs: nounwind uwtable* * define void @func2...
2005 Jul 22
1
multiplicate 2 functions
Thks for your answer, here is an exemple of what i do with the errors in french... > tmp [1] 200 150 245 125 134 345 320 450 678 > beta18 Erreur : Objet "beta18" not found //NORMAL just to show it > eta [1] 500 > func1<-function(beta18) dweibull(tmp[1],beta18,eta) > func1<-func1(beta18) * function(beta18) dweibull(tmp[2],beta18,eta) Erreur dans dweibull(tmp[1], beta18, eta) : Objet "beta18" not found //I don't want to evaluate weibull immediatly just want to initialize the function then...
2013 Oct 29
1
[LLVMdev] JIT'ing 2 functions with inter-dependencies
I am having problems JIT'ing 2 functions where one of them calls the other. (I am using the old JIT interface). Here is the setup: define void @func1() { entrypoint: call void @func2(void) ret void } define void @func2(void) { entrypoint: ret void } (I omit the arguments and function bodies for simplicity.) It's 'func1' that would be called from host code, 'func2' gets only called from 'func1'. The time...
2011 Sep 06
2
Generalizing call to function
Hello guys, I would like to ask for help to understand what is going on in "func2". My plan is to generalize "func1", so that are expected same results in "func2" as in "func1". Executing "func1" returns... 0.25 with absolute error < 8.4e-05 But for "func2" I get... Error in dpois(1, 0.1, 23.3065168689948, 0.000429064542600244, 3.82988398013855, : unused argum...
2000 Sep 06
2
reusing external functions across libs
...be nice if I could call the function directly from C/Fortran, after dyn.load()ing both libraries. But unfortunately this seems to depend very crucially on the specific OS. An example (C/Fortran mix, but I tried also C/C and Fortran/Fortran): **** so1.c ******************* #include <R.h> void func1(double* a, int* n){ printf("in func1\n"); F77_SYMBOL(func2)(a,n); printf("back in func1\n"); } ****************************** gcc -g -fpic -c so1.c -I/usr/local/lib/R/include ld -shared so1.o -o so1.so **** so2.f ******************* subroutine func2(a,n) real*8...
2013 Oct 31
1
an rpy2, R cgi type question
...alue="Integrate" /> Integrate <input type="radio" name="subject" value="Differentiate" /> Differentiate <input type="radio" name="subject" value="Graph" /> Graph Function <input type="text" name="func1" <br /> <input type="submit" value="Select Subject" /> </form> Now the radio4.py file: # Import modules for CGI handling import cgi, cgitb from sympy import * import sys from rpy2.robjects.packages import SignatureTranslatedAnonymousPackage as STAP with...
2008 Jun 06
1
calling a C function with a struct
...ld be passed directly to the function. Here is some more detail. The C struct is simple, but has mixed types: struct STRUCT1 { long type; long nx; double *x; double a; double b; }; typedef struct STRUCT1 STRUCT1_TYPE; The C function header is void func1( long method, STRUCT1 my_struct, double *output); I would like to have an R list mimicking the C struct, and then use .C to call func1 with this information, e.g. my.struct <- list(type=3,nx=5,x=1:5,a=2.5,b=8.3) my.func1( 3, convert2raw( my.struct ), ) where R function convert2raw wo...
2007 Nov 26
3
Communicating from one function to another
...ge? Suppose the variable is called x23. I want to assign a value to it, then use it later. Seemingly, there are two cases: Case I is if the variable is given its value at the top level. Case II is if it is given its value inside a user-defined function. That I do not know how to do. Example: func1 <- function (){ x23 <- 2.6 return () } driver_func <- function (){ func1 () print (x23) return () } However, when I call driver_func, it won't work. Beginning with the load operation, I get: ---------------------------------------------------------------- Type 'demo()...
2009 Sep 14
1
[LLVMdev] How to split module?
Hi, all. My question is about how to split one module into N modules(N >= 2)? For example, given the following code: #src.c# int main() { //......// func1(); func2(); //......// return 0; } void func1() { //......// } void func2() { //......// } func1() has no dependence with func2(), so they can perform parallel execution. And I have to split src.c into src1.c and src2.c instead of using thread library, because the target mach...
2009 Sep 24
2
more strange behavior of Revolution R 1.3.0
It runs more than twice as slowly using 8 core than using a single core in inverting large matrix. Tested on 8 core Windows XP 64 machine. > n = 1000 > n.simu = 100 > func1 = function() + { + x = rnorm(n*n) + dim(x)=c(n,n) + y = solve(x) + } > > setMKLthreads(1) > system.time(for(i in 1:n.simu) func1()) user system elapsed 69.48 2.42 71.91 > > setMKLthreads(8) > system.time(for(i in 1:n.simu) func1()) user syste...
2011 Feb 17
1
Integrate with an indicator function
Hi all, I have some some problem with regard to finding the integral of a function containing an indicator function. please see the code below: func1 <- function(x, mu){ (mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)} m1star <- function(x){ integrate(func1, lower = 0, upper = Inf,x)$val} T <- function(x){ 0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))} func2 <- function(x,c){(T(x) <=c)*0.3*dnorm(x)} func3 <- function...
2003 Jun 09
1
Questions for package ts prediction
Dear helpers, I am trying to write a function to return prediction values using package ts. I have written three different versions since I am not sure what's wrong with my func2. func and func1 return the same results.But func1 and func2 don't. In particular, the only difference between "func1" and "func2" is the function variable name being y and data, respectively. But running the last line of the following script will give the message: Error in ts(x): object i...
2011 Feb 17
1
Integration with an Indicator Function in R
Hi all, I have some some problem with regard to finding the integral of a function containing an indicator function. please see the code below: func1 <- function(x, mu){ (mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)} m1star <- function(x){ integrate(func1, lower = 0, upper = Inf,x)$val} T <- function(x){ 0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))} func2 <- function(x,c){(T(x) <=c)*0.3*dnorm(x)} func3 <- function...
2007 Jun 01
2
Getting names of objects passed with "..."
Is there a tidy way to get the names of objects passed to a function via the "..." argument? rbind/cbind does what I want: test.func1 <- function(...) { nms <- rownames(rbind(..., deparse.level=1)) print(nms) } x <- "some stuff" second <- "more stuff" test.func1(first=x, second) [1] "first" "second" The usual 'deparse(substitute())' doesn't do it: test.fun...
2010 May 08
3
Count cases in a list
Hi everybody, I would like to count how many times names in list L, nombreL, apear in list C, nombreC. Can I improve the next program? cuenta <- 0 topL <- length(nombreL) topC <- length(nombreC) for (i in 1:topL) { for (j in 1:topC) { k <- grep(noquote(nombreL[i]),nombreC[j])
2010 Jun 16
3
[LLVMdev] Strange pointer aliasing behaviour
...LittleList1( int length ) { _length = length; for( int i=0; i<length; i++ ) _data[i] = 0; } }; class LittleList2 { public: int _length; double _data[ little_list_size ]; LittleList2( int length ) { _length = length; for( int i=0; i<_length; i++ ) _data[i] = 0; } }; int func1() { LittleList1 l(4); return l._length; } int func2() { LittleList2 l(4); return l._length; } /* END SOURCE CODE */ The only difference between the 2 classes is in the constructor, in the line : for( int i=0; i<_length; i++ ) One has "length" which is a function parameter, t...
2013 Mar 11
1
[LLVMdev] AESOP autoparallelizing compiler
...> So, I set inline threshold to zero and tried out following example > =============================================== > #define N 1024 > void func(double *A, double *B) > { > int i; > for (i=1; i<N-2; i++) { > B[i] = A[i] + i*3; > } > } > > void func1(double *A, double *B) > { > func(A,B); > } > > int main(void) > { > double data[N]; > double data1[N]; > double result=0; > int i; > > for (i=0; i<N; i++) { > result += i*3; > data[i] = result; > } > func1(data, data1);...
2006 Jun 15
2
[LLVMdev] problem with loopinfo
...of a simple program constructed by me, can you help me to figure out why this happened? Thanks. The C program and corresponding .ll files are shown below. I used llvm1.7 to develop my own pass, and want to use the loop information. -Wei Test.c: #include "stdio.h" #define N 40 void func1() { int a[N]; int i,j; for (i=0; i<N; i++) { if (i==0) a[i] = i*N; else a[i] = i*i; } } Test.ll: void %func1() { entry: %a = alloca [40 x int] ; <[40 x int]*> [#uses=1] br label %no_exit no_exit: ; preds = %else,...
2011 Nov 21
2
[LLVMdev] Optimization of array access
...42; And Int I = 0; Stack[i++] = 0; Stack[i++] = 1; Stack[i++] = 42; I’ve found that the optimizer is much faster at handling the 2nd pattern than the 1st. With 3000 assignments - as in the examples attached – “opt –std-compile-opts –S func1.ll –o func1.opt” takes 10 seconds, while func2.ll takes 0.2s. Anyone have any ideas why? I’ve tested with LLVM 2.9, and LLVM 3.0 RC1. Regards, Michael <opt.zip> _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.e...
2011 Nov 21
3
[LLVMdev] Optimization of array access
...Int I = 0; Stack[i++] = 0; Stack[i++] = 1; Stack[i++] = 42; I've found that the optimizer is much faster at handling the 2nd pattern than the 1st. With 3000 assignments - as in the examples attached - "opt -std-compile-opts -S func1.ll -o func1.opt" takes 10 seconds, while func2.ll takes 0.2s. Anyone have any ideas why? I've tested with LLVM 2.9, and LLVM 3.0 RC1. Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/...