Skip to content

Conversation

@mcourteaux
Copy link
Contributor

I put quite some work in this one, but the result is glorious. The string manipulations are not the most rigorous ones, but they work for me. This highlighting is only processed for PTX code, based on the buffer name being "cuda_gpu_source_kernels". Here is an example of the syntax-highlighted PTX code:

image

Some features:

  • comments
  • labels
  • predicates
  • register matching
  • numeric literals
  • collapsible blocks per kernel function
  • shading for vectorized instructions.
  • memory accesses in red
  • different colors per datatype

@mcourteaux
Copy link
Contributor Author

Spotted a bug. Will push fix soon.

@abadams
Copy link
Member

abadams commented Nov 25, 2021

Seems like a lot of work for something minor, but the result does indeed look very nice!

@mcourteaux
Copy link
Contributor Author

Buildbot being unhappy with

correctness_partition_max_filter: /home/halidenightly/build_bot/worker/llvm-14-x86-64-linux/llvm-project/llvm/include/llvm/IR/User.h:170: llvm::Value* llvm::User::getOperand(unsigned int) const: Assertion `i < NumUserOperands && "getOperand() out of range!"' failed.

Is not my bad, right? This seems completely unrelated.

@abadams
Copy link
Member

abadams commented Nov 26, 2021

Yeah that's probably some change in trunk llvm temporarily breaking things. Your code can't possibly be responsible.

@abadams abadams merged commit 76c0946 into halide:master Nov 26, 2021
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.

2 participants