Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OCCA Backend #1072

Merged
merged 51 commits into from
Oct 13, 2022
Merged

Update OCCA Backend #1072

merged 51 commits into from
Oct 13, 2022

Conversation

jeremylt
Copy link
Member

@jeremylt jeremylt commented Oct 11, 2022

Closes #816

  • Update for changes in main (rebase or merge?)
  • Move files used in JiT to include/ceed/jit-source/occa (I don't fully understand OCCA but I think we can skip this for now?)
  • Update tests/junit.py (replaces tests/tap.sh to only run tests for t1*-t3* on OCCA backends
  • Update README.md with new OCCA min version and backends
  • Update docs/sphinx/source/releasenotes.md
  • Update CI
  • Odd OCCA_DIR/bin/occa issue

@jeremylt jeremylt self-assigned this Oct 11, 2022
@jeremylt jeremylt force-pushed the occa-backend-update branch from 30a0c58 to a90aabf Compare October 11, 2022 19:17
@jeremylt
Copy link
Member Author

$ ENABLE_OPENCL="OFF" ./configure-cmake.sh

followed by

$ cmake --build build --parallel 16

on Noether leads to

[ 64%] Linking CXX executable bin/c/base
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clBuildProgram'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clEnqueueNDRangeKernel'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clSetKernelArg'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clReleaseMemObject'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clFinish'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clEnqueueUnmapMemObject'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clCreateSubBuffer'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clRetainCommandQueue'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clReleaseContext'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clCreateCommandQueueWithProperties'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clReleaseEvent'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clEnqueueWriteBuffer'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clEnqueueCopyBuffer'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clEnqueueReadBuffer'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clEnqueueBarrierWithWaitList'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clGetProgramBuildInfo'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clCreateContext'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clEnqueueMapBuffer'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clGetDeviceIDs'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clGetDeviceInfo'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clReleaseCommandQueue'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clGetPlatformIDs'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clGetPlatformInfo'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clWaitForEvents'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clGetEventProfilingInfo'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clCreateProgramWithBinary'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clGetKernelWorkGroupInfo'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clGetProgramInfo'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clCreateKernel'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clCreateBuffer'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clCreateProgramWithSource'
/usr/bin/ld: ../lib/libocca.so: undefined reference to `clReleaseKernel'
collect2: error: ld returned 1 exit status
gmake[2]: *** [tests/CMakeFiles/bin-c-base.dir/build.make:98: tests/bin/c/base] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1441: tests/CMakeFiles/bin-c-base.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

So it seems that disabling OpenCL is not being respected?

If I don't try to disable OpenCL, I get the warning

CMake Warning at CMakeLists.txt:82 (add_library):
  Cannot generate a safe runtime search path for target libocca because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libOpenCL.so.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /opt/intel/oneapi/compiler/latest/linux/lib
      /opt/rocm/lib

@jeremylt jeremylt force-pushed the occa-backend-update branch 2 times, most recently from bb629b9 to 4b44f72 Compare October 11, 2022 22:35
@jeremylt jeremylt force-pushed the occa-backend-update branch from 4b44f72 to f5aae5b Compare October 11, 2022 22:43
.gitlab-ci.yml Outdated Show resolved Hide resolved
@jeremylt jeremylt force-pushed the occa-backend-update branch from 0a05b64 to 6604735 Compare October 12, 2022 16:25
@jeremylt
Copy link
Member Author

jeremylt commented Oct 12, 2022

@kris-rowe, clang-tidy is generating this warning

/var/lib/gitlab-runner/builds/N8GCsqus/0/libceed/occa-1.4.0/install/include/occa/core/kernelArg.hpp:79:5: warning: Call to virtual method 'kernelArg::primitiveConstructor' during construction bypasses virtual dispatch [clang-analyzer-optin.cplusplus.VirtualCall]
    OCCA_GENERIC_CLASS_CONSTRUCTORS(kernelArg);
    ^
/var/lib/gitlab-runner/builds/N8GCsqus/0/libceed/occa-1.4.0/install/include/occa/types/generic.hpp:44:5: note: expanded from macro 'OCCA_GENERIC_CLASS_CONSTRUCTORS'
    primitiveConstructor(arg);                      \

should we be worried?

Unfortunately, this is proving to be very difficult to mark as // NOLINT. It doesn't track easily to single lines and every time one warning goes away, it goes somewhere else.

I'm fine opening an issue to fix these clang-tidy warnings down the road.

@kris-rowe
Copy link
Collaborator

I don't think the issues related to these warnings will cause any major problems.

(Adding a linter to the OCCA CI pipeline is on the todo list. I am certain there are lots of things that will be uncovered when we do).

@jeremylt jeremylt requested a review from kris-rowe October 13, 2022 15:15
@jeremylt
Copy link
Member Author

Thanks - In that case I think we are ready to merge this.

Copy link
Member

@jedbrown jedbrown left a comment

Choose a reason for hiding this comment

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

Thanks for this work. Is my understanding correct that this now runs the lower level tests in CI, and passes most higher level tests when using qfunctions (with the syntax workarounds) from a different OCCA branch that will be rebased after this merges? If so, that plan sounds good to me.

doc/sphinx/source/releasenotes.md Show resolved Hide resolved
@jeremylt
Copy link
Member Author

Is my understanding correct that this now runs the lower level tests in CI,

Yes, we test t0-t3 in CI

and passes most higher level tests when using qfunctions (with the syntax workarounds) from a different OCCA branch that will be rebased after this merges?

That is my understanding as well

@jeremylt jeremylt merged commit 0be03a9 into main Oct 13, 2022
@jeremylt jeremylt deleted the occa-backend-update branch October 13, 2022 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OCCA Backend
3 participants