Skip to content

Conversation

@notoraptor
Copy link
Contributor

Add GPUARRAY_ABI_VERSION and pygpu.gpuarray.abi_version() method to handle ABI version in gpuarray. A new header file (abi_version.h) auto-generated by CMake has been added for this purpose.

These changes must allow to fix Theano issue Theano/Theano#5345 . A related Theano PR is coming.

@abergeron @nouiz

pygpu.gpuarray.abi_version() method.

A new header file (abi_version.h) auto-generated by CMake
has been added.
@@ -0,0 +1,3 @@
#ifndef GPUARRAY_ABI_VERSION
#define GPUARRAY_ABI_VERSION "1.0"
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file should not be commited. Add it in the .gitignore file to help prevent readding it.


/* The following included file should have been generated by CMake. */
#include <gpuarray/abi_version.h>
#define GPUARRAY_API_VERSION 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this line, as it should be in the included file. Otherwise, it is an error and not having it with a wrong value should help with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The included file contains GPUARRAY_ABI_VERSION only, not API version !


get_target_property(GPUARRAY_ABI_VERSION gpuarray VERSION)
FILE(WRITE gpuarray/abi_version.h
"\#ifndef GPUARRAY_ABI_VERSION\n\#define GPUARRAY_ABI_VERSION \"${GPUARRAY_ABI_VERSION}\"\n\#endif\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it an int like (major * 1000 + minor). Having it as a string is just super inconvenient for most uses.

.gitignore Outdated
*.so
*.o
*.log
src/gpuarray/abi_version.h
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Group this with the other file in src below.

@abergeron
Copy link
Member

I'm ok with the idea, just don't use strings.

Change ABI minor version (1.0 -> 1.1) to make some tests.
MACOSX_RPATH OFF
# This is the shared library version
VERSION 1.0
VERSION 1.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't warrant an ABI change. This is an API change.

(equals to the first part of VERSION). Now
the built library file is named libgpuarray.so.SOVERSION,
that is libgpuarray.so.ABIMAJOR.
@notoraptor
Copy link
Contributor Author

Update. Add CMake variable SOVERSION (auto-generated and equals to the first part of VERSION, so that VERSION still remains the only variable to update when changing gpuarray ABI version).

Now the fix for theano issue Theano/Theano#5345 works ! Theano does not recompile if VERSION changes from 1.X to 1.Y, but recompilation is done if VERSION changes from X.? to Y.? . No more errors in both cases.

Copy link
Member

@abergeron abergeron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the version, everything seems fine.

MACOSX_RPATH OFF
# This is the shared library version
VERSION 1.0
VERSION 2.91
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reset this to the right version (1.0 for now)

@notoraptor
Copy link
Contributor Author

Updated. Back to current version (1.0).

@abergeron abergeron merged commit 61fe479 into Theano:master Jan 11, 2017
@notoraptor notoraptor deleted the fix-5345 branch February 3, 2017 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants