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

Add InstanceStruct test data generation helper and unit test #546

Merged
merged 17 commits into from
Mar 13, 2021

Conversation

iomaganaris
Copy link
Contributor

@iomaganaris iomaganaris commented Mar 8, 2021

@pramodk pramodk changed the title Add unit test for InstanceStruct Add InstanceStruct test data generation helper and unit test for the same Mar 8, 2021
@pramodk pramodk changed the title Add InstanceStruct test data generation helper and unit test for the same Add InstanceStruct test data generation helper and unit test Mar 8, 2021
@pramodk
Copy link
Contributor

pramodk commented Mar 8, 2021

@georgemitenkov : going to do some cleanup but this overall gives an idea of what creating data data. See test/unit/codegen/codegen_llvm_instance_struct.cpp.

@georgemitenkov
Copy link
Collaborator

@pramodk @iomaganaris looks great! On LLVM/JIT side, I am working on the following:

  1. Generating a wrapper LLVM function that takes a void pointer and casts it to the struct LLVM pointer type.
  2. Calling a kernel.

Additionally I am thinking of creating functions that can be lowered to LLVM that use CodegenInstanceData to print/compare the results.

@pramodk
Copy link
Contributor

pramodk commented Mar 9, 2021

Additionally I am thinking of creating functions that can be lowered to LLVM that use CodegenInstanceData to print/compare the results.

I am curious what you meant by lowered to LLVM here. If we add such functions in CodegenInstanceData, would that fit the purpose?

@georgemitenkov
Copy link
Collaborator

@pramodk actually you are right, and we do not strictly need it I think. We can always define these on the higher level in CodegenInstanceData. I will make changes to the JIT first, and then we will see if we really need something like this:)

@georgemitenkov
Copy link
Collaborator

@pramodk @iomaganaris I added a sample test case in #549 to show how this would look on LLVM side. I think I have all functions I need in this PR - for the data generation and for member comparisons.

The printing functions are not really necessary - I guess we may need them for visual interpretation only :) So i would say that printfs are sufficient for that now!

}

BREAKPOINT {
SOLVE states METHOD cnexp
Copy link
Collaborator

Choose a reason for hiding this comment

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

@iomaganaris @pramodk I have noticed that when the NEURON does not have current, SOLVE states METHOD cnexp block is added to the kernel for loop:

for ( ... ) {
   SOLVE states METHOD cnexp
   ...
}

This does not affect code generation at all, but I am wondering if we should raise a ticket for this :)

Copy link
Contributor

Choose a reason for hiding this comment

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

@georgemitenkov : I also so that somewhere and its a bug. Could you add ticket with some details?

@pramodk
Copy link
Contributor

pramodk commented Mar 12, 2021

@iomaganaris : could you look at CI fixes?

@iomaganaris
Copy link
Contributor Author

@iomaganaris : could you look at CI fixes?

Yy. I am looking at that atm 👍

@iomaganaris iomaganaris marked this pull request as ready for review March 12, 2021 13:12
@pramodk pramodk merged commit a481af4 into llvm Mar 13, 2021
@pramodk pramodk deleted the magkanar/test-helper branch March 13, 2021 11:35
pramodk added a commit that referenced this pull request May 8, 2021
* CodegenLLVMHelperVisitor improved without hardcoded parameters
* Added get_instance_struct_ptr to get instance structure for variable information
* test/unit/codegen/codegen_data_helper.cpp : first draft implementation
   of codegen data helper
* Added test for typecasting to the proper struct type

Co-authored-by: Pramod Kumbhar <pramod.s.kumbhar@gmail.com>
pramodk added a commit that referenced this pull request Mar 8, 2022
* CodegenLLVMHelperVisitor improved without hardcoded parameters
* Added get_instance_struct_ptr to get instance structure for variable information
* test/unit/codegen/codegen_data_helper.cpp : first draft implementation
   of codegen data helper
* Added test for typecasting to the proper struct type

Co-authored-by: Pramod Kumbhar <pramod.s.kumbhar@gmail.com>
iomaganaris added a commit that referenced this pull request May 10, 2022
* CodegenLLVMHelperVisitor improved without hardcoded parameters
* Added get_instance_struct_ptr to get instance structure for variable information
* test/unit/codegen/codegen_data_helper.cpp : first draft implementation
   of codegen data helper
* Added test for typecasting to the proper struct type

Co-authored-by: Pramod Kumbhar <pramod.s.kumbhar@gmail.com>
iomaganaris added a commit that referenced this pull request May 12, 2022
* CodegenLLVMHelperVisitor improved without hardcoded parameters
* Added get_instance_struct_ptr to get instance structure for variable information
* test/unit/codegen/codegen_data_helper.cpp : first draft implementation
   of codegen data helper
* Added test for typecasting to the proper struct type

Co-authored-by: Pramod Kumbhar <pramod.s.kumbhar@gmail.com>
iomaganaris added a commit that referenced this pull request Sep 15, 2022
* CodegenLLVMHelperVisitor improved without hardcoded parameters
* Added get_instance_struct_ptr to get instance structure for variable information
* test/unit/codegen/codegen_data_helper.cpp : first draft implementation
   of codegen data helper
* Added test for typecasting to the proper struct type

Co-authored-by: Pramod Kumbhar <pramod.s.kumbhar@gmail.com>
iomaganaris added a commit that referenced this pull request Sep 15, 2022
* CodegenLLVMHelperVisitor improved without hardcoded parameters
* Added get_instance_struct_ptr to get instance structure for variable information
* test/unit/codegen/codegen_data_helper.cpp : first draft implementation
   of codegen data helper
* Added test for typecasting to the proper struct type

Co-authored-by: Pramod Kumbhar <pramod.s.kumbhar@gmail.com>
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