This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP][NVPTX]Add NVPTX specific definitions for new/delete operators.
ClosedPublic

Authored by ABataev on Jan 21 2020, 11:28 AM.

Details

Summary

To use new/delete in NVPTX code we need to define them. Implementation
copied from CUDA wrappers.

Diff Detail

Unit TestsFailed

Event Timeline

ABataev created this revision.Jan 21 2020, 11:28 AM
Herald added a project: Restricted Project. · View Herald Transcript

A note: this header file requires to include stdlib.h too to see the declarations of malloc/free. Shall We include it here to fix it? otherwise the error is reported that malloc and free are declared.

A note: this header file requires to include stdlib.h too to see the declarations of malloc/free. Shall We include it here to fix it? otherwise the error is reported that malloc and free are declared.

Including it here seems fine to me. Probably <cstdlib>

jdoerfert accepted this revision.Jan 21 2020, 11:44 AM

Some minor comments but other than that, LGTM.

Nit: Clang format the file

clang/lib/Headers/openmp_wrappers/new
9

Nit: The license usually has C++ style comments //

28

Style: No braces around single statements. We could even call it unconditionally.

44

Style: No braces around single statements. We could even call it unconditionally.

This revision is now accepted and ready to land.Jan 21 2020, 11:44 AM

Unit tests: fail. 62080 tests passed, 1 failed and 784 were skipped.

failed: Clang.Driver/cc-print-options.c

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Some minor comments but other than that, LGTM.

Nit: Clang format the file

It is a formatted file.

ABataev updated this revision to Diff 239399.Jan 21 2020, 12:00 PM

Address comments

Unit tests: fail. 62080 tests passed, 1 failed and 784 were skipped.

failed: Clang.Driver/cc-print-options.c

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

This revision was automatically updated to reflect the committed changes.