more on Win64 and var() actors

15 views
Skip to first unread message

Bob Carpenter

unread,
Mar 4, 2015, 5:23:13 PM3/4/15
to stan...@googlegroups.com
Ben inspired me to try again with ifdefs. I'm optimistic the
current pull request will work with this:

#ifdef _WIN64
// in WIN64, size_t = unsigned long long, which is a C++11
// feature, so use this ctor to enable it
var(size_t x) : vi_(new vari(static_cast<double>(x))) { }
var(ptrdiff_t x) : vi_(new vari(static_cast<double>(x))) { }
#endif


The one that just failed was missing ptrdiff_t, which is the signed
type big enough to hold pointer differences. On non-windows, this
is (long int); on Windows, it's (long long int).

The built-in type ptrdiff_t is equal to (long long int) without
triggering C++11 warnings. But we can't use it on anything but
Windows, because then there's ambiguity with (long int).

- Bob

P.S. The bigger issue is that there are issues with the way we do arithmetic.
I think I'll try to fix that next as it should make a huge difference
in speed. So should rewriting the way we do transforms with custom
(vectorized) derivatives. And I'm also going to work on getting the
line-number errors in along the lines of Marcus's suggestions.

Alas, none of this is getting us closer to new features of the language,
just better speed and better error reporting. For me, this is more
important than new features, but I should be available again for new
features in a few weeks once I knock off these two issues.

Now, off to do yet another talk on Stan in Sydney. They love us here!

Bob Carpenter

unread,
Mar 4, 2015, 6:52:14 PM3/4/15
to stan...@googlegroups.com
Nice, the unit tests passed and I'm optimistic the 6 hours of
distribution tests will pass if the unit tests passed (famous
last words if ever there were ones).

- Bob
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Reply all
Reply to author
Forward
0 new messages